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("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()

            {
                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()

            {
                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()

                        } 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()

       
        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()

        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.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()

            if (storeFile)
            {
                InputStream input;

                input = new FileInputStream(local);
                ftp.storeFile(remote, input);
            }
            else
            {
                OutputStream output;
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.