|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SftpSession
Features.SESSION_SFTP
Method Summary | |
---|---|
void |
cd(java.lang.String dir)
Changes the working directory on the remote server. |
void |
chgrp(int gid,
java.lang.String path)
Sets the group ID for the file or directory. |
void |
chmod(int permissions,
java.lang.String path)
Changes the access permissions or modes of the specified file or directory. |
void |
chown(int uid,
java.lang.String path)
Sets the user ID to owner for the file or directory. |
void |
get(java.lang.String path)
Download the remote file to the local computer. |
void |
get(java.lang.String remote,
java.io.OutputStream local)
Download the remote file writing it to the specified OutputStream . |
void |
get(java.lang.String remote,
java.lang.String local)
Download the remote file to the local computer. |
java.lang.String |
getAbsolutePath(java.lang.String path)
|
void |
lcd(java.lang.String path)
Changes the local working directory. |
java.lang.String |
lpwd()
Returns the absolute path to the local working directory. |
java.util.List |
ls()
List the contents of the current remote working directory. |
java.util.List |
ls(java.lang.String path)
List the contents remote directory. |
void |
mkdir(java.lang.String dir)
Creates a new directory on the remote server. |
void |
put(java.io.InputStream in,
java.lang.String remote)
|
void |
put(java.lang.String local)
Upload a file to the remote computer. |
void |
put(java.lang.String local,
java.lang.String remote)
Upload a file to the remote computer. |
java.lang.String |
pwd()
Returns the absolute path name of the current remote working directory. |
void |
rename(java.lang.String oldpath,
java.lang.String newpath)
Rename a file on the remote computer. |
void |
rm(java.lang.String path)
Remove a file or directory from the remote computer. |
SftpFileAttributes |
stat(java.lang.String path)
Returns the attributes of the file from the remote computer. |
void |
symlink(java.lang.String path,
java.lang.String link)
Create a symbolic link on the remote computer. |
void |
umask(int umask)
Sets the defaultPermissions used by this client. |
Methods inherited from interface net.sf.commons.ssh.Session |
---|
close, isClosed |
Method Detail |
---|
void cd(java.lang.String dir) throws java.io.IOException
dir
- the new working directory
java.io.IOException
- if an IO error occurs or the file does not exist
java.io.FileNotFoundException
void chgrp(int gid, java.lang.String path) throws java.io.IOException
gid
- the numeric group id for the new grouppath
- the path to the remote file/directory
java.io.IOException
- if an IO error occurs or the file does not existvoid chmod(int permissions, java.lang.String path) throws java.io.IOException
Absolute modes are octal numbers specifying the complete list of attributes for the files; you specify attributes by OR'ing together these bits. 0400 Individual read 0200 Individual write 0100 Individual execute (or list directory) 0040 Group read 0020 Group write 0010 Group execute 0004 Other read 0002 Other write 0001 Other execute
permissions
- the absolute mode of the file/directorypath
- the path to the file/directory on the remote server
java.io.IOException
- if an IO error occurs or the file if not foundvoid chown(int uid, java.lang.String path) throws java.io.IOException
uid
- numeric user id of the new ownerpath
- the path to the remote file/directory
java.io.IOException
- if an IO error occurs or the file does not existvoid get(java.lang.String path) throws java.io.IOException
path
- the path to the remote file
java.io.IOException
- if an IO error occurs of the file does not existvoid get(java.lang.String remote, java.io.OutputStream local) throws java.io.IOException
OutputStream
. The OutputStream is closed by this method even
if the operation fails.
remote
- the path/name of the remote filelocal
- the OutputStream to write
java.io.IOException
- if an IO error occurs or the file does not existvoid get(java.lang.String remote, java.lang.String local) throws java.io.IOException
remote
- the path/name of the remote filelocal
- the path/name of the local file
java.io.IOException
java.lang.String getAbsolutePath(java.lang.String path) throws java.io.IOException
path
-
java.io.IOException
void lcd(java.lang.String path) throws java.io.IOException
path
- the path to the new working directory
java.io.IOException
- if an IO error occursjava.lang.String lpwd()
java.util.List ls() throws java.io.IOException
java.io.IOException
- if an IO error occursSftpFile
java.util.List ls(java.lang.String path) throws java.io.IOException
path
- the path on the remote server to list
java.io.IOException
- if an IO error occursSftpFile
void mkdir(java.lang.String dir) throws java.io.IOException
mkdirs
method.
dir
- the name of the new directory
java.io.IOException
- if an IO error occurs or if the directory already existsvoid put(java.io.InputStream in, java.lang.String remote) throws java.io.IOException
in
- remote
-
java.io.IOException
void put(java.lang.String local) throws java.io.IOException
local
- the path/name of the local file
java.io.IOException
- if an IO error occurs or the file does not existvoid put(java.lang.String local, java.lang.String remote) throws java.io.IOException
local
- the path/name of the local fileremote
- the path/name of the destination file
java.io.IOException
- if an IO error occurs or the file does not existjava.lang.String pwd() throws java.io.IOException
java.io.IOException
void rename(java.lang.String oldpath, java.lang.String newpath) throws java.io.IOException
oldpath
- the old pathnewpath
- the new path
java.io.IOException
- if an IO error occursvoid rm(java.lang.String path) throws java.io.IOException
path
- the path of the remote file/directory
java.io.IOException
- if an IO error occursSftpFileAttributes stat(java.lang.String path) throws java.io.IOException
path
- the path of the file on the remote computer
java.io.IOException
- if an IO error occurs or the file does not existSftpFileAttributes
void symlink(java.lang.String path, java.lang.String link) throws java.io.IOException
path
- the path to the existing filelink
- the new link
java.io.IOException
- if an IO error occurs or the operation is not supported on
the remote platformvoid umask(int umask)
umask
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |