Package adams.core.io.fileoperations
Class AbstractRemoteFileOperations
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.io.fileoperations.AbstractFileOperations
-
- adams.core.io.fileoperations.AbstractRemoteFileOperations
-
- All Implemented Interfaces:
FileOperations
,RemoteFileOperations
,LoggingLevelHandler
,LoggingSupporter
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
FtpFileOperations
,SftpFileOperations
,SmbFileOperations
public abstract class AbstractRemoteFileOperations extends AbstractFileOperations implements RemoteFileOperations
Ancestor for remote file operation classes.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected RemoteDirection
m_Direction
the direction.protected LocalFileOperations
m_LocalOperations
for local file operations.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractRemoteFileOperations()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
delete(String file)
Deletes a file.protected String
deleteLocal(String file)
Deletes a local file.protected abstract String
deleteRemote(String file)
Deletes a remote file.RemoteDirection
getDirection()
Returns the direction of the operations.protected void
initialize()
Initializes the members.String
mkdir(String dir)
Creates the directory.protected String
mkdirLocal(String dir)
Creates the local directory.protected abstract String
mkdirRemote(String dir)
Creates the remote directory.String
rename(String source, String target)
Renames a file.protected String
renameLocal(String source, String target)
Renames a local file.protected abstract String
renameRemote(String source, String target)
Renames a remote file.void
setDirection(RemoteDirection value)
Sets the direction for the operations.-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface adams.core.io.fileoperations.FileOperations
copy, isSupported, move
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Direction
protected RemoteDirection m_Direction
the direction.
-
m_LocalOperations
protected LocalFileOperations m_LocalOperations
for local file operations.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractFileOperations
-
setDirection
public void setDirection(RemoteDirection value)
Sets the direction for the operations.- Specified by:
setDirection
in interfaceRemoteFileOperations
- Parameters:
value
- the direction
-
getDirection
public RemoteDirection getDirection()
Returns the direction of the operations.- Specified by:
getDirection
in interfaceRemoteFileOperations
- Returns:
- the direction
-
renameLocal
protected String renameLocal(String source, String target)
Renames a local file.- Parameters:
source
- the source file (old)target
- the target file (new)- Returns:
- null if successful, otherwise error message
-
renameRemote
protected abstract String renameRemote(String source, String target)
Renames a remote file.- Parameters:
source
- the source file (old)target
- the target file (new)- Returns:
- null if successful, otherwise error message
-
rename
public String rename(String source, String target)
Renames a file.- Specified by:
rename
in interfaceFileOperations
- Parameters:
source
- the source file (old)target
- the target file (new)- Returns:
- null if successful, otherwise error message
-
deleteLocal
protected String deleteLocal(String file)
Deletes a local file.- Parameters:
file
- the file to delete- Returns:
- null if successful, otherwise error message
-
deleteRemote
protected abstract String deleteRemote(String file)
Deletes a remote file.- Parameters:
file
- the file to delete- Returns:
- null if successful, otherwise error message
-
delete
public String delete(String file)
Deletes a file.- Specified by:
delete
in interfaceFileOperations
- Parameters:
file
- the file to delete- Returns:
- null if successful, otherwise error message
-
mkdirLocal
protected String mkdirLocal(String dir)
Creates the local directory.- Parameters:
dir
- the directory to create- Returns:
- null if successful, otherwise error message
-
mkdirRemote
protected abstract String mkdirRemote(String dir)
Creates the remote directory.- Parameters:
dir
- the directory to create- Returns:
- null if successful, otherwise error message
-
mkdir
public String mkdir(String dir)
Creates the directory.- Specified by:
mkdir
in interfaceFileOperations
- Parameters:
dir
- the directory to create- Returns:
- null if successful, otherwise error message
-
-