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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendFile(jcifs.smb.SmbFile file, InputStream content) voidjcifs.smb.SmbFileCopies the file to another folder.voidcreateFile(jcifs.smb.SmbFile file, InputStream content) voidcreateFolder(String folder) voiddeleteFile(jcifs.smb.SmbFile f) booleanexists(jcifs.smb.SmbFile f) booleanfolderExists(String folder) getAdditionalFileProperties(jcifs.smb.SmbFile file) getCanonicalName(jcifs.smb.SmbFile f) longgetFileSize(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) booleanisFolder(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).DirectoryStream<jcifs.smb.SmbFile> list(jcifs.smb.SmbFile folder, TypeFilter filter) jcifs.smb.SmbFileMoves the file to another folder.voidopen()voidremoveFolder(String folder, boolean removeNonEmptyFolder) jcifs.smb.SmbFilerenameFile(jcifs.smb.SmbFile source, jcifs.smb.SmbFile destination) Renames the file to a new name, possibly in another folder.voidsetAuthAlias(String authAlias) Alias used to obtain credentials for the SMB sharevoidsetDomainName(String domain) logon/authentication domain, in case the user account is bound to a domain such as Active Directory.voidsetForce(boolean force) whentrue, intermediate directories are created alsovoidsetListHiddenFiles(boolean listHiddenFiles) controls whether hidden files are seen or notvoidsetPassword(String password) The SMB share passwordvoidThe destination, aka smb://xxx/yyy sharevoidsetUsername(String username) The SMB share usernamejcifs.smb.SmbFileGet a file 'F' representation of an identification of a file.jcifs.smb.SmbFileCreates a reference to a file.Methods inherited from class org.frankframework.filesystem.AbstractFileSystem
close, getMaxNumberOfMessagesToList, getNumberOfFilesInFolder, isOpen, setMaxNumberOfMessagesToListMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.frankframework.filesystem.IBasicFileSystem
close, getCanonicalNameOrErrorMessage, getNumberOfFilesInFolder, isOpen
-
Constructor Details
-
Samba1FileSystem
public Samba1FileSystem()
-
-
Method Details
-
configure
- Specified by:
configurein interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
ConfigurationException
-
open
- Specified by:
openin interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Overrides:
openin classAbstractFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
toFile
Description copied from interface:IBasicFileSystemGet a file 'F' representation of an identification of a file. Must pair up with the implementation ofIBasicFileSystem.getName(Object).- Specified by:
toFilein interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
toFile
public jcifs.smb.SmbFile toFile(@Nullable String folder, @Nullable String filename) throws FileSystemException Description copied from interface:IBasicFileSystemCreates a reference to a file. If filename is not absolute, it will be created in 'defaultFolder'.- Specified by:
toFilein interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
list
public DirectoryStream<jcifs.smb.SmbFile> list(jcifs.smb.SmbFile folder, TypeFilter filter) throws FileSystemException - Specified by:
listin interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
list
public DirectoryStream<jcifs.smb.SmbFile> list(String folder, TypeFilter filter) throws FileSystemException Description copied from interface:IBasicFileSystemLists 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.
Temporary default method until all implementations useIBasicFileSystem.list(F, TypeFilter)TODO: See Issue 7193- Specified by:
listin interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
exists
- Specified by:
existsin interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
createFile
- Specified by:
createFilein interfaceIWritableFileSystem<jcifs.smb.SmbFile>- Parameters:
file- FileSystem file referencecontent- to write or NULL. When NULL existing files should be overwritten, and new files should be created.- Throws:
IOException
-
appendFile
- Specified by:
appendFilein interfaceIWritableFileSystem<jcifs.smb.SmbFile>- Throws:
IOException
-
readFile
public Message readFile(jcifs.smb.SmbFile f, String charset) throws IOException, FileSystemException - Specified by:
readFilein interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
IOExceptionFileSystemException
-
deleteFile
- Specified by:
deleteFilein interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
isFolder
- Specified by:
isFolderin interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
folderExists
- Specified by:
folderExistsin interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
createFolder
- Specified by:
createFolderin interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
removeFolder
- Specified by:
removeFolderin 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:IWritableFileSystemRenames the file to a new name, possibly in another folder. Does not need to check for the existence of the source or non-existence of the destination.- Specified by:
renameFilein 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:IBasicFileSystemMoves 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:
moveFilein 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:IBasicFileSystemCopies 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:
copyFilein interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
getPhysicalDestinationName
- Specified by:
getPhysicalDestinationNamein interfaceHasPhysicalDestination
-
getFileSize
- Specified by:
getFileSizein interfaceIBasicFileSystem<jcifs.smb.SmbFile>- Throws:
FileSystemException
-
getName
Description copied from interface:IBasicFileSystemGet 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:
getNamein interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getParentFolder
- Specified by:
getParentFolderin interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getCanonicalName
- Specified by:
getCanonicalNamein interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getModificationTime
- Specified by:
getModificationTimein interfaceIBasicFileSystem<jcifs.smb.SmbFile>
-
getAdditionalFileProperties
- Specified by:
getAdditionalFilePropertiesin 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
-