Class DiskShare
java.lang.Object
com.hierynomus.smbj.share.Share
com.hierynomus.smbj.share.DiskShare
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
Fields inherited from class Share
session, smbPath, treeConnect -
Constructor Summary
ConstructorsConstructorDescriptionDiskShare(SmbPath smbPath, TreeConnect treeConnect, PathResolver pathResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteOnClose(SMB2FileId fileId) booleanfileExists(String path) File in the given path exists or notbooleanfolderExists(String path) Folder in the given path exists or not.protected StatusHandlerprotected DiskEntrygetDiskEntry(com.hierynomus.smbj.share.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) 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
close, equals, getSmbPath, getTreeConnect, hashCode, ioctl, ioctl, ioctl, ioctlAsync, isConnected, queryInfo
-
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
-
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
-