我知道当文件在本地时如何转换它。但是当文件在远程服务器上时如何转换这里我说的是
org.apache.commons.vfs.FileObject
这就是在本地服务器上完成的方式-
public static FileObject changeStringToFileObject(String path) {
FileObject file = null;
LocalFileProvider provider = new DefaultLocalFileProvider();
try {
file = provider.findLocalFile(new File(path));
} catch (FileSystemException ex) {
logger.log(Level.SEVERE, null, ex);
}
return file;
}