Class Samba1FileSystem
java.lang.Object
org.frankframework.filesystem.AbstractFileSystem<jcifs.smb.SmbFile>
org.frankframework.filesystem.smb.Samba1FileSystem
- All Implemented Interfaces:
AutoCloseable
,HasPhysicalDestination
,IBasicFileSystem<jcifs.smb.SmbFile>
,IWritableFileSystem<jcifs.smb.SmbFile>
public class Samba1FileSystem
extends AbstractFileSystem<jcifs.smb.SmbFile>
implements IWritableFileSystem<jcifs.smb.SmbFile>
Uses the (old) SMB 1 protocol.
Only supports NTLM authentication.
Only supports NTLM authentication.
-
Field Summary
Fields inherited from class org.frankframework.filesystem.AbstractFileSystem
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendFile
(jcifs.smb.SmbFile f) void
jcifs.smb.SmbFile
Copies the file to another folder.createFile
(jcifs.smb.SmbFile f) void
createFolder
(String folder) void
deleteFile
(jcifs.smb.SmbFile f) boolean
exists
(jcifs.smb.SmbFile f) boolean
folderExists
(String folder) getAdditionalFileProperties
(jcifs.smb.SmbFile file) getCanonicalName
(jcifs.smb.SmbFile f) long
getFileSize
(jcifs.smb.SmbFile f) getModificationTime
(jcifs.smb.SmbFile f) getName
(jcifs.smb.SmbFile f) Get a string representation of an identification of a file.getParentFolder
(jcifs.smb.SmbFile f) boolean
isFolder
(jcifs.smb.SmbFile f) DirectoryStream
<jcifs.smb.SmbFile> list
(String folder, TypeFilter filter) Lists files, directories or both, from a 'folder' or in the 'root' of the filesystem (when folder is null).jcifs.smb.SmbFile
Moves the file to another folder.void
open()
void
removeFolder
(String folder, boolean removeNonEmptyFolder) jcifs.smb.SmbFile
renameFile
(jcifs.smb.SmbFile source, jcifs.smb.SmbFile destination) Renames the file to a new name, possibly in a another folder.void
setAuthAlias
(String authAlias) Alias used to obtain credentials for the SMB sharevoid
setDomainName
(String domain) logon/authentication domain, in case the user account is bound to a domain such as Active Directory.void
setForce
(boolean force) whentrue
, intermediate directories are created alsovoid
setListHiddenFiles
(boolean listHiddenFiles) controls whether hidden files are seen or notvoid
setPassword
(String password) The SMB share passwordvoid
The destination, aka smb://xxx/yyy sharevoid
setUsername
(String username) The SMB share usernamejcifs.smb.SmbFile
Get a file 'F' representation of an identification of a file.jcifs.smb.SmbFile
Creates a reference to a file.Methods inherited from class org.frankframework.filesystem.AbstractFileSystem
close, getMaxNumberOfMessagesToList, getNumberOfFilesInFolder, isOpen, setMaxNumberOfMessagesToList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.frankframework.core.HasPhysicalDestination
getDomain
Methods inherited from interface org.frankframework.filesystem.IBasicFileSystem
close, getCanonicalNameOrErrorMessage, getNumberOfFilesInFolder, isOpen
Methods inherited from interface org.frankframework.filesystem.IWritableFileSystem
appendFile, createFile
-
Constructor Details
-
Samba1FileSystem
public Samba1FileSystem()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
ConfigurationException
-
open
- Specified by:
open
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Overrides:
open
in classAbstractFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
toFile
Description copied from interface:IBasicFileSystem
Get a file 'F' representation of an identification of a file. Must pair up with the implementation ofIBasicFileSystem.getName(Object)
.- Specified by:
toFile
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
toFile
public jcifs.smb.SmbFile toFile(@Nullable String folder, @Nullable String filename) throws FileSystemException Description copied from interface:IBasicFileSystem
Creates a reference to a file. If filename is not absolute, it will be created in 'defaultFolder'.- Specified by:
toFile
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
list
public DirectoryStream<jcifs.smb.SmbFile> list(String folder, TypeFilter filter) throws FileSystemException Description copied from interface:IBasicFileSystem
Lists files, directories or both, from a 'folder' or in the 'root' of the filesystem (when folder is null). Only lists the objects as defined by the type filter.- Specified by:
list
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
exists
- Specified by:
exists
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
createFile
- Specified by:
createFile
in interfaceIWritableFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
appendFile
- Specified by:
appendFile
in interfaceIWritableFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
readFile
public Message readFile(jcifs.smb.SmbFile f, String charset) throws IOException, FileSystemException - Specified by:
readFile
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
IOException
FileSystemException
-
deleteFile
- Specified by:
deleteFile
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
isFolder
- Specified by:
isFolder
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
folderExists
- Specified by:
folderExists
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
createFolder
- Specified by:
createFolder
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
removeFolder
- Specified by:
removeFolder
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
renameFile
public jcifs.smb.SmbFile renameFile(jcifs.smb.SmbFile source, jcifs.smb.SmbFile destination) throws FileSystemException Description copied from interface:IWritableFileSystem
Renames the file to a new name, possibly in a another folder. Does not need to check for existence of the source or non-existence of the destination.- Specified by:
renameFile
in interfaceIWritableFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
moveFile
public jcifs.smb.SmbFile moveFile(jcifs.smb.SmbFile f, String destinationFolder, boolean createFolder) throws FileSystemException Description copied from interface:IBasicFileSystem
Moves the file to another folder. Does not need to check for existence of the source or non-existence of the destination. Returns the moved file, or null if no file was moved or there is no reference to the moved file.- Specified by:
moveFile
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
copyFile
public jcifs.smb.SmbFile copyFile(jcifs.smb.SmbFile f, String destinationFolder, boolean createFolder) throws FileSystemException Description copied from interface:IBasicFileSystem
Copies the file to another folder. Does not need to check for existence of the source or non-existence of the destination. Returns the copied file, or null if no file was copied or there is no reference to the copied file.- Specified by:
copyFile
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
getPhysicalDestinationName
- Specified by:
getPhysicalDestinationName
in interfaceHasPhysicalDestination
-
getFileSize
- Specified by:
getFileSize
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
- Throws:
FileSystemException
-
getName
Description copied from interface:IBasicFileSystem
Get a string representation of an identification of a file. Must pair up with the implementation ofIBasicFileSystem.toFile(String)
. Can reflect name a file has in its folder, is not expected to be unique over folders.- Specified by:
getName
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getParentFolder
- Specified by:
getParentFolder
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getCanonicalName
- Specified by:
getCanonicalName
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getModificationTime
- Specified by:
getModificationTime
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getAdditionalFileProperties
- Specified by:
getAdditionalFileProperties
in interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
setUsername
The SMB share username -
setPassword
The SMB share password -
setAuthAlias
Alias used to obtain credentials for the SMB share -
setDomainName
logon/authentication domain, in case the user account is bound to a domain such as Active Directory. -
setForce
public void setForce(boolean force) whentrue
, intermediate directories are created also- Default value
- false
-
setListHiddenFiles
public void setListHiddenFiles(boolean listHiddenFiles) controls whether hidden files are seen or not- Default value
- false
-