Package jcifs.smb
Class SmbNamedPipe
- java.lang.Object
-
- java.net.URLConnection
-
- jcifs.smb.SmbFile
-
- jcifs.smb.SmbNamedPipe
-
public class SmbNamedPipe extends SmbFile
This class will allow a Java program to read and write data to Named Pipes and Transact NamedPipes.There are three Win32 function calls provided by the Windows SDK that are important in the context of using jCIFS. They are:
-
CallNamedPipeA message-type pipe call that opens, writes to, reads from, and closes the pipe in a single operation. -
TransactNamedPipeA message-type pipe call that writes to and reads from an existing pipe descriptor in one operation. -
CreateFile,ReadFile,WriteFile, andCloseFileA byte-type pipe can be opened, written to, read from and closed using the standard Win32 file operations.
The jCIFS API maps all of these operations into the standard Java
XxxputStreaminterface. A specialPIPE_TYPEflags is necessary to distinguish which type of Named Pipe behavior is desired.SmbNamedPipeConstructor ExamplesCode Sample Description new SmbNamedPipe( "smb://server/IPC$/PIPE/foo", SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_CALL );Open the Named Pipe foo for reading and writing. The pipe will behave like the CallNamedPipeinterface.new SmbNamedPipe( "smb://server/IPC$/foo", SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_TRANSACT );Open the Named Pipe foo for reading and writing. The pipe will behave like the TransactNamedPipeinterface.new SmbNamedPipe( "smb://server/IPC$/foo", SmbNamedPipe.PIPE_TYPE_RDWR );Open the Named Pipe foo for reading and writing. The pipe will behave as though the CreateFile,ReadFile,WriteFile, andCloseFileinterface was being used.See Using jCIFS to Connect to Win32 Named Pipes for a detailed description of how to use jCIFS with Win32 Named Pipe server processes.
-
-
-
Field Summary
Fields Modifier and Type Field Description static intCAP_DFSstatic intCAP_EXTENDED_SECURITYstatic intCAP_LARGE_FILESstatic intCAP_LEVEL_II_OPLOCKSstatic intCAP_LOCK_AND_READstatic intCAP_MPX_MODEstatic intCAP_NONEstatic intCAP_NT_FINDstatic intCAP_NT_SMBSstatic intCAP_RAW_MODEstatic intCAP_RPC_REMOTE_APISstatic intCAP_STATUS32static intCAP_UNICODEstatic intCAPABILITIESstatic intCMD_OFFSETstatic intCONN_TIMEOUTstatic java.util.LinkedListCONNECTIONSstatic intDEFAULT_CAPABILITIESstatic intDEFAULT_CONN_TIMEOUTstatic intDEFAULT_FLAGS2static intDEFAULT_MAX_MPX_COUNTstatic intDEFAULT_PORTstatic intDEFAULT_RCV_BUF_SIZEstatic intDEFAULT_RESPONSE_TIMEOUTstatic intDEFAULT_SND_BUF_SIZEstatic intDEFAULT_SO_TIMEOUTstatic intDEFAULT_SSN_LIMITstatic intDELETEstatic intERROR_CODE_OFFSETstatic intFILE_APPEND_DATAstatic intFILE_DELETEstatic intFILE_EXECUTEstatic intFILE_READ_ATTRIBUTESstatic intFILE_READ_DATAstatic intFILE_READ_EAstatic intFILE_WRITE_ATTRIBUTESstatic intFILE_WRITE_DATAstatic intFILE_WRITE_EAstatic intFLAGS_COPY_SOURCE_MODE_ASCIIstatic intFLAGS_COPY_TARGET_MODE_ASCIIstatic intFLAGS_LOCK_AND_READ_WRITE_AND_UNLOCKstatic intFLAGS_NONEstatic intFLAGS_NOTIFY_OF_MODIFY_ACTIONstatic intFLAGS_OFFSETstatic intFLAGS_OPLOCK_REQUESTED_OR_GRANTEDstatic intFLAGS_PATH_NAMES_CANONICALIZEDstatic intFLAGS_PATH_NAMES_CASELESSstatic intFLAGS_RECEIVE_BUFFER_POSTEDstatic intFLAGS_RESPONSEstatic intFLAGS_TARGET_MUST_BE_DIRECTORYstatic intFLAGS_TARGET_MUST_BE_FILEstatic intFLAGS_TREE_COPYstatic intFLAGS_VERIFY_ALL_WRITESstatic intFLAGS2static intFLAGS2_EXTENDED_ATTRIBUTESstatic intFLAGS2_EXTENDED_SECURITY_NEGOTIATIONstatic intFLAGS2_LONG_FILENAMESstatic intFLAGS2_NONEstatic intFLAGS2_PERMIT_READ_IF_EXECUTE_PERMstatic intFLAGS2_RESOLVE_PATHS_IN_DFSstatic intFLAGS2_SECURITY_SIGNATURESstatic intFLAGS2_STATUS32static intFLAGS2_UNICODEstatic booleanFORCE_UNICODEstatic intGENERIC_ALLstatic intGENERIC_EXECUTEstatic intGENERIC_READstatic intGENERIC_WRITEstatic intHEADER_LENGTHstatic java.net.InetAddressLADDRstatic intLM_COMPATIBILITYstatic intLPORTstatic intMAX_MPX_COUNTstatic longMILLISECONDS_BETWEEN_1970_AND_1601static java.lang.StringNATIVE_LANMANstatic java.lang.StringNATIVE_OSstatic java.lang.StringNETBIOS_HOSTNAMEstatic jcifs.smb.SmbTransportNULL_TRANSPORTstatic java.lang.StringOEM_ENCODINGstatic intOPEN_FUNCTION_FAIL_IF_EXISTSstatic intOPEN_FUNCTION_OVERWRITE_IF_EXISTSstatic intPIDstatic intPIPE_TYPE_CALLPipe operations should behave like theCallNamedPipeWin32 Named Pipe function.static intPIPE_TYPE_DCE_TRANSACTstatic intPIPE_TYPE_RDONLYThe pipe should be opened read-only.static intPIPE_TYPE_RDWRThe pipe should be opened for both reading and writing.static intPIPE_TYPE_TRANSACTPipe operations should behave like theTransactNamedPipeWin32 Named Pipe function.static intPIPE_TYPE_WRONLYThe pipe should be opened only for writing.static intRCV_BUF_SIZEstatic intREAD_CONTROLstatic intRESPONSE_TIMEOUTstatic intSECURITY_SHAREstatic intSECURITY_USERstatic intSIGNATURE_OFFSETstatic booleanSIGNPREFstatic intSND_BUF_SIZEstatic intSO_TIMEOUTstatic intSSN_LIMITstatic intSYNCHRONIZEstatic booleanTCP_NODELAYstatic intTID_OFFSETstatic java.util.TimeZoneTZstatic java.lang.StringUNI_ENCODINGstatic booleanUSE_BATCHINGstatic booleanUSE_EXTSECstatic booleanUSE_NTSMBSstatic booleanUSE_NTSTATUSstatic booleanUSE_UNICODEstatic intVC_NUMBERstatic intWRITE_DACstatic intWRITE_OWNER-
Fields inherited from class jcifs.smb.SmbFile
ATTR_ARCHIVE, ATTR_DIRECTORY, ATTR_HIDDEN, ATTR_READONLY, ATTR_SYSTEM, ATTR_VOLUME, dfs, FILE_NO_SHARE, FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE, TYPE_COMM, TYPE_FILESYSTEM, TYPE_NAMED_PIPE, TYPE_PRINTER, TYPE_SERVER, TYPE_SHARE, TYPE_WORKGROUP
-
-
Constructor Summary
Constructors Constructor Description SmbNamedPipe(java.lang.String url, int pipeType)Open the Named Pipe resource specified by the url parameter.SmbNamedPipe(java.lang.String url, int pipeType, NtlmPasswordAuthentication auth)SmbNamedPipe(java.net.URL url, int pipeType, NtlmPasswordAuthentication auth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetNamedPipeInputStream()Return theInputStreamused to read information from this pipe instance.java.io.OutputStreamgetNamedPipeOutputStream()Return theOutputStreamused to write information to this pipe instance.-
Methods inherited from class jcifs.smb.SmbFile
canRead, canWrite, connect, copyTo, createNewFile, createTime, delete, equals, exists, getAttributes, getCanonicalPath, getContentLength, getDate, getDfsPath, getDiskFreeSpace, getInputStream, getLastModified, getName, getOutputStream, getParent, getPath, getPrincipal, getSecurity, getSecurity, getServer, getShare, getShareSecurity, getType, getUncPath, hashCode, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listFiles, mkdir, mkdirs, pathNamesPossiblyEqual, renameTo, setAttributes, setCreateTime, setLastModified, setReadOnly, setReadWrite, toString, toURL
-
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLengthLong, getContentType, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches
-
-
-
-
Field Detail
-
PIPE_TYPE_RDONLY
public static final int PIPE_TYPE_RDONLY
The pipe should be opened read-only.- See Also:
- Constant Field Values
-
PIPE_TYPE_WRONLY
public static final int PIPE_TYPE_WRONLY
The pipe should be opened only for writing.- See Also:
- Constant Field Values
-
PIPE_TYPE_RDWR
public static final int PIPE_TYPE_RDWR
The pipe should be opened for both reading and writing.- See Also:
- Constant Field Values
-
PIPE_TYPE_CALL
public static final int PIPE_TYPE_CALL
Pipe operations should behave like theCallNamedPipeWin32 Named Pipe function.- See Also:
- Constant Field Values
-
PIPE_TYPE_TRANSACT
public static final int PIPE_TYPE_TRANSACT
Pipe operations should behave like theTransactNamedPipeWin32 Named Pipe function.- See Also:
- Constant Field Values
-
PIPE_TYPE_DCE_TRANSACT
public static final int PIPE_TYPE_DCE_TRANSACT
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
DEFAULT_MAX_MPX_COUNT
public static final int DEFAULT_MAX_MPX_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_RESPONSE_TIMEOUT
public static final int DEFAULT_RESPONSE_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_SO_TIMEOUT
public static final int DEFAULT_SO_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_RCV_BUF_SIZE
public static final int DEFAULT_RCV_BUF_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_SND_BUF_SIZE
public static final int DEFAULT_SND_BUF_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_SSN_LIMIT
public static final int DEFAULT_SSN_LIMIT
- See Also:
- Constant Field Values
-
DEFAULT_CONN_TIMEOUT
public static final int DEFAULT_CONN_TIMEOUT
- See Also:
- Constant Field Values
-
LADDR
public static final java.net.InetAddress LADDR
-
LPORT
public static final int LPORT
-
MAX_MPX_COUNT
public static final int MAX_MPX_COUNT
-
SND_BUF_SIZE
public static final int SND_BUF_SIZE
-
RCV_BUF_SIZE
public static final int RCV_BUF_SIZE
-
USE_UNICODE
public static final boolean USE_UNICODE
-
FORCE_UNICODE
public static final boolean FORCE_UNICODE
-
USE_NTSTATUS
public static final boolean USE_NTSTATUS
-
SIGNPREF
public static final boolean SIGNPREF
-
USE_NTSMBS
public static final boolean USE_NTSMBS
-
USE_EXTSEC
public static final boolean USE_EXTSEC
-
NETBIOS_HOSTNAME
public static final java.lang.String NETBIOS_HOSTNAME
-
LM_COMPATIBILITY
public static final int LM_COMPATIBILITY
-
FLAGS_NONE
public static final int FLAGS_NONE
- See Also:
- Constant Field Values
-
FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCK
public static final int FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCK
- See Also:
- Constant Field Values
-
FLAGS_RECEIVE_BUFFER_POSTED
public static final int FLAGS_RECEIVE_BUFFER_POSTED
- See Also:
- Constant Field Values
-
FLAGS_PATH_NAMES_CASELESS
public static final int FLAGS_PATH_NAMES_CASELESS
- See Also:
- Constant Field Values
-
FLAGS_PATH_NAMES_CANONICALIZED
public static final int FLAGS_PATH_NAMES_CANONICALIZED
- See Also:
- Constant Field Values
-
FLAGS_OPLOCK_REQUESTED_OR_GRANTED
public static final int FLAGS_OPLOCK_REQUESTED_OR_GRANTED
- See Also:
- Constant Field Values
-
FLAGS_NOTIFY_OF_MODIFY_ACTION
public static final int FLAGS_NOTIFY_OF_MODIFY_ACTION
- See Also:
- Constant Field Values
-
FLAGS_RESPONSE
public static final int FLAGS_RESPONSE
- See Also:
- Constant Field Values
-
FLAGS2_NONE
public static final int FLAGS2_NONE
- See Also:
- Constant Field Values
-
FLAGS2_LONG_FILENAMES
public static final int FLAGS2_LONG_FILENAMES
- See Also:
- Constant Field Values
-
FLAGS2_EXTENDED_ATTRIBUTES
public static final int FLAGS2_EXTENDED_ATTRIBUTES
- See Also:
- Constant Field Values
-
FLAGS2_SECURITY_SIGNATURES
public static final int FLAGS2_SECURITY_SIGNATURES
- See Also:
- Constant Field Values
-
FLAGS2_EXTENDED_SECURITY_NEGOTIATION
public static final int FLAGS2_EXTENDED_SECURITY_NEGOTIATION
- See Also:
- Constant Field Values
-
FLAGS2_RESOLVE_PATHS_IN_DFS
public static final int FLAGS2_RESOLVE_PATHS_IN_DFS
- See Also:
- Constant Field Values
-
FLAGS2_PERMIT_READ_IF_EXECUTE_PERM
public static final int FLAGS2_PERMIT_READ_IF_EXECUTE_PERM
- See Also:
- Constant Field Values
-
FLAGS2_STATUS32
public static final int FLAGS2_STATUS32
- See Also:
- Constant Field Values
-
FLAGS2_UNICODE
public static final int FLAGS2_UNICODE
- See Also:
- Constant Field Values
-
CAP_NONE
public static final int CAP_NONE
- See Also:
- Constant Field Values
-
CAP_RAW_MODE
public static final int CAP_RAW_MODE
- See Also:
- Constant Field Values
-
CAP_MPX_MODE
public static final int CAP_MPX_MODE
- See Also:
- Constant Field Values
-
CAP_UNICODE
public static final int CAP_UNICODE
- See Also:
- Constant Field Values
-
CAP_LARGE_FILES
public static final int CAP_LARGE_FILES
- See Also:
- Constant Field Values
-
CAP_NT_SMBS
public static final int CAP_NT_SMBS
- See Also:
- Constant Field Values
-
CAP_RPC_REMOTE_APIS
public static final int CAP_RPC_REMOTE_APIS
- See Also:
- Constant Field Values
-
CAP_STATUS32
public static final int CAP_STATUS32
- See Also:
- Constant Field Values
-
CAP_LEVEL_II_OPLOCKS
public static final int CAP_LEVEL_II_OPLOCKS
- See Also:
- Constant Field Values
-
CAP_LOCK_AND_READ
public static final int CAP_LOCK_AND_READ
- See Also:
- Constant Field Values
-
CAP_NT_FIND
public static final int CAP_NT_FIND
- See Also:
- Constant Field Values
-
CAP_DFS
public static final int CAP_DFS
- See Also:
- Constant Field Values
-
CAP_EXTENDED_SECURITY
public static final int CAP_EXTENDED_SECURITY
- See Also:
- Constant Field Values
-
FILE_READ_DATA
public static final int FILE_READ_DATA
- See Also:
- Constant Field Values
-
FILE_WRITE_DATA
public static final int FILE_WRITE_DATA
- See Also:
- Constant Field Values
-
FILE_APPEND_DATA
public static final int FILE_APPEND_DATA
- See Also:
- Constant Field Values
-
FILE_READ_EA
public static final int FILE_READ_EA
- See Also:
- Constant Field Values
-
FILE_WRITE_EA
public static final int FILE_WRITE_EA
- See Also:
- Constant Field Values
-
FILE_EXECUTE
public static final int FILE_EXECUTE
- See Also:
- Constant Field Values
-
FILE_DELETE
public static final int FILE_DELETE
- See Also:
- Constant Field Values
-
FILE_READ_ATTRIBUTES
public static final int FILE_READ_ATTRIBUTES
- See Also:
- Constant Field Values
-
FILE_WRITE_ATTRIBUTES
public static final int FILE_WRITE_ATTRIBUTES
- See Also:
- Constant Field Values
-
DELETE
public static final int DELETE
- See Also:
- Constant Field Values
-
READ_CONTROL
public static final int READ_CONTROL
- See Also:
- Constant Field Values
-
WRITE_DAC
public static final int WRITE_DAC
- See Also:
- Constant Field Values
-
WRITE_OWNER
public static final int WRITE_OWNER
- See Also:
- Constant Field Values
-
SYNCHRONIZE
public static final int SYNCHRONIZE
- See Also:
- Constant Field Values
-
GENERIC_ALL
public static final int GENERIC_ALL
- See Also:
- Constant Field Values
-
GENERIC_EXECUTE
public static final int GENERIC_EXECUTE
- See Also:
- Constant Field Values
-
GENERIC_WRITE
public static final int GENERIC_WRITE
- See Also:
- Constant Field Values
-
GENERIC_READ
public static final int GENERIC_READ
- See Also:
- Constant Field Values
-
FLAGS_TARGET_MUST_BE_FILE
public static final int FLAGS_TARGET_MUST_BE_FILE
- See Also:
- Constant Field Values
-
FLAGS_TARGET_MUST_BE_DIRECTORY
public static final int FLAGS_TARGET_MUST_BE_DIRECTORY
- See Also:
- Constant Field Values
-
FLAGS_COPY_TARGET_MODE_ASCII
public static final int FLAGS_COPY_TARGET_MODE_ASCII
- See Also:
- Constant Field Values
-
FLAGS_COPY_SOURCE_MODE_ASCII
public static final int FLAGS_COPY_SOURCE_MODE_ASCII
- See Also:
- Constant Field Values
-
FLAGS_VERIFY_ALL_WRITES
public static final int FLAGS_VERIFY_ALL_WRITES
- See Also:
- Constant Field Values
-
FLAGS_TREE_COPY
public static final int FLAGS_TREE_COPY
- See Also:
- Constant Field Values
-
OPEN_FUNCTION_FAIL_IF_EXISTS
public static final int OPEN_FUNCTION_FAIL_IF_EXISTS
- See Also:
- Constant Field Values
-
OPEN_FUNCTION_OVERWRITE_IF_EXISTS
public static final int OPEN_FUNCTION_OVERWRITE_IF_EXISTS
- See Also:
- Constant Field Values
-
PID
public static final int PID
-
SECURITY_SHARE
public static final int SECURITY_SHARE
- See Also:
- Constant Field Values
-
SECURITY_USER
public static final int SECURITY_USER
- See Also:
- Constant Field Values
-
CMD_OFFSET
public static final int CMD_OFFSET
- See Also:
- Constant Field Values
-
ERROR_CODE_OFFSET
public static final int ERROR_CODE_OFFSET
- See Also:
- Constant Field Values
-
FLAGS_OFFSET
public static final int FLAGS_OFFSET
- See Also:
- Constant Field Values
-
SIGNATURE_OFFSET
public static final int SIGNATURE_OFFSET
- See Also:
- Constant Field Values
-
TID_OFFSET
public static final int TID_OFFSET
- See Also:
- Constant Field Values
-
HEADER_LENGTH
public static final int HEADER_LENGTH
- See Also:
- Constant Field Values
-
MILLISECONDS_BETWEEN_1970_AND_1601
public static final long MILLISECONDS_BETWEEN_1970_AND_1601
- See Also:
- Constant Field Values
-
TZ
public static final java.util.TimeZone TZ
-
USE_BATCHING
public static final boolean USE_BATCHING
-
OEM_ENCODING
public static final java.lang.String OEM_ENCODING
-
UNI_ENCODING
public static final java.lang.String UNI_ENCODING
- See Also:
- Constant Field Values
-
DEFAULT_FLAGS2
public static final int DEFAULT_FLAGS2
-
DEFAULT_CAPABILITIES
public static final int DEFAULT_CAPABILITIES
-
FLAGS2
public static final int FLAGS2
-
CAPABILITIES
public static final int CAPABILITIES
-
TCP_NODELAY
public static final boolean TCP_NODELAY
-
RESPONSE_TIMEOUT
public static final int RESPONSE_TIMEOUT
-
CONNECTIONS
public static final java.util.LinkedList CONNECTIONS
-
SSN_LIMIT
public static final int SSN_LIMIT
-
SO_TIMEOUT
public static final int SO_TIMEOUT
-
CONN_TIMEOUT
public static final int CONN_TIMEOUT
-
NATIVE_OS
public static final java.lang.String NATIVE_OS
-
NATIVE_LANMAN
public static final java.lang.String NATIVE_LANMAN
-
VC_NUMBER
public static final int VC_NUMBER
- See Also:
- Constant Field Values
-
NULL_TRANSPORT
public static final jcifs.smb.SmbTransport NULL_TRANSPORT
-
-
Constructor Detail
-
SmbNamedPipe
public SmbNamedPipe(java.lang.String url, int pipeType) throws java.net.MalformedURLException, java.net.UnknownHostExceptionOpen the Named Pipe resource specified by the url parameter. The pipeType parameter should be at least one of thePIPE_TYPEflags combined with the bitwise OR operator|. See the examples listed above.- Throws:
java.net.MalformedURLExceptionjava.net.UnknownHostException
-
SmbNamedPipe
public SmbNamedPipe(java.lang.String url, int pipeType, NtlmPasswordAuthentication auth) throws java.net.MalformedURLException, java.net.UnknownHostException- Throws:
java.net.MalformedURLExceptionjava.net.UnknownHostException
-
SmbNamedPipe
public SmbNamedPipe(java.net.URL url, int pipeType, NtlmPasswordAuthentication auth) throws java.net.MalformedURLException, java.net.UnknownHostException- Throws:
java.net.MalformedURLExceptionjava.net.UnknownHostException
-
-
Method Detail
-
getNamedPipeInputStream
public java.io.InputStream getNamedPipeInputStream() throws java.io.IOExceptionReturn theInputStreamused to read information from this pipe instance. Presumably data would first be written to theOutputStreamassociated with this Named Pipe instance although this is not a requirement (e.g. a read-only named pipe would write data to this stream on connection). Reading from this stream may block. Therefore it may be necessary that an addition thread be used to read and write to a Named Pipe.- Throws:
java.io.IOException
-
getNamedPipeOutputStream
public java.io.OutputStream getNamedPipeOutputStream() throws java.io.IOExceptionReturn theOutputStreamused to write information to this pipe instance. The act of writing data to this stream will result in response data recieved in theInputStreamassociated with this Named Pipe instance (unless of course it does not elicite a response or the pipe is write-only).- Throws:
java.io.IOException
-
-