java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Request<Smb2QueryDirectoryResponse>
org.codelibs.jcifs.smb.internal.smb2.info.Smb2QueryDirectoryRequest
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockRequest,Request<Smb2QueryDirectoryResponse>,RequestWithFileId,Message,Request
public class Smb2QueryDirectoryRequest
extends ServerMessageBlock2Request<Smb2QueryDirectoryResponse>
implements RequestWithFileId
SMB2 Query Directory request message. This command is used to enumerate the contents
of a directory on the server.
- Author:
- mbechler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteFile information class for both names directory information.static final byteFile information class for basic directory information.static final byteFile information class for full directory information.static final byteFile information class for both names with file IDs.static final byteFile information class for full directory information with file IDs.static final byteFile information class for file names only.static final byteFlag indicating that the file index field contains a valid index.static final byteFlag to reopen the directory enumeration.static final byteFlag to restart the directory enumeration from the beginning.static final byteFlag to return only a single directory entry.Fields inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
SMB2_CANCEL, SMB2_CHANGE_NOTIFY, SMB2_CLOSE, SMB2_CREATE, SMB2_ECHO, SMB2_FLAGS_ASYNC_COMMAND, SMB2_FLAGS_DFS_OPERATIONS, SMB2_FLAGS_PRIORITY_MASK, SMB2_FLAGS_RELATED_OPERATIONS, SMB2_FLAGS_REPLAY_OPERATION, SMB2_FLAGS_SERVER_TO_REDIR, SMB2_FLAGS_SIGNED, SMB2_FLUSH, SMB2_IOCTL, SMB2_LOCK, SMB2_LOGOFF, SMB2_NEGOTIATE, SMB2_OPLOCK_BREAK, SMB2_QUERY_DIRECTORY, SMB2_QUERY_INFO, SMB2_READ, SMB2_SESSION_SETUP, SMB2_SET_INFO, SMB2_TREE_CONNECT, SMB2_TREE_DISCONNECT, SMB2_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an SMB2 query directory request with the given configuration.Smb2QueryDirectoryRequest(Configuration config, byte[] fileId) Constructs a SMB2 query directory request with the specified configuration and file ID -
Method Summary
Modifier and TypeMethodDescriptionprotected Smb2QueryDirectoryResponseCreate the response object for this requestprotected intreadBytesWireFormat(byte[] buffer, int bufferIndex) Reads the message body from the wire format.voidsetFileId(byte[] fileId) Sets the file ID for this request.voidsetFileIndex(int fileIndex) Sets the file index from which to start the directory enumerationvoidsetFileInformationClass(byte fileInformationClass) Sets the file information class for the directory queryvoidsetFileName(String fileName) Sets the file name pattern for filtering directory resultsvoidsetQueryFlags(byte queryFlags) Sets the query flags for the directory enumerationintsize()Gets the size of this message.protected intwriteBytesWireFormat(byte[] dst, int dstIndex) Writes the message body to the wire format.Methods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Request
allowChain, createCancel, encode, getCreditCost, getNext, getOverrideTimeout, getResponse, ignoreDisconnect, initResponse, isCancel, isResponseAsync, setNext, setOverrideTimeout, setRequestCredits, setResponse, setTid, splitMethods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
addFlags, chain, clearFlags, decode, decode, equals, getAsyncId, getCommand, getConfig, getCredit, getCreditCharge, getDigest, getErrorContextCount, getErrorData, getFlags, getHeaderStart, getLength, getMid, getNextCommandOffset, getRawPayload, getSessionId, getStatus, getTreeId, hashCode, haveResponse, isAsync, isErrorResponseStatus, isRetainPayload, pad8, readErrorResponse, readHeaderWireFormat, reset, retainPayload, setAsyncId, setCommand, setCredit, setDigest, setExtendedSecurity, setMid, setNext, setRawPayload, setReadSize, setSessionId, setTreeId, setUid, size8, size8, toString, writeHeaderWireFormatMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.codelibs.jcifs.smb.internal.CommonServerMessageBlock
decode, getCommand, getDigest, getMid, reset, setCommand, setDigest, setExtendedSecurity, setMid, setSessionId, setUidMethods inherited from interface org.codelibs.jcifs.smb.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayload
-
Field Details
-
FILE_DIRECTORY_INFO
public static final byte FILE_DIRECTORY_INFOFile information class for basic directory information.- See Also:
-
FILE_FULL_DIRECTORY_INFO
public static final byte FILE_FULL_DIRECTORY_INFOFile information class for full directory information.- See Also:
-
FILE_BOTH_DIRECTORY_INFO
public static final byte FILE_BOTH_DIRECTORY_INFOFile information class for both names directory information.- See Also:
-
FILE_NAMES_INFO
public static final byte FILE_NAMES_INFOFile information class for file names only.- See Also:
-
FILE_ID_BOTH_DIRECTORY_INFO
public static final byte FILE_ID_BOTH_DIRECTORY_INFOFile information class for both names with file IDs.- See Also:
-
FILE_ID_FULL_DIRECTORY_INFO
public static final byte FILE_ID_FULL_DIRECTORY_INFOFile information class for full directory information with file IDs.- See Also:
-
SMB2_RESTART_SCANS
public static final byte SMB2_RESTART_SCANSFlag to restart the directory enumeration from the beginning.- See Also:
-
SMB2_RETURN_SINGLE_ENTRY
public static final byte SMB2_RETURN_SINGLE_ENTRYFlag to return only a single directory entry.- See Also:
-
SMB2_INDEX_SPECIFIED
public static final byte SMB2_INDEX_SPECIFIEDFlag indicating that the file index field contains a valid index.- See Also:
-
SMB2_REOPEN
public static final byte SMB2_REOPENFlag to reopen the directory enumeration.- See Also:
-
-
Constructor Details
-
Smb2QueryDirectoryRequest
Constructs an SMB2 query directory request with the given configuration.- Parameters:
config- the configuration for this request
-
Smb2QueryDirectoryRequest
Constructs a SMB2 query directory request with the specified configuration and file ID- Parameters:
config- the configuration to use for this requestfileId- the file ID of the directory to query
-
-
Method Details
-
setFileId
public void setFileId(byte[] fileId) Sets the file ID for this request.- Specified by:
setFileIdin interfaceRequestWithFileId- Parameters:
fileId- the file ID to set- See Also:
-
setFileInformationClass
public void setFileInformationClass(byte fileInformationClass) Sets the file information class for the directory query- Parameters:
fileInformationClass- the fileInformationClass to set
-
setQueryFlags
public void setQueryFlags(byte queryFlags) Sets the query flags for the directory enumeration- Parameters:
queryFlags- the queryFlags to set
-
setFileIndex
public void setFileIndex(int fileIndex) Sets the file index from which to start the directory enumeration- Parameters:
fileIndex- the fileIndex to set
-
setFileName
Sets the file name pattern for filtering directory results- Parameters:
fileName- the fileName to set
-
createResponse
protected Smb2QueryDirectoryResponse createResponse(CIFSContext tc, ServerMessageBlock2Request<Smb2QueryDirectoryResponse> req) Create the response object for this request- Specified by:
createResponsein classServerMessageBlock2Request<Smb2QueryDirectoryResponse>- Parameters:
tc- the CIFS contextreq- the request object- Returns:
- the response object
- See Also:
-
size
public int size()Gets the size of this message.- Specified by:
sizein interfaceCommonServerMessageBlockRequest- Returns:
- the size of this message
- See Also:
-
writeBytesWireFormat
protected int writeBytesWireFormat(byte[] dst, int dstIndex) Writes the message body to the wire format.- Specified by:
writeBytesWireFormatin classServerMessageBlock2- Parameters:
dst- the destination bufferdstIndex- the starting position in the buffer- Returns:
- number of bytes written
- See Also:
-
readBytesWireFormat
protected int readBytesWireFormat(byte[] buffer, int bufferIndex) Reads the message body from the wire format.- Specified by:
readBytesWireFormatin classServerMessageBlock2- Parameters:
buffer- the buffer to read frombufferIndex- the starting position in the buffer- Returns:
- number of bytes read
- See Also:
-