Examples of storeFile()


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

                    Boolean passiveMode = (Boolean) context.get("passiveMode");
                    boolean passive = (passiveMode == null) ? true : passiveMode.booleanValue();
                    if (passive) { ftp.enterLocalPassiveMode(); }

                    Debug.logInfo("[putFile] storing local file remotely as: " + context.get("remoteFilename"), module);
                    if (!ftp.storeFile((String) context.get("remoteFilename"), localFile)) {
                        Debug.logInfo("[putFile] store was unsuccessful", module);
                        errorList.add(UtilProperties.getMessage(resource, "CommonFtpFileNotSentSuccesfully", UtilMisc.toMap("replyString", ftp.getReplyString()), locale));
                    } else {
                        Debug.logInfo("[putFile] store was successful", module);
                        List<String> siteCommands = checkList(context.get("siteCommands"), String.class);
View Full Code Here

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

       
        assertTrue(client1.login(ADMIN_USERNAME, ADMIN_PASSWORD));
        assertTrue(client1.makeDirectory("foo"));
        assertTrue(client1.makeDirectory("foo2"));
        assertTrue(client1.removeDirectory("foo2"));
        assertTrue(client1.storeFile(TEST_FILENAME, new ByteArrayInputStream(TESTDATA)));
        assertTrue(client1.storeFile(TEST_FILENAME, new ByteArrayInputStream(TESTDATA)));
        assertTrue(client1.retrieveFile(TEST_FILENAME, new ByteArrayOutputStream()));
        assertTrue(client1.deleteFile(TEST_FILENAME));
       
        assertTrue(client1.logout());
View Full Code Here

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

        assertTrue(client1.login(ADMIN_USERNAME, ADMIN_PASSWORD));
        assertTrue(client1.makeDirectory("foo"));
        assertTrue(client1.makeDirectory("foo2"));
        assertTrue(client1.removeDirectory("foo2"));
        assertTrue(client1.storeFile(TEST_FILENAME, new ByteArrayInputStream(TESTDATA)));
        assertTrue(client1.storeFile(TEST_FILENAME, new ByteArrayInputStream(TESTDATA)));
        assertTrue(client1.retrieveFile(TEST_FILENAME, new ByteArrayOutputStream()));
        assertTrue(client1.deleteFile(TEST_FILENAME));
       
        assertTrue(client1.logout());
        client1.disconnect();
View Full Code Here

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

                        } else {
                            File infile = new File(local);
                            res.setBytes((int)infile.length());
                            input = new BufferedInputStream(new FileInputStream(infile));
                        }
                        ftpOK = ftp.storeFile(remote, input);
                    } else {
                        final boolean saveResponse = isSaveResponse();
                        ByteArrayOutputStream baos=null; // No need to close this
                        OutputStream target=null; // No need to close this
                        if (saveResponse){
View Full Code Here

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

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

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

                        } else {
                            File infile = new File(local);
                            res.setBytes((int)infile.length());
                            input = new BufferedInputStream(new FileInputStream(infile));
                        }
                        ftpOK = ftp.storeFile(remote, input);
                    } else {
                        final boolean saveResponse = isSaveResponse();
                        ByteArrayOutputStream baos=null; // No need to close this
                        OutputStream target=null; // No need to close this
                        if (saveResponse){
View Full Code Here

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

                    Boolean passiveMode = (Boolean) context.get("passiveMode");
                    boolean passive = (passiveMode == null) ? true : passiveMode.booleanValue();
                    if (passive) { ftp.enterLocalPassiveMode(); }

                    Debug.logInfo("[putFile] storing local file remotely as: " + context.get("remoteFilename"), module);
                    if (!ftp.storeFile((String) context.get("remoteFilename"), localFile)) {
                        Debug.logInfo("[putFile] store was unsuccessful", module);
                        errorList.add("File not sent succesfully: " + ftp.getReplyString());
                    } else {
                        Debug.logInfo("[putFile] store was successful", module);
                        List<String> siteCommands = checkList(context.get("siteCommands"), String.class);
View Full Code Here

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

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

      in = new FileInputStream("entryToken.txt");
      client.storeFile("entryToken.txt", in);
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }
      res = true;
      client.logout();
View Full Code Here

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

      String filename = xmlFilePath;

      fis = new FileInputStream(filename);

      client.storeFile(filename, fis);
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }
      if (debugMode)
        System.out.print(client.getReplyString());
View Full Code Here

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

                        } else {
                            File infile = new File(local);
                            res.setBytes((int)infile.length());
                            input = new FileInputStream(infile);
                        }
                        ftpOK = ftp.storeFile(remote, input);
                    } else {
                        final boolean saveResponse = isSaveResponse();
                        ByteArrayOutputStream baos=null; // No need to close this
                        OutputStream target=null; // No need to close this
                        if (saveResponse){
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.