Package org.apache.commons.net.ftp

Examples of org.apache.commons.net.ftp.FTPClient.logout()


                output = new FileOutputStream(local);
                ftp.retrieveFile(remote, output);
            }

            ftp.logout();
        }
        catch (FTPConnectionClosedException e)
        {
            error = true;
            System.err.println("Server closed connection.");
View Full Code Here


            res.setResponseMessage(ex.toString());
        } finally {
            savedClient = null;
            if (ftp.isConnected()) {
                try {
                    ftp.logout();
                } catch (IOException ignored) {
                }
                try {
                    ftp.disconnect();
                } catch (IOException ignored) {
View Full Code Here

    }

    protected void disconnect(SocketClient client) throws Exception {
        FTPClient ftp = (FTPClient) client;
        if (ftp.isConnected()) {
            ftp.logout();
        }
        super.disconnect(client);
    }

    protected SocketClient createSocketClient() {
View Full Code Here

                                }
                            }
                        }
                    }
                }
                ftp.logout();
            }
        } catch (IOException ioe) {
            Debug.log(ioe, "[putFile] caught exception: " + ioe.getMessage(), module);
            errorList.add("Problem with FTP transfer: " + ioe.getMessage());
        } finally {
View Full Code Here

                    if (!ftp.retrieveFile((String) context.get("remoteFilename"), localFile)) {
                        errorList.add("File not received succesfully: " + ftp.getReplyString());
                    }
                }
                ftp.logout();
            }
        } catch (IOException ioe) {
            errorList.add("Problem with FTP transfer: " + ioe.getMessage());
        } finally {
            if (ftp.isConnected()) {
View Full Code Here

      //DEPENDS ON NAMING CONVENTION for the models-here ANNs were used so it is netASC_ID.m
      String filename = "net"+ASC_ID+".m";
      String pathname="YOUR_RULE_STORING_PATH"; //DEPENDS ON WHERE THE RULES ARE STORED IN THE OCTAVE SCRIPT
      fis = new FileInputStream(pathname+filename);
      client.storeFile("/uploads/rules/"+filename, fis);//possible change according to path on FTP server
      client.logout();
    } catch (IOException e) {
     
      System.out.println("Error connecting to ftp server for storing rules....");
      e.printStackTrace();
    }finally {
View Full Code Here

__main:
        try
        {
            if (!ftp.login(username, password))
            {
                ftp.logout();
                error = true;
                break __main;
            }

            System.out.println("Remote system is " + ftp.getSystemName());
View Full Code Here

                output = new FileOutputStream(local);
                ftp.retrieveFile(remote, output);
            }

            ftp.logout();
        }
        catch (FTPConnectionClosedException e)
        {
            error = true;
            System.err.println("Server closed connection.");
View Full Code Here

            throw new BuildException("error during FTP transfer: " + ex);
        } finally {
            if (ftp != null && ftp.isConnected()) {
                try {
                    log("disconnecting", Project.MSG_VERBOSE);
                    ftp.logout();
                    ftp.disconnect();
                } catch (IOException ex) {
                    // ignore it
                }
            }
View Full Code Here

__main:
        try
        {
            if (!ftp.login(username, password))
            {
                ftp.logout();
                error = true;
                break __main;
            }

            System.out.println("Remote system is " + ftp.getSystemName());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.