Examples of changeWorkingDirectory()


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

        if ((path.length() >= 2) && (path.charAt(1) == '~'))
        {
            path = path.substring(1);
        }

        if (!client.changeWorkingDirectory(path))
        {
            throw new IOException(MessageFormat.format("Failed to change working directory to {0}. Ftp error: {1}",
                                                       path, client.getReplyCode()));
        }
        return client;
View Full Code Here

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

   */
  public void fetchFromPubChem(String emailAddress, boolean inCambridge) throws Exception {
    FTPClient ftpc = new FTPClient();
    ftpc.connect("ftp.ncbi.nlm.nih.gov");
    ftpc.login("anonymous", emailAddress);
    ftpc.changeWorkingDirectory("/pubchem/Compound/CURRENT-Full/SDF/");
   
    String [] names = ftpc.listNames();
    ftpc.disconnect();
   
    for(int i=0;i<names.length;i++) {
View Full Code Here

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

        return false;
      if (!FTPReply.isPositiveCompletion(client.getReplyCode()))
        return false;
     
      client.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
      client.changeWorkingDirectory("Flibus");

      out = new FileOutputStream("entryToken.txt");
      out.write((new String(new Boolean(val).toString())).getBytes());
      out.close();
View Full Code Here

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

      }

      if (debugMode)
        System.out.println("Le dossier courant est: " + client.printWorkingDirectory());

      if (!client.changeWorkingDirectory("Flibus"))
        return false;
      if (debugMode)
        System.out.print(client.getReplyString());

      // client.enterLocalPassiveMode();
View Full Code Here

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

      client.login(ftpLogin, ftpPass);
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }
      client.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
      client.changeWorkingDirectory("Flibus");
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }

      String filename = xmlFilePath;
View Full Code Here

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

      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }

      client.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
      client.changeWorkingDirectory("Flibus");

      fos = new FileOutputStream("entryToken.txt");
      if (!client.retrieveFile("entryToken.txt", fos))
        return false;
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
View Full Code Here

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

        }
        String path = url.getPath();
        String workingDir = path.substring(0, path.lastIndexOf("/"));
        String file = path.substring(path.lastIndexOf("/")+1);
       
        ftp.changeWorkingDirectory(workingDir);
        ftp.setFileType(FTPClient.BINARY_FILE_TYPE);
        InputStream input = ftp.retrieveFileStream(file);
        ftp.quit();
        ftp.disconnect();
       
View Full Code Here

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

            if (action == MK_DIR) {
                makeRemoteDir(ftp, remotedir);
            } else {
                if (remotedir != null) {
                    log("changing the remote directory", Project.MSG_VERBOSE);
                    ftp.changeWorkingDirectory(remotedir);
                    if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                        throw new BuildException("could not change remote "
                             + "directory: " + ftp.getReplyString());
                    }
                }
View Full Code Here

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

    private void ftpUpload(String srcFileName, String distLocation) throws IOException {
        FTPClient client = new FTPClient();
        FileInputStream fis = null;
        client.connect(srvHost);
        client.login(userName, password);
        client.changeWorkingDirectory(distLocation);
        String filename = srcFileName;
        fis = new FileInputStream(filename);
        client.storeFile(filename, fis);
        client.logout();
        fis.close();
View Full Code Here

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

            String workingDir = path.substring(0, path.lastIndexOf("/"));
        String filename = message.getMessageId().toString().replaceAll(":", "_");
            ftp.setFileType(FTPClient.BINARY_FILE_TYPE);
           
            String url;
            if(!ftp.changeWorkingDirectory(workingDir)) {
              url = this.url.toString().replaceFirst(this.url.getPath(), "")+"/";
            } else {
              url = this.url.toString();
            }
           
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.