Examples of changeWorkingDirectory()


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

    // file
    // on the server by opening up an InputStream. As a side effect the working
    // directory on the server is changed to the parent directory of the file.
    // The FTP client connection is closed when close() is called on the
    // FSDataInputStream.
    client.changeWorkingDirectory(parent.toUri().getPath());
    InputStream is = client.retrieveFileStream(file.getName());
    FSDataInputStream fis = new FSDataInputStream(new FTPInputStream(is,
        client, statistics));
    if (!FTPReply.isPositivePreliminary(client.getReplyCode())) {
      // The ftpClient is an inconsistent state. Must close the stream
View Full Code Here

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

    // Change to parent directory on the server. Only then can we write to the
    // file on the server by opening up an OutputStream. As a side effect the
    // working directory on the server is changed to the parent directory of the
    // file. The FTP client connection is closed when close() is called on the
    // FSDataOutputStream.
    client.changeWorkingDirectory(parent.toUri().getPath());
    FSDataOutputStream fos = new FSDataOutputStream(client.storeFileStream(file
        .getName()), statistics) {
      @Override
      public void close() throws IOException {
        super.close();
View Full Code Here

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

                // String root = getRoot().getName().getPath();

                Boolean userDirIsRoot = FtpFileSystemConfigBuilder.getInstance().getUserDirIsRoot(fileSystemOptions);
                if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue()))
                {
                    if (!client.changeWorkingDirectory(workingDirectory))
                    {
                        throw new FileSystemException("vfs.provider.ftp/change-work-directory.error", workingDirectory);
                    }
                }
View Full Code Here

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

        String uploadName = null;
        try {
            client = borrowClient();
            // Change to the directory specified by the URI path if any
            if (uri != null && uri.getPath() != null) {
                client.changeWorkingDirectory(uri.getPath());
            }

            name = marshaler.getOutputName(exchange, message);
            if (name == null) {
                if (uniqueFileName != null) {
View Full Code Here

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

        os.close();
        client.completePendingCommand();

        if (dir != null)
        {
            if (!client.changeWorkingDirectory(dir))
            {
                throw new IllegalArgumentException("change dir to '" + dir + "' failed");
            }
        }
View Full Code Here

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

                // String root = getRoot().getName().getPath();

                Boolean userDirIsRoot = FtpFileSystemConfigBuilder.getInstance().getUserDirIsRoot(fileSystemOptions);
                if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue()))
                {
                    if (!client.changeWorkingDirectory(workingDirectory))
                    {
                        throw new FileSystemException("vfs.provider.ftp/change-work-directory.error", workingDirectory);
                    }
                }
View Full Code Here

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

            if (action == MK_DIR) {
                makeRemoteDir(ftp, remotedir);
            } else {
                if (remotedir != null) {
                    log("changing the remote directory", Project.MSG_VERBOSE);
                    ftp.changeWorkingDirectory(remotedir);
                    if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                        throw new BuildException("could not change remote "
                             + "directory: " + ftp.getReplyString());
                    }
                }
View Full Code Here

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

        isDirectory = cwdFtpTo(client, false);
        if (isDirectory == false) {
            client.disconnect();
            return isDirectory;
        } else {
            isDirectory = client.changeWorkingDirectory(normalizedTo.split("/")[normalizedTo.split("/").length - 1]);
            client.disconnect();
            return isDirectory;
        }
    }
View Full Code Here

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

        os.close();
        client.completePendingCommand();

        if (dir != null)
        {
            if (!client.changeWorkingDirectory(dir))
            {
                throw new IllegalArgumentException("change dir to '" + dir + "' failed");
            }
        }
View Full Code Here

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

                // String root = getRoot().getName().getPath();

                Boolean userDirIsRoot = FtpFileSystemConfigBuilder.getInstance().getUserDirIsRoot(fileSystemOptions);
                if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue()))
                {
                    if (!client.changeWorkingDirectory(workingDirectory))
                    {
                        throw new FileSystemException("vfs.provider.ftp/change-work-directory.error", workingDirectory);
                    }
                }
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.