public class Samba2FileSystem extends FileSystemBase<SmbFileRef> implements IWritableFileSystem<SmbFileRef>
Modifier and Type | Class and Description |
---|---|
static class |
Samba2FileSystem.Samba2AuthType |
log
Constructor and Description |
---|
Samba2FileSystem() |
Modifier and Type | Method and Description |
---|---|
OutputStream |
appendFile(SmbFileRef f) |
void |
close() |
void |
configure() |
SmbFileRef |
copyFile(SmbFileRef f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Copies the file to a another folder.
|
OutputStream |
createFile(SmbFileRef f) |
void |
createFolder(String folder) |
void |
deleteFile(SmbFileRef f) |
boolean |
exists(SmbFileRef f) |
boolean |
folderExists(String folder) |
Map<String,Object> |
getAdditionalFileProperties(SmbFileRef f) |
String |
getCanonicalName(SmbFileRef f) |
long |
getFileSize(SmbFileRef f) |
Date |
getModificationTime(SmbFileRef f) |
String |
getName(SmbFileRef file)
Get a string representation of an identification of a file.
|
String |
getParentFolder(SmbFileRef f) |
String |
getPhysicalDestinationName() |
DirectoryStream<SmbFileRef> |
listFiles(String folder)
Lists all files in 'folder' or in the 'root' of the filesystem (when folder is null).
|
SmbFileRef |
moveFile(SmbFileRef f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Moves the file to a another folder.
|
void |
open() |
Message |
readFile(SmbFileRef filename,
String charset) |
void |
removeFolder(String folder,
boolean removeNonEmptyFolder) |
SmbFileRef |
renameFile(SmbFileRef source,
SmbFileRef 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 share
|
void |
setAuthType(Samba2FileSystem.Samba2AuthType authType)
Type of the authentication either 'NTLM' or 'SPNEGO'.
|
void |
setDomainName(String domain)
NTLM: logon domain
|
void |
setHostname(String hostname) |
void |
setKdc(String kdc)
Key Distribution Center, typically hosted on a domain controller.
|
void |
setListHiddenFiles(boolean listHiddenFiles)
controls whether hidden files are seen or not
|
void |
setPassword(String password)
the smb share password
|
void |
setPort(int port) |
void |
setRealm(String realm)
Kerberos Realm, case sensitive.
|
void |
setShare(String share) |
void |
setUsername(String username)
the smb share username
|
SmbFileRef |
toFile(String filename)
Get a file 'F' representation of an identification of a file.
|
SmbFileRef |
toFile(String folder,
String filename)
Creates a reference to a file.
|
getMaxNumberOfMessagesToList, getNumberOfFilesInFolder, isOpen, setMaxNumberOfMessagesToList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNumberOfFilesInFolder, isOpen
getDomain
public void configure() throws ConfigurationException
configure
in interface IBasicFileSystem<SmbFileRef>
ConfigurationException
public void open() throws FileSystemException
open
in interface IBasicFileSystem<SmbFileRef>
open
in class FileSystemBase<SmbFileRef>
FileSystemException
public void close() throws FileSystemException
close
in interface IBasicFileSystem<SmbFileRef>
close
in class FileSystemBase<SmbFileRef>
FileSystemException
public SmbFileRef toFile(String filename) throws FileSystemException
IBasicFileSystem
IBasicFileSystem.getName(Object)
.toFile
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public SmbFileRef toFile(String folder, String filename) throws FileSystemException
IBasicFileSystem
toFile
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public DirectoryStream<SmbFileRef> listFiles(String folder) throws FileSystemException
IBasicFileSystem
listFiles
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public boolean exists(SmbFileRef f) throws FileSystemException
exists
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public OutputStream createFile(SmbFileRef f) throws FileSystemException, IOException
createFile
in interface IWritableFileSystem<SmbFileRef>
FileSystemException
IOException
public OutputStream appendFile(SmbFileRef f) throws FileSystemException, IOException
appendFile
in interface IWritableFileSystem<SmbFileRef>
FileSystemException
IOException
public Message readFile(SmbFileRef filename, String charset) throws FileSystemException, IOException
readFile
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
IOException
public void deleteFile(SmbFileRef f) throws FileSystemException
deleteFile
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public SmbFileRef renameFile(SmbFileRef source, SmbFileRef destination) throws FileSystemException
IWritableFileSystem
renameFile
in interface IWritableFileSystem<SmbFileRef>
FileSystemException
public SmbFileRef moveFile(SmbFileRef f, String destinationFolder, boolean createFolder, boolean resultantMustBeReturned) throws FileSystemException
IBasicFileSystem
resultantMustBeReturned
is set, then an Exception must be thrown, preferably before the file is moved;resultantMustBeReturned
is not set, then a null result returned might also mean the file was moved successfully, but with unknown destination;moveFile
in interface IBasicFileSystem<SmbFileRef>
resultantMustBeReturned
- TODOFileSystemException
public SmbFileRef copyFile(SmbFileRef f, String destinationFolder, boolean createFolder, boolean resultantMustBeReturned) throws FileSystemException
IBasicFileSystem
resultantMustBeReturned
is set, then an Exception must be thrown, preferably before the file is copied;resultantMustBeReturned
is not set, then a null result returned might also mean the file was copied successfully, but with unknown destination;copyFile
in interface IBasicFileSystem<SmbFileRef>
resultantMustBeReturned
- TODOFileSystemException
public Map<String,Object> getAdditionalFileProperties(SmbFileRef f)
getAdditionalFileProperties
in interface IBasicFileSystem<SmbFileRef>
public boolean folderExists(String folder) throws FileSystemException
folderExists
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public void createFolder(String folder) throws FileSystemException
createFolder
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public void removeFolder(String folder, boolean removeNonEmptyFolder) throws FileSystemException
removeFolder
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public long getFileSize(SmbFileRef f) throws FileSystemException
getFileSize
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public String getName(SmbFileRef file)
IBasicFileSystem
IBasicFileSystem.toFile(String)
.
Can reflect name a file has in its folder, is not expected to be unique over folders.getName
in interface IBasicFileSystem<SmbFileRef>
public String getParentFolder(SmbFileRef f)
getParentFolder
in interface IBasicFileSystem<SmbFileRef>
public String getCanonicalName(SmbFileRef f)
getCanonicalName
in interface IBasicFileSystem<SmbFileRef>
public Date getModificationTime(SmbFileRef f) throws FileSystemException
getModificationTime
in interface IBasicFileSystem<SmbFileRef>
FileSystemException
public String getPhysicalDestinationName()
getPhysicalDestinationName
in interface HasPhysicalDestination
public void setShare(String share)
public void setUsername(String username)
public void setPassword(String password)
public void setAuthAlias(String authAlias)
public void setDomainName(String domain)
public void setAuthType(Samba2FileSystem.Samba2AuthType authType)
public void setKdc(String kdc)
java.security.krb5.kdc
public void setRealm(String realm)
java.security.krb5.realm
public void setHostname(String hostname)
public void setPort(int port)
public void setListHiddenFiles(boolean listHiddenFiles)
Copyright © 2023 Frank!Framework. All rights reserved.