如何在Mac OS X上获取文件类型?

10 java filesystems macos file-type file

我正在使用此代码来获取文件类型 -

FileSystemView filesystem = FileSystemView.getFileSystemView();
String sFileType = filesystem.getSystemTypeDescription(file))
Run Code Online (Sandbox Code Playgroud)

在Windows下,此代码工作文件,正确显示文件类型.但是在Mac OS X下,它没有显示任何代码.方法getSystemTypeDescription说:

覆盖具有本机ShellFolder实现的平台.

怎么做以及如何在Mac OS X上获取文件类型?

ale*_*oot 1

看一下Quaqua库,它有一个类OSXLionFileSystemView,它是默认 FileSystemView 的重写版本,并且应该在 OS X Lion 上正常工作......