Package jcifs.smb
Class SmbNamedPipe
java.lang.Object
java.net.URLConnection
jcifs.smb.SmbFile
jcifs.smb.SmbNamedPipe
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:
-
CallNamedPipe
A message-type pipe call that opens, writes to, reads from, and closes the pipe in a single operation. -
TransactNamedPipe
A message-type pipe call that writes to and reads from an existing pipe descriptor in one operation. -
CreateFile
,ReadFile
,WriteFile
, andCloseFile
A 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
XxxputStream
interface. A special PIPE_TYPE
flags is necessary to distinguish which type of Named Pipe behavior
is desired.
SmbNamedPipe Constructor Examples |
|
Code 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 CallNamedPipe interface.
|
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 TransactNamedPipe interface.
|
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 , and CloseFile interface 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
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final LinkedList
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final boolean
static final int
static final int
static final int
static final int
static final int
static final InetAddress
static final int
static final int
static final int
static final long
static final String
static final String
static final String
static final jcifs.smb.SmbTransport
static final String
static final int
static final int
static final int
static final int
Pipe operations should behave like theCallNamedPipe
Win32 Named Pipe function.static final int
static final int
The pipe should be opened read-only.static final int
The pipe should be opened for both reading and writing.static final int
Pipe operations should behave like theTransactNamedPipe
Win32 Named Pipe function.static final int
The pipe should be opened only for writing.static final int
static final int
static final int
static final int
static final int
static final int
static final boolean
static final int
static final int
static final int
static final int
static final boolean
static final int
static final TimeZone
static final String
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final int
static final int
static final int
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
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-
Constructor Summary
ConstructorsConstructorDescriptionSmbNamedPipe
(String url, int pipeType) Open the Named Pipe resource specified by the url parameter.SmbNamedPipe
(String url, int pipeType, NtlmPasswordAuthentication auth) SmbNamedPipe
(URL url, int pipeType, NtlmPasswordAuthentication auth) -
Method Summary
Modifier and TypeMethodDescriptionReturn theInputStream
used to read information from this pipe instance.Return theOutputStream
used 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 Details
-
PIPE_TYPE_RDONLY
public static final int PIPE_TYPE_RDONLYThe pipe should be opened read-only.- See Also:
-
PIPE_TYPE_WRONLY
public static final int PIPE_TYPE_WRONLYThe pipe should be opened only for writing.- See Also:
-
PIPE_TYPE_RDWR
public static final int PIPE_TYPE_RDWRThe pipe should be opened for both reading and writing.- See Also:
-
PIPE_TYPE_CALL
public static final int PIPE_TYPE_CALLPipe operations should behave like theCallNamedPipe
Win32 Named Pipe function.- See Also:
-
PIPE_TYPE_TRANSACT
public static final int PIPE_TYPE_TRANSACTPipe operations should behave like theTransactNamedPipe
Win32 Named Pipe function.- See Also:
-
PIPE_TYPE_DCE_TRANSACT
public static final int PIPE_TYPE_DCE_TRANSACT- See Also:
-
DEFAULT_PORT
static final int DEFAULT_PORT- See Also:
-
DEFAULT_MAX_MPX_COUNT
static final int DEFAULT_MAX_MPX_COUNT- See Also:
-
DEFAULT_RESPONSE_TIMEOUT
static final int DEFAULT_RESPONSE_TIMEOUT- See Also:
-
DEFAULT_SO_TIMEOUT
static final int DEFAULT_SO_TIMEOUT- See Also:
-
DEFAULT_RCV_BUF_SIZE
static final int DEFAULT_RCV_BUF_SIZE- See Also:
-
DEFAULT_SND_BUF_SIZE
static final int DEFAULT_SND_BUF_SIZE- See Also:
-
DEFAULT_SSN_LIMIT
static final int DEFAULT_SSN_LIMIT- See Also:
-
DEFAULT_CONN_TIMEOUT
static final int DEFAULT_CONN_TIMEOUT- See Also:
-
LADDR
-
LPORT
static final int LPORT -
MAX_MPX_COUNT
static final int MAX_MPX_COUNT -
SND_BUF_SIZE
static final int SND_BUF_SIZE -
RCV_BUF_SIZE
static final int RCV_BUF_SIZE -
USE_UNICODE
static final boolean USE_UNICODE -
FORCE_UNICODE
static final boolean FORCE_UNICODE -
USE_NTSTATUS
static final boolean USE_NTSTATUS -
SIGNPREF
static final boolean SIGNPREF -
USE_NTSMBS
static final boolean USE_NTSMBS -
USE_EXTSEC
static final boolean USE_EXTSEC -
NETBIOS_HOSTNAME
-
LM_COMPATIBILITY
static final int LM_COMPATIBILITY -
FLAGS_NONE
static final int FLAGS_NONE- See Also:
-
FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCK
static final int FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCK- See Also:
-
FLAGS_RECEIVE_BUFFER_POSTED
static final int FLAGS_RECEIVE_BUFFER_POSTED- See Also:
-
FLAGS_PATH_NAMES_CASELESS
static final int FLAGS_PATH_NAMES_CASELESS- See Also:
-
FLAGS_PATH_NAMES_CANONICALIZED
static final int FLAGS_PATH_NAMES_CANONICALIZED- See Also:
-
FLAGS_OPLOCK_REQUESTED_OR_GRANTED
static final int FLAGS_OPLOCK_REQUESTED_OR_GRANTED- See Also:
-
FLAGS_NOTIFY_OF_MODIFY_ACTION
static final int FLAGS_NOTIFY_OF_MODIFY_ACTION- See Also:
-
FLAGS_RESPONSE
static final int FLAGS_RESPONSE- See Also:
-
FLAGS2_NONE
static final int FLAGS2_NONE- See Also:
-
FLAGS2_LONG_FILENAMES
static final int FLAGS2_LONG_FILENAMES- See Also:
-
FLAGS2_EXTENDED_ATTRIBUTES
static final int FLAGS2_EXTENDED_ATTRIBUTES- See Also:
-
FLAGS2_SECURITY_SIGNATURES
static final int FLAGS2_SECURITY_SIGNATURES- See Also:
-
FLAGS2_EXTENDED_SECURITY_NEGOTIATION
static final int FLAGS2_EXTENDED_SECURITY_NEGOTIATION- See Also:
-
FLAGS2_RESOLVE_PATHS_IN_DFS
static final int FLAGS2_RESOLVE_PATHS_IN_DFS- See Also:
-
FLAGS2_PERMIT_READ_IF_EXECUTE_PERM
static final int FLAGS2_PERMIT_READ_IF_EXECUTE_PERM- See Also:
-
FLAGS2_STATUS32
static final int FLAGS2_STATUS32- See Also:
-
FLAGS2_UNICODE
static final int FLAGS2_UNICODE- See Also:
-
CAP_NONE
static final int CAP_NONE- See Also:
-
CAP_RAW_MODE
static final int CAP_RAW_MODE- See Also:
-
CAP_MPX_MODE
static final int CAP_MPX_MODE- See Also:
-
CAP_UNICODE
static final int CAP_UNICODE- See Also:
-
CAP_LARGE_FILES
static final int CAP_LARGE_FILES- See Also:
-
CAP_NT_SMBS
static final int CAP_NT_SMBS- See Also:
-
CAP_RPC_REMOTE_APIS
static final int CAP_RPC_REMOTE_APIS- See Also:
-
CAP_STATUS32
static final int CAP_STATUS32- See Also:
-
CAP_LEVEL_II_OPLOCKS
static final int CAP_LEVEL_II_OPLOCKS- See Also:
-
CAP_LOCK_AND_READ
static final int CAP_LOCK_AND_READ- See Also:
-
CAP_NT_FIND
static final int CAP_NT_FIND- See Also:
-
CAP_DFS
static final int CAP_DFS- See Also:
-
CAP_EXTENDED_SECURITY
static final int CAP_EXTENDED_SECURITY- See Also:
-
FILE_READ_DATA
static final int FILE_READ_DATA- See Also:
-
FILE_WRITE_DATA
static final int FILE_WRITE_DATA- See Also:
-
FILE_APPEND_DATA
static final int FILE_APPEND_DATA- See Also:
-
FILE_READ_EA
static final int FILE_READ_EA- See Also:
-
FILE_WRITE_EA
static final int FILE_WRITE_EA- See Also:
-
FILE_EXECUTE
static final int FILE_EXECUTE- See Also:
-
FILE_DELETE
static final int FILE_DELETE- See Also:
-
FILE_READ_ATTRIBUTES
static final int FILE_READ_ATTRIBUTES- See Also:
-
FILE_WRITE_ATTRIBUTES
static final int FILE_WRITE_ATTRIBUTES- See Also:
-
DELETE
static final int DELETE- See Also:
-
READ_CONTROL
static final int READ_CONTROL- See Also:
-
WRITE_DAC
static final int WRITE_DAC- See Also:
-
WRITE_OWNER
static final int WRITE_OWNER- See Also:
-
SYNCHRONIZE
static final int SYNCHRONIZE- See Also:
-
GENERIC_ALL
static final int GENERIC_ALL- See Also:
-
GENERIC_EXECUTE
static final int GENERIC_EXECUTE- See Also:
-
GENERIC_WRITE
static final int GENERIC_WRITE- See Also:
-
GENERIC_READ
static final int GENERIC_READ- See Also:
-
FLAGS_TARGET_MUST_BE_FILE
static final int FLAGS_TARGET_MUST_BE_FILE- See Also:
-
FLAGS_TARGET_MUST_BE_DIRECTORY
static final int FLAGS_TARGET_MUST_BE_DIRECTORY- See Also:
-
FLAGS_COPY_TARGET_MODE_ASCII
static final int FLAGS_COPY_TARGET_MODE_ASCII- See Also:
-
FLAGS_COPY_SOURCE_MODE_ASCII
static final int FLAGS_COPY_SOURCE_MODE_ASCII- See Also:
-
FLAGS_VERIFY_ALL_WRITES
static final int FLAGS_VERIFY_ALL_WRITES- See Also:
-
FLAGS_TREE_COPY
static final int FLAGS_TREE_COPY- See Also:
-
OPEN_FUNCTION_FAIL_IF_EXISTS
static final int OPEN_FUNCTION_FAIL_IF_EXISTS- See Also:
-
OPEN_FUNCTION_OVERWRITE_IF_EXISTS
static final int OPEN_FUNCTION_OVERWRITE_IF_EXISTS- See Also:
-
PID
static final int PID -
SECURITY_SHARE
static final int SECURITY_SHARE- See Also:
-
SECURITY_USER
static final int SECURITY_USER- See Also:
-
CMD_OFFSET
static final int CMD_OFFSET- See Also:
-
ERROR_CODE_OFFSET
static final int ERROR_CODE_OFFSET- See Also:
-
FLAGS_OFFSET
static final int FLAGS_OFFSET- See Also:
-
SIGNATURE_OFFSET
static final int SIGNATURE_OFFSET- See Also:
-
TID_OFFSET
static final int TID_OFFSET- See Also:
-
HEADER_LENGTH
static final int HEADER_LENGTH- See Also:
-
MILLISECONDS_BETWEEN_1970_AND_1601
static final long MILLISECONDS_BETWEEN_1970_AND_1601- See Also:
-
TZ
-
USE_BATCHING
static final boolean USE_BATCHING -
OEM_ENCODING
-
UNI_ENCODING
- See Also:
-
DEFAULT_FLAGS2
static final int DEFAULT_FLAGS2 -
DEFAULT_CAPABILITIES
static final int DEFAULT_CAPABILITIES -
FLAGS2
static final int FLAGS2 -
CAPABILITIES
static final int CAPABILITIES -
TCP_NODELAY
static final boolean TCP_NODELAY -
RESPONSE_TIMEOUT
static final int RESPONSE_TIMEOUT -
CONNECTIONS
-
SSN_LIMIT
static final int SSN_LIMIT -
SO_TIMEOUT
static final int SO_TIMEOUT -
CONN_TIMEOUT
static final int CONN_TIMEOUT -
NATIVE_OS
-
NATIVE_LANMAN
-
VC_NUMBER
static final int VC_NUMBER- See Also:
-
NULL_TRANSPORT
static final jcifs.smb.SmbTransport NULL_TRANSPORT
-
-
Constructor Details
-
SmbNamedPipe
Open the Named Pipe resource specified by the url parameter. The pipeType parameter should be at least one of thePIPE_TYPE
flags combined with the bitwise OR operator|
. See the examples listed above. -
SmbNamedPipe
public SmbNamedPipe(String url, int pipeType, NtlmPasswordAuthentication auth) throws MalformedURLException, UnknownHostException -
SmbNamedPipe
public SmbNamedPipe(URL url, int pipeType, NtlmPasswordAuthentication auth) throws MalformedURLException, UnknownHostException
-
-
Method Details
-
getNamedPipeInputStream
Return theInputStream
used to read information from this pipe instance. Presumably data would first be written to theOutputStream
associated 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:
IOException
-
getNamedPipeOutputStream
Return theOutputStream
used to write information to this pipe instance. The act of writing data to this stream will result in response data recieved in theInputStream
associated with this Named Pipe instance (unless of course it does not elicite a response or the pipe is write-only).- Throws:
IOException
-