Class FtpAdapter
java.lang.Object
net.jalbum.remotefs.ftp4j.FtpAdapter
-
Field Summary
Fields -
Constructor Summary
Constructors -
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()Get remote files.Get remote files.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 passive) Set access mode to passivevoidsetPort(int port) Set port to use to access remote filesystemvoidsetProgressMonitorvoidGo to parent directory of current remote directory
-
Field Details
-
DEFAULT_ENCODING
- See Also:
-
-
Constructor Details
-
FtpAdapter
public FtpAdapter()
-
-
Method Details
-
setPort
-
getPort
-
setForceUTF8
public void setForceUTF8(boolean force) Description copied from interface:RemoteFSForce using UTF8 to remote filesystem- Specified by:
setForceUTF8in interfaceRemoteFS- Parameters:
force- Use UTF8 if true- See Also:
-
isForceUTF8
public boolean isForceUTF8()Description copied from interface:RemoteFSReturn whether UTF8 is forced- Specified by:
isForceUTF8in interfaceRemoteFS- Returns:
- true if UTF8 forced
- See Also:
-
setPassiveMode
public void setPassiveMode(boolean passive) Description copied from interface:RemoteFSSet access mode to passive- Specified by:
setPassiveModein interfaceRemoteFS- Parameters:
passive- Use passive mode if true- See Also:
-
isPassiveMode
public boolean isPassiveMode()Description copied from interface:RemoteFSReturn if passive mode is used- Specified by:
isPassiveModein interfaceRemoteFS- Returns:
- true if passive mode
- See Also:
-
getDirectory
Description copied from interface:RemoteFSGet current remote directory- Specified by:
getDirectoryin interfaceRemoteFS- Returns:
- Current remote directory
- Throws:
RemoteFSExceptionIOException- See Also:
-
rename
- Specified by:
renamein interfaceRemoteFS- Throws:
RemoteFSExceptionIOException- See Also:
-
setDirectory
Description copied from interface:RemoteFSSet remote directory- Specified by:
setDirectoryin interfaceRemoteFS- Parameters:
directory- Change remote directory to this directory- Throws:
RemoteFSExceptionIOException- See Also:
-
toParentDirectory
Description copied from interface:RemoteFSGo to parent directory of current remote directory- Specified by:
toParentDirectoryin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException- See Also:
-
createDirectory
Description copied from interface:RemoteFSCreate directory on remote filesystem- Specified by:
createDirectoryin interfaceRemoteFS- Parameters:
name- Create directory with this name- Throws:
IOExceptionRemoteFSException- See Also:
-
removeDirectory
Description copied from interface:RemoteFSRemove directory from remote filesystem- Specified by:
removeDirectoryin interfaceRemoteFS- Parameters:
name- Remove directory with this name- Throws:
IOExceptionRemoteFSException- See Also:
-
connect
public void connect(String server, String user, String password) throws IOException, RemoteFSException Description copied from interface:RemoteFSConnect to remote server using user and password- Specified by:
connectin interfaceRemoteFS- Parameters:
server- server to connect touser- user to use for authenticationpassword- password for authenticating user- Throws:
IOExceptionRemoteFSException- See Also:
-
disconnect
Description copied from interface:RemoteFSDisconnect from remote server- Specified by:
disconnectin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException- See Also:
-
isConnected
public boolean isConnected()Description copied from interface:RemoteFSCheck if connected to remote system- Specified by:
isConnectedin interfaceRemoteFS- Returns:
- true if connected to remote system
- See Also:
-
getFiles
Get remote files. Result is converted to an array of RemoteFile's- Specified by:
getFilesin interfaceRemoteFS- Returns:
- Array of RemoteFiles
- Throws:
IOExceptionRemoteFSException- See Also:
-
getFiles
Get remote files. Result is converted to an array of RemoteFile's- Specified by:
getFilesin interfaceRemoteFS- Returns:
- Array of RemoteFiles
- Throws:
IOExceptionRemoteFSException- See Also:
-
putFile
Description copied from interface:RemoteFSPut file to remote system- Specified by:
putFilein interfaceRemoteFS- Parameters:
file- File to copy to remote system- Throws:
IOExceptionRemoteFSException- See Also:
-
putFile
- Specified by:
putFilein interfaceRemoteFS- Throws:
IOExceptionRemoteFSException- See Also:
-
put
- Specified by:
putin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException
-
get
- Specified by:
getin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException
-
removeFile
Description copied from interface:RemoteFSRemove file from remote system- Specified by:
removeFilein interfaceRemoteFS- Parameters:
filename- File te remove from remote system- Throws:
RemoteFSExceptionIOException- See Also:
-
setProgressMonitor
setProgressMonitor- Specified by:
setProgressMonitorin interfaceRemoteFS- Parameters:
monitor- RemoteFSProgressMonitor
-
abortConnect
Description copied from interface:RemoteFSAbort a connection attempt- Specified by:
abortConnectin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException
-
exists
Description copied from interface:RemoteFSCheck the existence of a file- Specified by:
existsin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException
-
existsDirectory
Description copied from interface:RemoteFSCheck the existence of a directory (the ftp protocol can't determine existence of both files and directories in one call)- Specified by:
existsDirectoryin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException
-
getUnmonitored
Description copied from interface:RemoteFSAllows us to get :filetree on CrushFTP (avoids stat call)- Specified by:
getUnmonitoredin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException
-
noop
- Specified by:
noopin interfaceRemoteFS- Throws:
IOExceptionRemoteFSException
-