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 classA return object for thecreateFileAndResolve(SmbPath, SMB2ImpersonationLevel, Set, Set, Set, SMB2CreateDisposition, Set)call. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static StatusHandlerprivate static final StatusHandlerprivate static final StatusHandlerprivate final PathResolverFields inherited from class 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) voiddeleteOnClose(SMB2FileId fileId) private booleanexists(String path, EnumSet<SMB2CreateOptions> createOptions, StatusHandler statusHandler) booleanfileExists(String path) File in the given path exists or notbooleanfolderExists(String path) Folder in the given path exists or not.protected StatusHandlerprotected DiskEntrygetDiskEntry(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 ShareGet Volume Information for the current Disk ShareEquivalent to calling.invalid reference
list(path, FileIdBothDirectoryInformation.class, null, null)<I extends FileDirectoryQueryableInformation>
List<I> Equivalent to calling.invalid 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 calling.invalid reference
list(path, FileIdBothDirectoryInformation.class, searchPattern, null)voidCreate 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 DiskSharererouteIfNeeded(SmbPath path, SmbPath target) resolveAndCreateFile(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) voidRemove the file at the given pathvoidRemove 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 pathvoidsetSecurityInfo(SMB2FileId fileId, Set<SecurityInformation> securityInfo, SecurityDescriptor securityDescriptor) The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileIdvoidsetSecurityInfo(String path, Set<SecurityInformation> securityInfo, SecurityDescriptor securityDescriptor) The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileIdtoString()Methods inherited from class 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:
getCreateStatusHandlerin 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 calling.invalid reference
list(path, FileIdBothDirectoryInformation.class, null, null)- Throws:
SMBApiException- See Also:
-
list
public List<FileIdBothDirectoryInformation> list(String path, String searchPattern) throws SMBApiException Equivalent to calling.invalid 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 calling.invalid 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
-
getVolumeInfo
Get Volume Information for the current Disk Share- Returns:
- the VolumeInfo
- 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
-