我正在使用 Apache Commons VFS / SFTP,我们正在尝试从 IBM MVS 系统下载文件。
下载部分很好,但是下载后我们无法打开压缩文件。似乎 zip 文件是使用不同的算法或其他东西压缩的
有人有任何指示吗?
*注意,如果我们连接到常规的 unix/linux SFTP 服务器,同样的功能可以正常工作。
下面是我们所做的一个例子
String defaultHost = "[my sftp ip address]";
String host = defaultHost;
String defaultRemotePath = "//__root.dir1.dir2.";
String remotePath = defaultRemotePath;
String user = "test";
String password = "test";
String remoteFileName = "Blah.ZIP.BLAH";
log.info("FtpPojo() begin instantiation");
FileObject localFileObject = fsManager.resolveFile("C:/Work/Blah.ZIP.BLAH");
log.debug("local file name is :"+localFileObject.getName().getBaseName());
log.debug("FtpPojo() instantiated and fsManager created");
String uri = createSftpUri(host, user, password) + ":322"+remotePath+remoteFileName;
remoteRepo = fsManager.resolveFile(uri, fsOptions);
remoteRepo.copyFrom(localFileObject, Selectors.SELECT_ALL);