Page 1 of 1

FTP a file from mainframe using JAVA

PostPosted: Wed Nov 14, 2012 2:41 pm
by RadAl3
Hello All ,
Say I have a file file.txt on my mainframe host xxx.xxx.xxx.xx created by user QWERTY in the path TEST. I would like to ftp this file from mainframe to my unix machine. When I run the code
fsDataInputStream=ftpFileSystem.open(new Path ("ftp://QWERTY@xxx.xxx.xxx.xx'TEST/file.txt'") );


the error I get is "Path ftp://QWERTY@xxx.xxx.xxx.xx'TEST/file.txt' is a directory."

On giving
 fsDataInputStream = ftpFileSystem.open(new Path('TEST/file.txt'), 1000);


I get the error : File 'QWERTY.'/'TEST/file.txt does not exist. It appends the 'QWERTY.'/' on its own.

Any pointers on how to give this file path name ?

Re: FTP a file from mainframe using JAVA

PostPosted: Wed Nov 14, 2012 5:21 pm
by Robert Sample
Have you tried specifying the complete path name in ftpFileSystem.open? Since you're connecting from another system, there's no environment information available such as the home directory for user QWERTY.

Re: FTP a file from mainframe using JAVA

PostPosted: Thu Nov 15, 2012 2:27 pm
by RadAl3
Thanks Robert . I did try that also but in vain . I finally found the way out. By not using FtpFileSystem , rather using other FTP api's ..

Re: FTP a file from mainframe using JAVA

PostPosted: Thu Nov 15, 2012 3:16 pm
by Robert Sample
Glad to hear you got it resolved.

Re: FTP a file from mainframe using JAVA

PostPosted: Fri Nov 23, 2012 6:40 pm
by wangy
You can just use the FTP command.

Re: FTP a file from mainframe using JAVA

PostPosted: Sun Nov 25, 2012 6:33 am
by dick scherrer
Hello,

There is not much value added when you re-post the solution the poster has already posted . . .