Examples of retrieveFile()


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

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

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

                    if (!ftp.retrieveFile((String) context.get("remoteFilename"), localFile)) {
                        errorList.add(UtilProperties.getMessage(resource, "CommonFtpFileNotSentSuccesfully", UtilMisc.toMap("replyString", ftp.getReplyString()), locale));
                    }
                }
                ftp.logout();
            }
View Full Code Here

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

            {
                OutputStream output;

                output = new FileOutputStream(local);

                ftp.retrieveFile(remote, output);

                output.close();
            }

            ftp.logout();
View Full Code Here

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

        client.setFileType(FTP.BINARY_FILE_TYPE);
        client.enterLocalPassiveMode();

        final ByteArrayOutputStream os = new ByteArrayOutputStream();
        try {
            client.retrieveFile(path, os);
            client.logout();
        } finally {
            client.disconnect();
        }
        return new ByteArrayInputStream(os.toByteArray());
View Full Code Here

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

        client.setFileType(FTPClient.BINARY_FILE_TYPE);
        String[] pathes = this.getPath().replaceAll("\\\\", "/").split("/");
        String filename = pathes[pathes.length - 1];
        cwdFtpTo(client, true);
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        client.retrieveFile(filename, outputStream);
        outputStream.close();
        byte buffer[] = outputStream.toByteArray();
        client.disconnect();
        log.debug("read ftp done");
        return buffer;
View Full Code Here

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

            // -----------------
            String fileName = getFileName(logger);
            logger.logMessage("Retrieving file: " + fileName, this, MessageLogger.DEBUG);
            OutputStream dataStream = new ByteArrayOutputStream();
            try {
                if(!ftp.retrieveFile(fileName, dataStream)) {
                    logger.logMessage("Could not retrieve file '" + fileName + "': "
                            + ftp.getReplyString(), this, MessageLogger.WARNING);
                    PipeComponentUtils.abortTransfer();
                }
                String charSet=this.data.getAttribute(CHARSET_ATTR);
View Full Code Here

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

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

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

                    if (!ftp.retrieveFile((String) context.get("remoteFilename"), localFile)) {
                        errorList.add(UtilProperties.getMessage(resource, "CommonFtpFileNotSentSuccesfully", UtilMisc.toMap("replyString", ftp.getReplyString()), locale));
                    }
                }
                ftp.logout();
            }
View Full Code Here

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

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

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

                    if (!ftp.retrieveFile((String) context.get("remoteFilename"), localFile)) {
                        errorList.add("File not received succesfully: " + ftp.getReplyString());
                    }
                }
                ftp.logout();
            }
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.