Package adams.core.io.fileoperations
Class SmbFileOperations
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.io.fileoperations.AbstractFileOperations
-
- adams.core.io.fileoperations.AbstractRemoteFileOperations
-
- adams.core.io.fileoperations.SmbFileOperations
-
- All Implemented Interfaces:
FileOperations
,RemoteFileOperations
,LoggingLevelHandler
,LoggingSupporter
,SizeOfHandler
,Serializable
public class SmbFileOperations extends AbstractRemoteFileOperations
SMB / Windows share file operations.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SMBAuthenticationProvider
m_Provider
the authentication provider to use.-
Fields inherited from class adams.core.io.fileoperations.AbstractRemoteFileOperations
m_Direction, m_LocalOperations
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description SmbFileOperations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
copy(String source, String target)
Copies a file.protected String
deleteRemote(String file)
Deletes a remote file.SMBAuthenticationProvider
getProvider()
Returns the authentication provider in use.boolean
isSupported(Operation op)
Checks whether the given operation is supported.protected String
mkdirRemote(String dir)
Creates the remote directory.String
move(String source, String target)
Moves a file.protected String
renameRemote(String source, String target)
Renames a remote file.void
setProvider(SMBAuthenticationProvider value)
Sets the authentication provider to use.-
Methods inherited from class adams.core.io.fileoperations.AbstractRemoteFileOperations
delete, deleteLocal, getDirection, initialize, mkdir, mkdirLocal, rename, renameLocal, setDirection
-
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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Provider
protected SMBAuthenticationProvider m_Provider
the authentication provider to use.
-
-
Method Detail
-
setProvider
public void setProvider(SMBAuthenticationProvider value)
Sets the authentication provider to use.- Parameters:
value
- the provider
-
getProvider
public SMBAuthenticationProvider getProvider()
Returns the authentication provider in use.- Returns:
- the provider, null if none set
-
isSupported
public boolean isSupported(Operation op)
Checks whether the given operation is supported.- Parameters:
op
- the operation to check- Returns:
- true if supported
-
copy
public String copy(String source, String target)
Copies a file.- Parameters:
source
- the source filetarget
- the target file- Returns:
- null if successful, otherwise error message
-
move
public String move(String source, String target)
Moves a file.- Parameters:
source
- the source filetarget
- the target file- Returns:
- null if successful, otherwise error message
-
renameRemote
protected String renameRemote(String source, String target)
Renames a remote file.- Specified by:
renameRemote
in classAbstractRemoteFileOperations
- Parameters:
source
- the source file (old)target
- the target file (new)- Returns:
- null if successful, otherwise error message
-
deleteRemote
protected String deleteRemote(String file)
Deletes a remote file.- Specified by:
deleteRemote
in classAbstractRemoteFileOperations
- Parameters:
file
- the file to delete- Returns:
- null if successful, otherwise error message
-
mkdirRemote
protected String mkdirRemote(String dir)
Creates the remote directory.- Specified by:
mkdirRemote
in classAbstractRemoteFileOperations
- Parameters:
dir
- the directory to create- Returns:
- null if successful, otherwise error message
-
-