Interface RemoteFS
- All Known Subinterfaces:
RemoteFSDelegate
- All Known Implementing Classes:
CommonsFtpAdapter,CommonsFtpsAdapter,Ftp4jAdapter,FtpAdapter,RemoteFSBean,SftpAdapter
public interface RemoteFS
Interface defines methods to access a remote filesystem.
Implementations of this interface can use different methods like ftp, sftp, nfs, scp to access the filesystem on a remote system.
The system using the RemoteFS subsystem is responsible for connecting and disconnecting before and after performing one of the actions.
Implementations of this interface can use different methods like ftp, sftp, nfs, scp to access the filesystem on a remote system.
The system using the RemoteFS subsystem is responsible for connecting and disconnecting before and after performing one of the actions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAbort a connection attemptvoidConnect to remote server using user and passwordvoidcreateDirectory(String name) Create directory on remote filesystemvoidDisconnect from remote serverbooleanCheck the existence of a filebooleanexistsDirectory(String path) Check the existence of a directory (the ftp protocol can't determine existence of both files and directories in one call)voidget(String path, OutputStream out) Get current remote directorygetFiles()Return all files in current remote directory.Return all files in spefified remote directory.intgetPort()Return port numbervoidgetUnmonitored(String path, OutputStream out) Allows us to get :filetree on CrushFTP (avoids stat call)booleanCheck if connected to remote systembooleanReturn whether UTF8 is forcedbooleanReturn if passive mode is usedvoidnoop()voidput(InputStream in, String path) voidPut file to remote systemvoidvoidremoveDirectory(String name) Remove directory from remote filesystemvoidremoveFile(String filename) Remove file from remote systemvoidvoidsetDirectory(String directory) Set remote directoryvoidsetForceUTF8(boolean force) Force using UTF8 to remote filesystemvoidsetPassiveMode(boolean mode) Set access mode to passivevoidsetPort(int port) Set port to use to access remote filesystemvoidGet reports on file currently being transferredvoidGo to parent directory of current remote directory
-
Method Details
-
setPort
Set port to use to access remote filesystem- Parameters:
port- port number to access remote filesystem- Throws:
RemoteFSException
-
getPort
Return port number- Returns:
- port number
- Throws:
RemoteFSException
-
setForceUTF8
Force using UTF8 to remote filesystem- Parameters:
force- Use UTF8 if true- Throws:
RemoteFSException
-
isForceUTF8
Return whether UTF8 is forced- Returns:
- true if UTF8 forced
- Throws:
RemoteFSException
-
setPassiveMode
Set access mode to passive- Parameters:
mode- Use passive mode if true- Throws:
RemoteFSException
-
isPassiveMode
Return if passive mode is used- Returns:
- true if passive mode
- Throws:
RemoteFSException
-
getDirectory
Get current remote directory- Returns:
- Current remote directory
- Throws:
RemoteFSExceptionIOException
-
setDirectory
Set remote directory- Parameters:
directory- Change remote directory to this directory- Throws:
RemoteFSExceptionIOException
-
toParentDirectory
Go to parent directory of current remote directory- Throws:
IOExceptionRemoteFSException
-
createDirectory
Create directory on remote filesystem- Parameters:
name- Create directory with this name- Throws:
IOExceptionRemoteFSException
-
removeDirectory
Remove directory from remote filesystem- Parameters:
name- Remove directory with this name- Throws:
IOExceptionRemoteFSException
-
connect
Connect to remote server using user and password- Parameters:
server- server to connect touser- user to use for authenticationpassword- password for authenticating user- Throws:
IOExceptionRemoteFSException
-
abortConnect
Abort a connection attempt- Throws:
RemoteFSExceptionIOException
-
disconnect
Disconnect from remote server- Throws:
IOExceptionRemoteFSException
-
isConnected
Check if connected to remote system- Returns:
- true if connected to remote system
- Throws:
RemoteFSException
-
getFiles
Return all files in current remote directory.- Returns:
- Array of RemoteFiles
- Throws:
IOExceptionRemoteFSException
-
getFiles
Return all files in spefified remote directory.- Returns:
- Array of RemoteFiles
- Throws:
IOExceptionRemoteFSException- deprecated unsafe with spaces in directories on ftp servers
-
noop
- Throws:
IOExceptionRemoteFSException
-
putFile
Put file to remote system- Parameters:
file- File to copy to remote system- Throws:
IOExceptionRemoteFSException
-
putFile
- Throws:
IOExceptionRemoteFSException
-
put
- Throws:
IOExceptionRemoteFSException- Since:
- 8.3
-
get
- Throws:
IOExceptionRemoteFSException- Since:
- 8.3
-
getUnmonitored
Allows us to get :filetree on CrushFTP (avoids stat call)- Throws:
IOExceptionRemoteFSException- Since:
- 8.13
-
removeFile
Remove file from remote system- Parameters:
filename- File te remove from remote system- Throws:
RemoteFSExceptionIOException
-
rename
- Throws:
RemoteFSExceptionIOException- See Also:
-
setProgressMonitor
Get reports on file currently being transferred -
exists
Check the existence of a file- Throws:
IOExceptionRemoteFSException
-
existsDirectory
Check the existence of a directory (the ftp protocol can't determine existence of both files and directories in one call)- Throws:
IOExceptionRemoteFSException
-