Package com.hierynomus.smbj.share
Class DiskShare
java.lang.Object
com.hierynomus.smbj.share.Share
com.hierynomus.smbj.share.DiskShare
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
A return object for thecreateFileAndResolve(SmbPath, SMB2ImpersonationLevel, Set, Set, Set, SMB2CreateDisposition, Set)
call. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static StatusHandler
private static final StatusHandler
private static final StatusHandler
private final PathResolver
Fields inherited from class com.hierynomus.smbj.share.Share
session, smbPath, treeConnect
-
Constructor Summary
ConstructorsConstructorDescriptionDiskShare
(SmbPath smbPath, TreeConnect treeConnect, PathResolver pathResolver) -
Method Summary
Modifier and TypeMethodDescriptioncreateFileAndResolve
(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) void
deleteOnClose
(SMB2FileId fileId) private boolean
exists
(String path, EnumSet<SMB2CreateOptions> createOptions, StatusHandler statusHandler) boolean
fileExists
(String path) File in the given path exists or notboolean
folderExists
(String path) Folder in the given path exists or not.protected StatusHandler
protected DiskEntry
getDiskEntry
(DiskShare.SMB2CreateResponseContext responseContext) getFileInformation
(SMB2FileId fileId) Get information for a given fileId<F extends FileQueryableInformation>
FgetFileInformation
(SMB2FileId fileId, Class<F> informationClass) getFileInformation
(String path) Get information about the given path.<F extends FileQueryableInformation>
FgetFileInformation
(String path, Class<F> informationClass) Get information about the given path.getSecurityInfo
(SMB2FileId fileId, Set<SecurityInformation> securityInfo) The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileIdgetSecurityInfo
(String path, Set<SecurityInformation> securityInfo) The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given PathGet Share Information for the current Disk ShareEquivalent to callinginvalid reference
list(path, FileIdBothDirectoryInformation.class, null, null)
<I extends FileDirectoryQueryableInformation>
List<I> Equivalent to callinginvalid reference
list(path, informationClass, null, null)
<I extends FileDirectoryQueryableInformation>
List<I> Opens the given path for read-only access and performs a directory listing.Equivalent to callinginvalid reference
list(path, FileIdBothDirectoryInformation.class, searchPattern, null)
void
Create a directory in the given path.open
(String path, Set<AccessMask> accessMask, Set<FileAttributes> attributes, Set<SMB2ShareAccess> shareAccesses, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) openDirectory
(String path, Set<AccessMask> accessMask, Set<FileAttributes> attributes, Set<SMB2ShareAccess> shareAccesses, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) Get a handle to a directory in the given pathopenFile
(String path, Set<AccessMask> accessMask, Set<FileAttributes> attributes, Set<SMB2ShareAccess> shareAccesses, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) private DiskShare
rerouteIfNeeded
(SmbPath path, SmbPath target) resolveAndCreateFile
(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) void
Remove the file at the given pathvoid
Remove the directory at the given path.<F extends FileSettableInformation>
voidsetFileInformation
(SMB2FileId fileId, F information) <F extends FileSettableInformation>
voidsetFileInformation
(String path, F information) Get information for a given pathvoid
setSecurityInfo
(SMB2FileId fileId, Set<SecurityInformation> securityInfo, SecurityDescriptor securityDescriptor) The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileIdvoid
setSecurityInfo
(String path, Set<SecurityInformation> securityInfo, SecurityDescriptor securityDescriptor) The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileIdtoString()
Methods inherited from class com.hierynomus.smbj.share.Share
changeNotifyAsync, close, closeFileId, closeFileIdNoWait, createFile, equals, flush, getDialect, getReadBufferSize, getReadTimeout, getSmbPath, getTreeConnect, getWriteBufferSize, hashCode, ioctl, ioctl, ioctl, ioctl, ioctl, ioctl, ioctl, ioctlAsync, ioctlAsync, isConnected, openFileId, queryDirectory, queryInfo, read, readAsync, receive, receive, sendLockRequest, setInfo, write, writeAsync
-
Field Details
-
resolver
-
FILE_EXISTS_STATUS_HANDLER
-
FOLDER_EXISTS_STATUS_HANDLER
-
ALREADY_DELETED_STATUS_HANDLER
-
-
Constructor Details
-
Method Details
-
open
public DiskEntry open(String path, Set<AccessMask> accessMask, Set<FileAttributes> attributes, Set<SMB2ShareAccess> shareAccesses, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) -
getCreateStatusHandler
- Overrides:
getCreateStatusHandler
in classShare
-
createFileAndResolve
private DiskShare.SMB2CreateResponseContext createFileAndResolve(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) -
resolveAndCreateFile
private DiskShare.SMB2CreateResponseContext resolveAndCreateFile(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) -
rerouteIfNeeded
-
openDirectory
public Directory openDirectory(String path, Set<AccessMask> accessMask, Set<FileAttributes> attributes, Set<SMB2ShareAccess> shareAccesses, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) Get a handle to a directory in the given path -
openFile
public File openFile(String path, Set<AccessMask> accessMask, Set<FileAttributes> attributes, Set<SMB2ShareAccess> shareAccesses, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) -
fileExists
File in the given path exists or not- Throws:
SMBApiException
-
folderExists
Folder in the given path exists or not.- Throws:
SMBApiException
-
list
Equivalent to callinginvalid reference
list(path, FileIdBothDirectoryInformation.class, null, null)
- Throws:
SMBApiException
- See Also:
-
list
public List<FileIdBothDirectoryInformation> list(String path, String searchPattern) throws SMBApiException Equivalent to callinginvalid reference
list(path, FileIdBothDirectoryInformation.class, searchPattern, null)
- Throws:
SMBApiException
- See Also:
-
list
public <I extends FileDirectoryQueryableInformation> List<I> list(String path, Class<I> informationClass) Equivalent to callinginvalid reference
list(path, informationClass, null, null)
- See Also:
-
list
public <I extends FileDirectoryQueryableInformation> List<I> list(String path, Class<I> informationClass, String searchPattern, EnumSet<AccessMask> accessMask) Opens the given path for read-only access and performs a directory listing.- See Also:
-
mkdir
Create a directory in the given path.- Throws:
SMBApiException
-
getFileInformation
Get information about the given path.- Throws:
SMBApiException
-
getFileInformation
public <F extends FileQueryableInformation> F getFileInformation(String path, Class<F> informationClass) throws SMBApiException Get information about the given path.- Throws:
SMBApiException
-
getFileInformation
Get information for a given fileId- Throws:
SMBApiException
-
getFileInformation
public <F extends FileQueryableInformation> F getFileInformation(SMB2FileId fileId, Class<F> informationClass) throws SMBApiException - Throws:
SMBApiException
-
setFileInformation
public <F extends FileSettableInformation> void setFileInformation(SMB2FileId fileId, F information) -
setFileInformation
public <F extends FileSettableInformation> void setFileInformation(String path, F information) throws SMBApiException Get information for a given path- Throws:
SMBApiException
-
rmdir
Remove the directory at the given path.- Throws:
SMBApiException
-
rm
Remove the file at the given path- Throws:
SMBApiException
-
deleteOnClose
-
getSecurityInfo
public SecurityDescriptor getSecurityInfo(String path, Set<SecurityInformation> securityInfo) throws SMBApiException The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given Path- Throws:
SMBApiException
-
getSecurityInfo
public SecurityDescriptor getSecurityInfo(SMB2FileId fileId, Set<SecurityInformation> securityInfo) throws SMBApiException The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileId- Throws:
SMBApiException
-
setSecurityInfo
public void setSecurityInfo(String path, Set<SecurityInformation> securityInfo, SecurityDescriptor securityDescriptor) throws SMBApiException The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileId- Throws:
SMBApiException
-
setSecurityInfo
public void setSecurityInfo(SMB2FileId fileId, Set<SecurityInformation> securityInfo, SecurityDescriptor securityDescriptor) throws SMBApiException The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileId- Throws:
SMBApiException
-
toString
-