|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SFTPClient
jim.fu@sun.com in sync with dev version TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
Method Summary | |
---|---|
void |
cd(java.lang.String dir)
change remote directory to dir |
void |
chgrp(java.lang.String gid,
java.lang.String path)
change the group of the file or directory specified by path
to the group specified as gid ; |
void |
chmod(int permissions,
java.lang.String path)
change the mode of the file or directory specified path
to the mode as specified permissions ;
Changes the access permissions or modes of the specified file or directory. |
void |
chown(java.lang.String uid,
java.lang.String path)
change owner of the file or directory specified path
to the user as specified uid ; |
void |
connect()
connect to the remote SSH server; |
void |
delete()
delete a remote file specified by configuration parameters RemoteDirectory and RemoteFile |
void |
delete(java.lang.String file)
delete a remote file specified by file |
void |
disconnect()
disconnect the client from the remote SSH server; |
void |
get()
get data from remote SSH server (specified by configuration parameters RemoteDirectory and RemoteFile ) to the local
machine through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the remote data
could be stored into the payload (in memory buffer) or a local file
specified by configuration parameters LocalDirectory
and LocalFile ; |
void |
GET()
get data from remote SSH server (specified by configuration parameters RemoteDirectory and RemoteFile ) to the local
machine through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the remote data
could be stored into the payload (in memory buffer) or a local file
specified by configuration parameters LocalDirectory
and LocalFile ;
if there are pre and post operations configured, they will be applied
before and after the get operation respectively; |
DirectoryEntry |
getEntry(int index)
get the index(th) entry in the current entry list Note, current entry list is populated by calling listDir() or listDirLong() ; |
int |
getEntryCount()
return the number of entries in the current entry list; |
java.lang.String |
getLocalDirNameStub()
return the current name stub for local directory - when local directory name is a pattern this stub is used to substitute %f in a name pattern; |
java.lang.String |
getLocalFileNameStub()
return the current name stub for local file - when local file name is a pattern this stub is used to substitute %f in a name pattern; |
byte[] |
getPayload()
return the payload buffer - byte array; |
java.lang.String |
getRemoteDirNameStub()
return the current name stub for remote directory - when remote directory name is a pattern this stub is used to substitute %f in a name pattern; |
java.lang.String |
getRemoteFileNameStub()
return the current name stub for remote file - when remote file name is a pattern this stub is used to substitute %f in a name pattern; |
java.lang.String |
getResolvedLocalDirectory()
Return the resolved local directory name; |
java.lang.String |
getResolvedLocalFile()
Return the current resolved local file name; |
java.lang.String |
getResolvedRemoteDirectory()
Return the current resolved remote directory name; |
java.lang.String |
getResolvedRemoteFile()
Return the current resolved remote file name; |
boolean |
hasEntry()
test if current entry list has entries; |
boolean |
isConnected()
test if the client is connected to a remote SSH server; |
void |
lcd(java.lang.String dir)
change local directory to dir |
void |
listDir()
list all the entries under remote current directory and the result is cached on client side for navigation using methods hasEntry , nextEntry() ,
resetEntries() , getEntry(i) ,
getEntryCount() |
java.lang.String |
lpwd()
return the local working directory as a path; |
void |
mkdir()
create a remote directory as specified by configuration parameter RemoteDirectory ; |
void |
mkdir(java.lang.String dir)
create a remote directory as specified by dir |
void |
mkdirs(java.lang.String dir)
create a remote directory as specified by dir |
DirectoryEntry |
nextEntry()
return the next entry in the current entry list; |
void |
put()
put data from local (specified by configuration parameters LocalDirectory
and LocalFile ) to the remote SSH server file specified by
specified by configuration parameters
RemoteDirectory and RemoteFile
through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the local data
could be from payload or a local file; |
void |
PUT()
put data from local (specified by configuration parameters LocalDirectory
and LocalFile ) to the remote SSH server file specified by
specified by configuration parameters
RemoteDirectory and RemoteFile
through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the local data
could be from payload or a local file;
if there are pre and post operations configured, they will be applied
before and after the put operation respectively; |
java.lang.String |
pwd()
return the current working directory of remote SSH server as a path; |
void |
rename(java.lang.String newPath)
rename a remote path specified by configuration parameters RemoteDirectory and RemoteFile
to a new remote path newPath ; |
void |
rename(java.lang.String oldPath,
java.lang.String newPath)
rename a remote path oldPath to a new remote path
newPath ; |
boolean |
reset()
internal life cycle methods reset the sftp client such as discard payload buffer |
void |
resetEntries()
reset the current entry list so that next call to nextEntry() will return the first entry
in the list; |
void |
resolveLocalAsDestination()
Resolve the local directory name and local file name if they are patterns (used to generate real directory and file name for data transfer destination), upon the success of the resolution, the current local directory name and/or local file name are real names that can be used for data transfer operations; before introduce a user configurable root name for replacing %f - use a fixed one REMOTE_DEST_DIR_STUB, REMOTE_DEST_FILE_STUB, LOCAL_DEST_DIR_STUB, LOCAL_DEST_FILE_STUB if the local dir or file is a pattern, then treat it as a name pattern (not regex - SeeBeyond propriatory patterns) such as %f, %M, %# etc. |
void |
resolveLocalAsSource()
Resolve the local directory and file if they are regex (filters for data transfer source); upon the success of the resolution, the current local directory name and/or local file name are real names that can be used for data transfer operations; if the local dir or file is pattern, then treat them as regex (used to match existing entries from source), otherwise, use as literal; |
void |
resolveRemoteAsDestination()
Resolve the remote directory name and remote file name if they are patterns (used to generate real directory and file name for data transfer destination), upon the success of the resolution, the current remote directory name and/or remote file name are real names that can be used for data transfer operations; before introduce a user configurable root name for replacing %f - use a fixed one REMOTE_DEST_DIR_STUB, REMOTE_DEST_FILE_STUB, LOCAL_DEST_DIR_STUB, LOCAL_DEST_FILE_STUB if the remote dir or file is a pattern, then treat it as a name pattern (not regex - SeeBeyond propriatory patterns) such as %f, %M, %# etc. |
void |
resolveRemoteAsSource()
Resolve the remote directory and file if they are regex (filters for data transfer source); upon the success of the resolution, the current remote directory name and/or remote file name are real names that can be used for data transfer operations; if the remote dir or file is pattern, then treat them as regex (used to match existing entries from source), otherwise, use as literal; |
void |
setLocalDirNameStub(java.lang.String s)
set the current name stub for local directory - when local directory name is a pattern this stub is used to substitute %f in a name pattern; |
void |
setLocalFileNameStub(java.lang.String s)
set the current name stub for local file - when local file name is a pattern this stub is used to substitute %f in a name pattern; |
void |
setPayload(byte[] newPayload)
set the payload buffer with newPayload |
void |
setRemoteDirNameStub(java.lang.String s)
set the current name stub for remote directory - when remote directory name is a pattern this stub is used to substitute %f in a name pattern; |
void |
setRemoteFileNameStub(java.lang.String s)
set the current name stub for remote file - when remote file name is a pattern this stub is used to substitute %f in a name pattern; |
void |
setResolvedLocalDirectory(java.lang.String s)
Set the current resolved local directory name, should not be invoked directly from user collaboration; |
void |
setResolvedLocalFile(java.lang.String s)
Set the current local file name to s , should not be invoked directly from user collaboration; |
void |
setResolvedRemoteDirectory(java.lang.String s)
Set the current resolved remote directory name, should not be invoked directly from user collaboration; |
void |
setResolvedRemoteFile(java.lang.String s)
Set the current resolved remote file name, should not be invoked directly from user collaboration;; |
SFTPFileAttributes |
stat(java.lang.String path)
query the state information of the entity specified by path |
void |
terminate()
internal life cycle method; |
void |
umask(int umask)
|
void |
umask(java.lang.String umask)
Sets the umask for this client. |
Methods inherited from interface com.stc.connector.batchadapter.directory.DirectoryProvider |
---|
currentDir, listDir |
Method Detail |
---|
boolean reset() throws SFTPException
SFTPException
void terminate() throws SFTPException
SFTPException
byte[] getPayload()
void setPayload(byte[] newPayload)
newPayload
newPayload
- void connect() throws SFTPException
SFTPException
void disconnect() throws SFTPException
SFTPException
boolean isConnected() throws SFTPException
SFTPException
void put() throws SFTPException
LocalDirectory
and LocalFile
) to the remote SSH server file specified by
specified by configuration parameters
RemoteDirectory
and RemoteFile
through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the local data
could be from payload or a local file;
SFTPException
void PUT() throws SFTPException
LocalDirectory
and LocalFile
) to the remote SSH server file specified by
specified by configuration parameters
RemoteDirectory
and RemoteFile
through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the local data
could be from payload or a local file;
if there are pre and post operations configured, they will be applied
before and after the put operation respectively;
SFTPException
void get() throws SFTPException
RemoteDirectory
and RemoteFile
) to the local
machine through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the remote data
could be stored into the payload (in memory buffer) or a local file
specified by configuration parameters LocalDirectory
and LocalFile
;
SFTPException
void GET() throws SFTPException
RemoteDirectory
and RemoteFile
) to the local
machine through sftp;
Note, the remote SSH server must have sftp sub system enabled;
depends on the current status of the configuration, the remote data
could be stored into the payload (in memory buffer) or a local file
specified by configuration parameters LocalDirectory
and LocalFile
;
if there are pre and post operations configured, they will be applied
before and after the get operation respectively;
SFTPException
void listDir() throws SFTPException
hasEntry
, nextEntry()
,
resetEntries()
, getEntry(i)
,
getEntryCount()
SFTPException
void cd(java.lang.String dir) throws SFTPException
dir
dir
-
SFTPException
void lcd(java.lang.String dir) throws SFTPException
dir
dir
-
SFTPException
java.lang.String pwd() throws SFTPException
SFTPException
java.lang.String lpwd() throws SFTPException
SFTPException
void chgrp(java.lang.String gid, java.lang.String path) throws SFTPException
path
to the group specified as gid
;
gid
- - numeric group id for the new grouppath
- - the path to the remote file/directory
SFTPException
- - any error occurredvoid chown(java.lang.String uid, java.lang.String path) throws SFTPException
path
to the user as specified uid
;
uid
- - numeric user id of the new ownerpath
- - the path to the remote file/directory
SFTPException
- - any error occurredvoid chmod(int permissions, java.lang.String path) throws SFTPException
path
to the mode as specified permissions
;
Changes the access permissions or modes of the specified file or directory.
Modes determine who can read, change or execute a file.
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/directory (an octal value)path
- - the path to the remote file/directory
SFTPException
- - any error occurredvoid umask(java.lang.String umask) throws SFTPException
umask
- - three digit umask in octal
SFTPException
- - any error occurredvoid umask(int umask) throws SFTPException
SFTPException
SFTPFileAttributes stat(java.lang.String path) throws SFTPException
path
path
- - path pointing to the directory or file entity whose state information will be returned;
path
SFTPException
- - any error occurredvoid mkdir() throws SFTPException
RemoteDirectory
;
SFTPException
void mkdir(java.lang.String dir) throws SFTPException
dir
dir
-
SFTPException
void mkdirs(java.lang.String dir) throws SFTPException
dir
dir
- - a path to be created
SFTPException
void delete(java.lang.String file) throws SFTPException
file
file
- - the path to the file to be deleted;
SFTPException
void delete() throws SFTPException
RemoteDirectory
and RemoteFile
SFTPException
void rename(java.lang.String oldPath, java.lang.String newPath) throws SFTPException
oldPath
to a new remote path
newPath
;
oldPath
- - existing path on remote SSH server;newPath
- - new name to be renamed to;
SFTPException
void rename(java.lang.String newPath) throws SFTPException
RemoteDirectory
and RemoteFile
to a new remote path newPath
;
newPath
- - new name to be renamed to;
SFTPException
java.lang.String getResolvedRemoteDirectory()
void setResolvedRemoteDirectory(java.lang.String s)
s
- - the remote directory path;java.lang.String getResolvedRemoteFile()
void setResolvedRemoteFile(java.lang.String s)
s
- - the file name;java.lang.String getResolvedLocalDirectory()
void setResolvedLocalDirectory(java.lang.String s)
s
- java.lang.String getResolvedLocalFile()
void setResolvedLocalFile(java.lang.String s)
s
, should not be invoked directly from user collaboration;
s
- - the file name to be set;void resolveRemoteAsSource() throws SFTPException
SFTPException
void resolveLocalAsSource() throws SFTPException
SFTPException
void resolveRemoteAsDestination() throws SFTPException
SFTPException
void resolveLocalAsDestination() throws SFTPException
SFTPException
DirectoryEntry getEntry(int index) throws SFTPException
listDir()
or listDirLong()
;
index
-
SFTPException
DirectoryEntry nextEntry() throws SFTPException
SFTPException
boolean hasEntry()
int getEntryCount()
void resetEntries()
nextEntry()
will return the first entry
in the list;
java.lang.String getLocalFileNameStub()
void setLocalFileNameStub(java.lang.String s)
java.lang.String getLocalDirNameStub()
void setLocalDirNameStub(java.lang.String s)
java.lang.String getRemoteFileNameStub()
void setRemoteFileNameStub(java.lang.String s)
java.lang.String getRemoteDirNameStub()
void setRemoteDirNameStub(java.lang.String s)
|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |