|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface RemoteFileService
RemoteFileService is an interface that is used to help you access files on a remote machine.
| Method Summary | |
|---|---|
void |
copy(java.lang.String remoteSrcPath,
java.lang.String remoteDstPath)
Copies the remote file denoted by remoteSrcPath to remoteDstPath. |
void |
copyFromRemote(java.lang.String remoteFilename,
java.lang.String localFilename)
Copies the remote file denoted by string remoteFilename to the local machine, including subfolders. |
void |
copyFromRemote(java.lang.String remoteFilename,
java.lang.String localFilename,
boolean withSubFolder)
Copies the remote file denoted by string remoteFilename to the local machine. |
void |
copyToRemote(java.lang.String localFilename,
java.lang.String remoteFilename)
Copies the local file denoted by string localFilename to the remote machine, including subfolders. |
void |
copyToRemote(java.lang.String localFilename,
java.lang.String remoteFilename,
boolean withSubFolder)
Copies the local file denoted by string localFilename to the remote machine. |
boolean |
delete(java.lang.String remoteFilename)
Deletes the file or directory denoted by this string remoteFilename. |
boolean |
exists(java.lang.String remoteFilename)
Tests whether a specified file or folder denoted by String remoteFilename exists on the remote machine. |
java.lang.String |
getName(java.lang.String remoteFilename)
Returns the name of the file or directory denoted by this path name. |
java.lang.String |
getParent(java.lang.String remoteFilename)
Returns the path name string of this path name's parent, or null if this path name does not name a parent directory. |
java.lang.String |
getRemoteFileSeparator()
Returns the system-dependent path-separator character, represented as a string for convenience. |
java.lang.String |
getRemoteHomePath()
Gets the home path of the remote server. |
boolean |
isDirectory(java.lang.String remoteFilename)
Tests whether the file denoted by this abstract path name is a directory. |
long |
lastModified(java.lang.String remoteFilename)
Returns the time when the file denoted by this abstract pathname was last modified. |
long |
length(java.lang.String remoteFilename)
Returns the length of the file denoted by this abstract path name. |
java.lang.String[] |
list(java.lang.String remoteDirName,
java.lang.String filter)
Returns an array of strings naming the files and directories in the directory denoted by this string remoteDirName. |
boolean |
mkdirs(java.lang.String remotePath)
Creates the directory named by this absolute path, including any necessary but nonexistent parent directories on the remote machine. |
java.io.InputStream |
readFile(java.lang.String remoteFilename)
Creates an InputStream by opening a connection to a remote file denoted by remoteFilename. |
void |
writeFile(java.io.InputStream in,
java.lang.String remoteFilename)
Writes to a specified remote file with this InputStream. |
| Method Detail |
|---|
java.io.InputStream readFile(java.lang.String remoteFilename)
throws java.io.IOException
FileNotFoundException is thrown.
remoteFilename - the remote file name.
java.io.IOException - if an I/O error occurs.
void writeFile(java.io.InputStream in,
java.lang.String remoteFilename)
throws java.io.IOException
FileNotFoundException is thrown.
InputStream - the input file stream.remoteFilename - the remote file name.
java.io.IOException - if an I/O error occurs.
void copyToRemote(java.lang.String localFilename,
java.lang.String remoteFilename)
throws java.io.IOException
copyToRemote("d:\\temp\\local\\*" , "d:\\temp\\remote\\"),
or copyToRemote("d:\\temp\\local\\??.txt" , "d:\\temp\\remote\\").
localFilename - the absolute local file name. You can use wildcards in this parameter.remoteFilename - the absolute remote file name.
java.io.IOException - if an I/O error occurs .
void copyToRemote(java.lang.String localFilename,
java.lang.String remoteFilename,
boolean withSubFolder)
throws java.io.IOException
copyToRemote("d:\\temp\\local\\*" , "d:\\temp\\remote\\"),
or copyToRemote("d:\\temp\\local\\??.txt" , "d:\\temp\\remote\\").
localFilename - the absolute local file name. You can use wildcards in this parameter,remoteFilename - the absolute remote file name.withSubFolder - whether to include subfolders when copying.
java.io.IOException - if an I/O error occurs.
void copyFromRemote(java.lang.String remoteFilename,
java.lang.String localFilename)
throws java.io.IOException
copyFromRemote("d:\\temp\\remote\\*" , "d:\\temp\\local\\"), or copyFromRemote("d:\\temp\\remote\\??.txt" , "d:\\temp\\local\\").
remoteFilename - the absolute remote file name. You can use wildcards in this parameter.localFilename - the absolute local file name.
java.io.IOException - if an I/O error occurs.
void copyFromRemote(java.lang.String remoteFilename,
java.lang.String localFilename,
boolean withSubFolder)
throws java.io.IOException
copyFromRemote("d:\\temp\\remote\\*" , "d:\\temp\\local\\"), or copyFromRemote("d:\\temp\\remote\\??.txt" , "d:\\temp\\local\\").
- Parameters:
remoteFilename - the absolute remote file name. You can use wildcards in this parameter.localFilename - the absolute local file name.withSubFolder - whether to include subfolders when copying.
- Throws:
java.io.IOException - if an I/O error occurs.
boolean delete(java.lang.String remoteFilename)
throws java.rmi.RemoteException
remoteFilename. -
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
java.lang.String getRemoteHomePath()
throws java.rmi.RemoteException
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
boolean exists(java.lang.String remoteFilename)
throws java.rmi.RemoteException
remoteFilename - the remote file name or remote folder name.
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
java.lang.String[] list(java.lang.String remoteDirName,
java.lang.String filter)
throws java.io.IOException
remoteDirName - the remote directory namefilter - the filter, using '*' for all chars,'?' for single char. It also supports multiple wildcards like "*.com;??.exe".
IOException.
java.io.IOException
boolean isDirectory(java.lang.String remoteFilename)
throws java.rmi.RemoteException
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
long lastModified(java.lang.String remoteFilename)
throws java.rmi.RemoteException
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
long length(java.lang.String remoteFilename)
throws java.rmi.RemoteException
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
java.lang.String getName(java.lang.String remoteFilename)
throws java.rmi.RemoteException
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
java.lang.String getParent(java.lang.String remoteFilename)
throws java.rmi.RemoteException
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
java.lang.String getRemoteFileSeparator()
throws java.rmi.RemoteException
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
void copy(java.lang.String remoteSrcPath,
java.lang.String remoteDstPath)
throws java.rmi.RemoteException,
java.io.IOException
remoteSrcPath - the absolute remote path name on the resource tree.remoteDstPath - the absolute remote path name in the disk
java.rmi.RemoteException - if communication-related .error occurs during RMI call execution.
java.io.IOException - if an I/O error occurs.
boolean mkdirs(java.lang.String remotePath)
throws java.io.IOException,
java.rmi.RemoteException
remotePath - the remote path
true if and only if the directory was created, along with all necessary parent directories; false otherwise
java.io.IOException - make dirs failed
java.rmi.RemoteException - if communication-related error occurs during RMI call execution.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||