Package com.jcraft.jsch

Examples of com.jcraft.jsch.ChannelSftp.cd()


                    session.setConfig(config);
                    session.connect();
                    channel = session.openChannel("sftp");
                    channel.connect();
                    channelSftp = (ChannelSftp)channel;
                    channelSftp.cd(SFTPWORKINGDIR);
                    File ctl = new File(ctlfile.getPath());
                    channelSftp.put(new FileInputStream(ctl), ctl.getName());
                    File hdr = new File(condtlpath);
                    channelSftp.put(new FileInputStream(hdr), hdr.getName());
                    File dtl = new File(condtlpath);
View Full Code Here


        ChannelSftp channel = openSftpChannel();
        try {
            channel.connect();

            try {
                channel.cd(remotePath);
                for (Iterator i = directoryList.iterator(); i.hasNext();) {
                    Directory current = (Directory) i.next();
                    sendDirectory(channel, current);
                }
            } catch (SftpException e) {
View Full Code Here

                    } else {
                        throw new JSchException("failed to access remote dir '"
                                                + remotePath + "'", e);
                    }
                }
                channel.cd(remotePath);
            } catch (SftpException e) {
                throw new JSchException("Could not CD to '" + remotePath
                                        + "' - " + e.toString(), e);
            }
            Directory current = null;
View Full Code Here

            int directoryMode = getDirectoryMode( permissions );

            mkdirs( channel, basedir, directoryMode );

            channel.cd( basedir );

            mkdirs( channel, resourceName, directoryMode );

            firePutStarted( resource, source );
View Full Code Here

            firePutCompleted( resource, source );

            String[] dirs = PathUtils.dirnames( dir );
            for ( int i = 0; i < dirs.length; i++ )
            {
                channel.cd( ".." );
            }
        }
        catch ( SftpException e )
        {
            String msg = "Error occured while deploying '" + resourceName + "' " + "to remote repository: " +
View Full Code Here

                String[] dirs = PathUtils.dirnames( dir );

                for ( int i = 0; i < dirs.length; i++ )
                {
                    channel.cd( ".." );
                }

                bDownloaded = true;
            }
            else
View Full Code Here

                final String workingDirectory = getRootName().getPath();
                if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue()))
                {
                    try
                    {
                        channel.cd(workingDirectory);
                    }
                    catch (final SftpException e)
                    {
                        throw new FileSystemException("vfs.provider.sftp/change-work-directory.error",
                            workingDirectory, e);
View Full Code Here

            try
            {
                if (relPath != null)
                {
                    workingDirectory = channel.pwd();
                    channel.cd(relPath);
                }
            }
            catch (final SftpException ex)
            {
                // VFS-210: seems not to be a directory
View Full Code Here

            {
                try
                {
                    if (relPath != null)
                    {
                        channel.cd(workingDirectory);
                    }
                }
                catch (final SftpException xe)
                {
                    throw new FileSystemException("vfs.provider.sftp/change-work-directory-back.error",
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.