Examples of storeFile()


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

          ftp.enterLocalPassiveMode();// should probably come from the setup dialog
          boolean ftpOK=false;
                if (isUpload()) {
                  File infile = new File(local);
                    input = new FileInputStream(infile);
                    ftpOK = ftp.storeFile(remote, input);                   
                    res.setBytes((int)infile.length());
                } else {
                    final boolean saveResponse = isSaveResponse();
                  ByteArrayOutputStream baos=null; // No need to close this
                  OutputStream target=null; // No need to close this
View Full Code Here

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

            {
                InputStream input;

                input = new FileInputStream(local);

                ftp.storeFile(remote, input);

                input.close();
            }
            else if (listFiles)
            {
View Full Code Here

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

          if (subFile.isDirectory()) {//是目录的话
            processFolder(subFile, ftpClient);
          } else {//是文件
            fileName = subFile.getName();
            input = new FileInputStream(subFile);
            ftpClient.storeFile(fileName, input);
          }
          }
        }
      input.close();
      ftpClient.logout();
View Full Code Here

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

      ftp.setFileType(FTP.ASCII_FILE_TYPE);
      ftp.setAutodetectUTF8(true);
     
      // Store a file
      InputStream in = IOUtils.toInputStream("Test Content");
      ftp.storeFile(name1, in);
     
      in.close();

      tx.success();
View Full Code Here

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

                url = this.url.toString().replaceFirst(this.url.getPath(), "")+"/";
            } else {
                url = this.url.toString();
            }

            if (!ftp.storeFile(filename, in)) {
                throw new JMSException("FTP store failed: " + ftp.getReplyString());
            }
            return new URL(url + filename);
        } finally {
            ftp.quit();
View Full Code Here

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

    try {
      FTPClient ftpClient = null;
      try {
        ftpClient = connect();
        ftpClient.setFileType( FTPClient.BINARY_FILE_TYPE );
        if (!ftpClient.storeFile( getFullPath( filename ), inputStream )) {
          throw new RuntimeException( "Sending file was not successfull. FTPClient.storeFile() returned false" );
        }
      } finally {
        disconnect( ftpClient );
      }
View Full Code Here

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

      FTPClient ftp = null;
      try {
        ftp = connectionManager.getFTP();
        ftp.cwd(connectionManager.getConfig().getFtpDir());
        ftp.enterLocalPassiveMode();
        if (!ftp.storeFile(file.getName(), new FileInputStream(file))) {
          throw new FTPException("Error during FTP store file.");
        }

      } finally {
        ftp.logout();
View Full Code Here

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

            {
                InputStream input;

                input = new FileInputStream(local);

                ftp.storeFile(remote, input);

                input.close();
            }
            else
            {
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPSClient.storeFile()

            {
                InputStream input;

                input = new FileInputStream(local);

                ftps.storeFile(remote, input);

                input.close();
            }
            else
            {
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPSClient.storeFile()

            {
                InputStream input;

                input = new FileInputStream(local);

                ftps.storeFile(remote, input);

                input.close();
            }
            else
            {
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.