× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Gary,

Below is how I am sending the file.  Unfortunately I do not have access
to the logs.  I have not enclosed the file name in apostrophes here
because it will not work.  When I try to FTP this file, it will
concatenate the user name to dataset.  So instead of just "BC.CPC.PAY",
it will go as "username.BC.CPC.PAY"

try {
        String fileDir = "C:\\eclipse\\workspace\\cac\\COFERS\\";
        String file = "BC.CPC.PAY";
        FileInputStream fileStream = new FileInputStream(fileDir +
file);

        

        // Connect
        // long startTime = System.currentTimeMillis();
        FTPProgressMonitor progressMonitor = null;

        FTPClient ftp = new FTPClient();
        ftp.setRemoteHost("hostname");
        
        FTPMessageCollector listener = new FTPMessageCollector();
        ftp.setMessageListener(listener);
        FTPReply reply = null;

        // Connect
        ftp.connect();

        // Login
        ftp.login("username", "password");
        ftp.setConnectMode(FTPConnectMode.PASV);

        // monitor transfer progress
        ftp.setProgressMonitor(progressMonitor);
        ftp.setType(FTPTransferType.ASCII);

        String message = listener.getLog();
        log.debug("message = " + message);
        System.out.println("message = " + message);

        try {
                ftp.put(fileStream, "BC.CPC.PAY", true);

                reply = ftp.getLastValidReply();
                ftp.quit();     
        } catch (InterruptedIOException iioe) {
                        ftp.quit();
                        throw iioe;
                }
                } catch (Exception e) {
                        e.printStackTrace();
                }

Chad Cornelius, IIS
(720) 921-7835


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary L Peskin
Sent: Monday, December 12, 2005 9:50 AM
To: 'Java Programming on and around the iSeries / AS400'
Subject: RE: Java FTP

Can you include the relevant parts of your code and an explanation of
what
happens when you try to execute it and why it doesn't work?  Are you
seeing
anything in the mainframe FTP logs?  Have you tried looking at a comm
trace?

Gary 

> -----Original Message-----
> From: java400-l-bounces@xxxxxxxxxxxx 
> [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of cornelius, chad
> Sent: Monday, December 12, 2005 8:26 AM
> To: Java Programming on and around the iSeries / AS400
> Subject: Java FTP
> 
> A while back I inquired if anyone has FTP'd a dataset to a 
> Mainframe using Java.  There were suggestions to enclose the 
> file within apostrophes (single ticks).  I have yet to get 
> this to work.  I am using the EdtFTP API.  Has anyone 
> successfully accomplished this?  If so, would you mind 
> sharing an example?  Keep in mind I know nothing about Mainframes.
> 
>  
> 
> Thanks,
> 
> Chad Cornelius, IIS
> 
> (720) 921-7835
> 
>  
> 
> --
> This is the Java Programming on and around the iSeries / 
> AS400 (JAVA400-L) mailing list To post a message email: 
> JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change 
> list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, 
> please take a moment to review the archives at 
> http://archive.midrange.com/java400-l.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.