Commons VFS 和 IBM MVS 系统
我正在使用 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);
I'm using Apache Commons VFS / SFTP, we are trying to download files from the IBM MVS system.
The download part is all good, however, we can not open up the zipped files after downloading. Seems like the zip file was compressed using a different algorithm or something
Anyone has any pointers?
*Note, the same function works fine if we connect to a regular unix/linux SFTP server.
Below is an example of what we did
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是大型机专家,但我假设您连接的不是 MVS,而是运行 FTP 或 SSH 守护进程的 USS(Unix 系统服务)。
我只尝试通过 FTP 从 USS 下载文件,常规 Windows FTP 可以很好地交换和打开文件。但没有二进制。
因此,我不认为您会获得 EBCDIC 编码的文件。
您是否尝试过下载一个简单的文本文件?
您是否尝试过下载带有特殊字符的文本文件?例如,德语元音变音或其他非 ASCII?
I am not a mainframe expert but I assume you connect not to MVS but to the USS (Unix System Services) which run either FTP or SSH daemon.
I only tried to download files via FTP from USS with a regular Windows FTP could exchange and open the files fine. No binary thouhg.
Thus, I do not assume that you would get files in EBCDIC encoding.
Have you tried downloading a simple text file?
Have you tried downloading a text file with special characters? e.g. German umlauts or other non-ASCII?
有几件事需要尝试:
指定 BINARY 选项,因为我认为默认是 EBCDIC-ASCII 转换。这会对 zip 文件造成可怕的影响。如果您可以下载纯文本文件,那可能会是您的麻烦。
压缩数据是否可能是您的系统不喜欢的数据,例如 PDS?
阅读此页面 http://www.cbttape.org/downloadtrouble.htm
A couple things to try:
specify the BINARY option as I think the default is EBCDIC-ASCII translation. This will do horrible things to a zip file. If you can download a plain text file that may be your trouble.
Could the zipped data be something your system doesn't like such as a PDS?
have a read of this page http://www.cbttape.org/downloadtrouble.htm