Package it.sauronsoftware.ftp4j

Examples of it.sauronsoftware.ftp4j.FTPClient.changeDirectory()


        final FTPClient client = this.getClient();
        if (null != client
                && client.isConnected()
                && StringUtils.hasText(_workingFolder)) {
            try {
                client.changeDirectory("/");
                final LinkedList<String> list = new LinkedList<String>();
                this.getChildren(client,
                        list, "",
                        0, deepLevel);
View Full Code Here


        final FTPClient client = this.getClient();
        if (null != client
                && client.isConnected()
                && StringUtils.hasText(_workingFolder)) {
            try {
                client.changeDirectory("/");
                if (!_workingFolder.equalsIgnoreCase("/")) {
                    client.createDirectory(_workingFolder);
                }
                return true;
            } catch (FTPException ex) {
View Full Code Here

        final FTPClient client = this.getClient();
        if (null != client
                && client.isConnected()
                && StringUtils.hasText(_fileName)) {
            try {
                client.changeDirectory("/");
                if (StringUtils.hasText(_workingFolder)) {
                    client.changeDirectory(_workingFolder);
                }
                client.download(_fileName, temp);
            } catch (FTPException ex) {
View Full Code Here

                && client.isConnected()
                && StringUtils.hasText(_fileName)) {
            try {
                client.changeDirectory("/");
                if (StringUtils.hasText(_workingFolder)) {
                    client.changeDirectory(_workingFolder);
                }
                client.download(_fileName, temp);
            } catch (FTPException ex) {
                // file doe not exists, file not found
                if (ex.getCode() != 450
View Full Code Here

                && client.isConnected()
                && StringUtils.hasText(_fileName)) {
            if (file.exists()) {
                final FileInputStream is = new FileInputStream(file);
                try {
                    client.changeDirectory("/");
                    if (StringUtils.hasText(_workingFolder)) {
                        client.changeDirectory(_workingFolder);
                    }
                    client.upload(_fileName, is, 0, 0, null);
                } finally {
View Full Code Here

            if (file.exists()) {
                final FileInputStream is = new FileInputStream(file);
                try {
                    client.changeDirectory("/");
                    if (StringUtils.hasText(_workingFolder)) {
                        client.changeDirectory(_workingFolder);
                    }
                    client.upload(_fileName, is, 0, 0, null);
                } finally {
                    is.close();
                }
View Full Code Here

        }

        FTPClient client = new FTPClient();
        client.connect(Shared.getConfig("ftpBackupAddr"), Integer.parseInt(Shared.getConfig("ftpPort")));
        client.login(Shared.getConfig("ftpBackupUser"), Shared.getConfig("ftpBackupPassword"));
        client.changeDirectory("/" + Shared.getConfig("storeName"));
        File f = new File(Constants.tmpDir + fileName);
        client.upload(f);
        client.disconnect(false);

    }
View Full Code Here

            if ( mode.equals("FTP") ){
                FTPClient client = new FTPClient();
                client.connect(Shared.getConfig("ftpHost"));
                client.login(Shared.getConfig("ftpUser"), Shared.getConfig("ftpPass"));
                client.changeDirectory(Shared.getConfig("ftpDir"));
                File ff = new File(Constants.tmpDir + Shared.getConfig("tmpFtpFileName"));
                client.download("GT99_A09.rar", ff );
                client.disconnect(false);
                Shared.prepareMovements( ff );
            }else if ( mode.equals("File") ) {
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.