Package org.apache.commons.net.ftp

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


      try {
        if (fos != null) {
          fos.close();
        }
       
        client.disconnect();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    return res;
View Full Code Here


    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try
      {
      client.disconnect();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here

    } finally {
      try {
        if (fis != null) {
          fis.close();
        }
        client.disconnect();
        if (debugMode)
          System.out.print(client.getReplyString());
      } catch (java.io.IOException e) {
        res = false;
        Error.setText(Error.getText().concat(e.getMessage()));
View Full Code Here

    } finally {
      try {
        if (fos != null) {
          fos.close();
        }
        client.disconnect();
      } catch (java.io.IOException e) {
        e.printStackTrace();
      }
    }
    if (res)
View Full Code Here

                try {
                    ftp.logout();
                } catch (IOException ignored) {
                }
                try {
                    ftp.disconnect();
                } catch (IOException ignored) {
                }
            }
            IOUtils.closeQuietly(input);
            IOUtils.closeQuietly(output);
View Full Code Here

        FTPClient client = savedClient;
        if (client != null) {
            savedClient = null;
            try {
                client.abort();
                client.disconnect();
            } catch (IOException ignored) {
            }
        }
        return client != null;
    }
View Full Code Here

          throw new JMSException("Problem connecting the FTP-server");
        }
       
        if(!ftp.login(ftpUser, ftpPass)) {
          ftp.quit();
            ftp.disconnect();
            throw new JMSException("Cant Authentificate to FTP-Server");
        }
        String path = url.getPath();
        String workingDir = path.substring(0, path.lastIndexOf("/"));
        String file = path.substring(path.lastIndexOf("/")+1);
View Full Code Here

       
        ftp.changeWorkingDirectory(workingDir);
        ftp.setFileType(FTPClient.BINARY_FILE_TYPE);
        InputStream input = ftp.retrieveFileStream(file);
        ftp.quit();
        ftp.disconnect();
       
        return input;
    }
   
    private void setUserInformation(String userInfo) {
View Full Code Here

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

        } catch (IOException ioe) {
            errorList.add("Problem with FTP transfer: " + ioe.getMessage());
        } finally {
            if (ftp.isConnected()) {
                try {
                    ftp.disconnect();
                } catch (IOException dce) {
                    Debug.logWarning(dce, "[getFile] Problem with FTP disconnect", module);
                }
            }
        }
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.