Package org.eclipse.jgit.transport.sshd
Class SshdSession.SshdFtpChannel
java.lang.Object
org.eclipse.jgit.transport.sshd.SshdSession.SshdFtpChannel
- All Implemented Interfaces:
FtpChannel
- Enclosing class:
- SshdSession
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jgit.transport.FtpChannel
FtpChannel.DirEntry, FtpChannel.FtpException
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
void
Changes the current remote directory.void
Connects theFtpChannel
to the remote end.void
Disconnects andFtpChannel
.Obtain anInputStream
to read the contents of a remote file.boolean
Lists contents of a remote directoryprivate <T> T
void
Creates a directory on the remote file system.Obtain anOutputStream
to write to a remote file.pwd()
void
Renames a file on the remote file system.void
Deletes a file on the remote file system.void
Deletes a directory on the remote file system.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jgit.transport.FtpChannel
delete
-
Field Details
-
ftp
private org.apache.sshd.sftp.client.SftpClient ftp -
cwd
Current working directory.
-
-
Constructor Details
-
SshdFtpChannel
private SshdFtpChannel()
-
-
Method Details
-
connect
Description copied from interface:FtpChannel
Connects theFtpChannel
to the remote end.- Specified by:
connect
in interfaceFtpChannel
- Parameters:
timeout
- for establishing the FTP connectionunit
- of thetimeout
- Throws:
IOException
-
disconnect
public void disconnect()Description copied from interface:FtpChannel
Disconnects andFtpChannel
.- Specified by:
disconnect
in interfaceFtpChannel
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfaceFtpChannel
- Returns:
- whether the
FtpChannel
is connected
-
absolute
-
map
- Throws:
IOException
-
cd
Description copied from interface:FtpChannel
Changes the current remote directory.- Specified by:
cd
in interfaceFtpChannel
- Parameters:
path
- target directory- Throws:
IOException
- if the operation could not be performed remotely
-
pwd
- Specified by:
pwd
in interfaceFtpChannel
- Returns:
- the current remote directory path
- Throws:
IOException
-
ls
Description copied from interface:FtpChannel
Lists contents of a remote directory- Specified by:
ls
in interfaceFtpChannel
- Parameters:
path
- of the directory to list- Returns:
- the directory entries
- Throws:
IOException
-
rmdir
Description copied from interface:FtpChannel
Deletes a directory on the remote file system. The directory must be empty.- Specified by:
rmdir
in interfaceFtpChannel
- Parameters:
path
- to delete- Throws:
IOException
-
mkdir
Description copied from interface:FtpChannel
Creates a directory on the remote file system.- Specified by:
mkdir
in interfaceFtpChannel
- Parameters:
path
- to create- Throws:
IOException
-
get
Description copied from interface:FtpChannel
Obtain anInputStream
to read the contents of a remote file.- Specified by:
get
in interfaceFtpChannel
- Parameters:
path
- of the file to read- Returns:
- the stream to read from
- Throws:
IOException
-
put
Description copied from interface:FtpChannel
Obtain anOutputStream
to write to a remote file. If the file exists already, it will be overwritten.- Specified by:
put
in interfaceFtpChannel
- Parameters:
path
- of the file to read- Returns:
- the stream to read from
- Throws:
IOException
-
rm
Description copied from interface:FtpChannel
Deletes a file on the remote file system.- Specified by:
rm
in interfaceFtpChannel
- Parameters:
path
- to delete- Throws:
IOException
- if the file does not exist or could otherwise not be deleted
-
rename
Description copied from interface:FtpChannel
Renames a file on the remote file system. Ifto
exists, it is replaced byfrom
. (POSIX rename() semantics)- Specified by:
rename
in interfaceFtpChannel
- Parameters:
from
- original name of the fileto
- new name of the file- Throws:
IOException
- See Also:
-