- Direct Known Subclasses:
SmbNamedPipe
SmbFile
may also refer to servers and workgroups. If the resource is a file or
directory the methods of SmbFile follow the behavior of
the well known File class. One fundamental difference
is the usage of a URL scheme [1] to specify the target file or
directory. SmbFile URLs have the following syntax:
smb1://[[[domain;]username[:password]@]server[:port]/[[share/[dir/]file]]][?param=value[param2=value2[...]]]
This example:
smb1://storage15/public/foo.txt
would reference the file foo.txt in the share
public on the server storage15. In addition
to referencing files and directories, jCIFS can also address servers,
and workgroups.
Important: all SMB URLs that represent workgroups, servers, shares, or directories require a trailing slash '/'.
When using the java.net.URL class with
'smb1://' URLs it is necessary to first call the static
org.codelibs.jcifs.smb1.Config.registerSmbURLHandler(); method. This is required
to register the SMB protocol handler.
The userinfo component of the SMB URL (domain;user:pass) must
be URL encoded if it contains reserved characters. According to RFC 2396
these characters are non US-ASCII characters and most meta characters
however jCIFS will work correctly with anything but '@' which is used
to delimit the userinfo component from the server and '%' which is the
URL escape character itself.
The server component may a traditional NetBIOS name, a DNS name, or IP address. These name resolution mechanisms and their resolution order can be changed (See Setting Name Resolution Properties). The servername and path components are not case sensitive but the domain, username, and password components are. It is also likely that properties must be specified for org.codelibs.jcifs.smb1 to function (See Setting JCIFS Properties). Here are some examples of SMB URLs with brief descriptions of what they do:
[1] This URL scheme is based largely on the SMB Filesharing URL Scheme IETF draft.
| SMB URL Examples | |
| URL | Description |
smb1://users-nyc;miallen:mypass@angus/tmp/ |
This URL references a share called tmp on the server
angus as user miallen who's password is
mypass.
|
smb1://Administrator:P%40ss@msmith1/c/WINDOWS/Desktop/foo.txt |
A relativly sophisticated example that references a file
msmith1's desktop as user Administrator. Notice the '@' is URL encoded with the '%40' hexcode escape.
|
smb1://angus/ |
This references only a server. The behavior of some methods is different
in this context(e.g. you cannot delete a server) however
as you might expect the list method will list the available
shares on this server.
|
smb1://myworkgroup/ |
This syntactically is identical to the above example. However if
myworkgroup happends to be a workgroup(which is indeed
suggested by the name) the list method will return
a list of servers that have registered themselves as members of
myworkgroup.
|
smb1:// |
Just as smb1://server/ lists shares and
smb1://workgroup/ lists servers, the smb1://
URL lists all available workgroups on a netbios LAN. Again,
in this context many methods are not valid and return default
values(e.g. isHidden will always return false).
|
smb1://angus.foo.net/d/org.codelibs.jcifs.smb/smb1/pipes.doc | The server name may also be a DNS name as it is in this example. See Setting Name Resolution Properties for details. |
smb1://192.168.1.15/ADMIN$/ | The server name may also be an IP address. See Setting Name Resolution Properties for details. |
smb1://domain;username:password@server/share/path/to/file.txt | A prototypical example that uses all the fields. |
smb1://myworkgroup/angus/ <-- ILLEGAL | Despite the hierarchial relationship between workgroups, servers, and filesystems this example is not valid. |
smb1://server/share/path/to/dir <-- ILLEGAL | URLs that represent workgroups, servers, shares, or directories require a trailing slash '/'. |
smb1://MYGROUP/?SERVER=192.168.10.15 |
SMB URLs support some query string parameters. In this example
the SERVER parameter is used to override the
server name service lookup to contact the server 192.168.10.15
(presumably known to be a master
browser) for the server list in workgroup MYGROUP.
|
A second constructor argument may be specified to augment the URL
for better programmatic control when processing many files under
a common base. This is slightly different from the corresponding
java.io.File usage; a '/' at the beginning of the second
parameter will still use the server component of the first parameter. The
examples below illustrate the resulting URLs when this second contructor
argument is used.
| Examples Of SMB URLs When Augmented With A Second Constructor Parameter | ||
| First Parameter | Second Parameter | Result |
smb1://host/share/a/b/
|
c/d/
|
smb1://host/share/a/b/c/d/
|
smb1://host/share/foo/bar/
|
/share2/zig/zag
|
smb1://host/share2/zig/zag
|
smb1://host/share/foo/bar/
|
../zip/
|
smb1://host/share/foo/zip/
|
smb1://host/share/zig/zag
|
smb1://foo/bar/
|
smb1://foo/bar/
|
smb1://host/share/foo/
|
../.././.././../foo/
|
smb1://host/foo/
|
smb1://host/share/zig/zag
|
/
|
smb1://host/
|
smb1://server/
|
../
|
smb1://server/
|
smb1://
|
myworkgroup/
|
smb1://myworkgroup/
|
smb1://myworkgroup/
|
angus/
|
smb1://myworkgroup/angus/ <-- ILLEGAL |
Instances of the SmbFile class are immutable; that is,
once created, the abstract pathname represented by an SmbFile object
will never change.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA file with this bit on as returned bygetAttributes()or set withsetAttributes()is an archived filestatic final intA file with this bit on as returned bygetAttributes()is a directorystatic final intA file with this bit on as returned bygetAttributes()or set withsetAttributes()will be hiddenstatic final intA file with this bit on as returned bygetAttributes()or set withsetAttributes()will be read-onlystatic final intA file with this bit on as returned bygetAttributes()or set withsetAttributes()will be a system filestatic final intA file with this bit on as returned bygetAttributes()is a volumestatic final intDFS capabilitystatic final intExtended security capabilitystatic final intLarge files capabilitystatic final intLevel II oplocks capabilitystatic final intLock and read capabilitystatic final intMPX mode capabilitystatic final intNo capabilitiesstatic final intNT find capabilitystatic final intNT SMBs capabilitystatic final intRaw mode capabilitystatic final intRPC remote APIs capabilitystatic final int32-bit status codes capabilitystatic final intUnicode capabilitystatic final intCapabilities valuestatic final intCommand offset in SMB headerstatic final intConnection timeout in millisecondsstatic final LinkedListList of active connectionsstatic final intDefault capabilitiesstatic final intDefault connection timeout in millisecondsstatic final intDefault FLAGS2 valuestatic final intDefault maximum multiplex countstatic final intDefault SMB port numberstatic final intDefault receive buffer size in bytesstatic final intDefault response timeout in millisecondsstatic final intDefault send buffer size in bytesstatic final intDefault socket timeout in millisecondsstatic final intDefault session limitstatic final intDelete access rightprotected static DfsDFS resolver instancestatic final intError code offset in SMB headerstatic final intFile append data access rightstatic final intFile delete child access rightstatic final intFile execute access rightstatic final intWhen specified as theshareAccessconstructor parameter, other SMB clients (including other threads making calls into jCIFS) will not be permitted to access the target file and will receive "The file is being accessed by another process" message.static final intFile read attributes access rightstatic final intFile read data access rightstatic final intFile read extended attributes access rightstatic final intWhen specified as theshareAccessconstructor parameter, other SMB clients will be permitted to delete the target file while this file is open.static final intWhen specified as theshareAccessconstructor parameter, other SMB clients will be permitted to read from the target file while this file is open.static final intWhen specified as theshareAccessconstructor parameter, other SMB clients will be permitted to write to the target file while this file is open.static final intFile write attributes access rightstatic final intFile write data access rightstatic final intFile write extended attributes access rightstatic final intCopy source mode ASCII flagstatic final intCopy target mode ASCII flagstatic final intLock and read write and unlock flagstatic final intNo flags setstatic final intNotify of modify action flagstatic final intFlags offset in SMB headerstatic final intOplock requested or granted flagstatic final intPath names canonicalized flagstatic final intPath names are caseless flagstatic final intReceive buffer posted flagstatic final intResponse flagstatic final intTarget must be directory flagstatic final intTarget must be file flagstatic final intTree copy flagstatic final intVerify all writes flagstatic final intFLAGS2 valuestatic final intExtended attributes supported flagstatic final intExtended security negotiation flagstatic final intLong filenames supported flagstatic final intNo flags2 setstatic final intPermit read if execute permission flagstatic final intResolve paths in DFS flagstatic final intSecurity signatures supported flagstatic final int32-bit status codes flagstatic final intUnicode strings flagstatic final booleanWhether to force Unicode usagestatic final intGeneric all access rightstatic final intGeneric execute access rightstatic final intGeneric read access rightstatic final intGeneric write access rightstatic final intSMB header lengthstatic final InetAddressLocal address to bind tostatic final intLM compatibility levelstatic final intLocal port to bind tostatic final intMaximum multiplex countstatic final longMilliseconds between 1970 and 1601static final StringNative LAN manager namestatic final StringNative operating system namestatic final StringNetBIOS hostnamestatic final SmbTransportNull transport instancestatic final StringOEM encodingstatic final intOpen function fail if existsstatic final intOpen function overwrite if existsstatic final intProcess IDstatic final intReceive buffer size in bytesstatic final intRead control access rightstatic final intResponse timeout in millisecondsstatic final intShare level securitystatic final intUser level securitystatic final intSignature offset in SMB headerstatic final booleanWhether signing is preferredstatic final intSend buffer size in bytesstatic final intSocket timeout in millisecondsstatic final intSession limitstatic final intSynchronize access rightstatic final booleanWhether to use TCP_NODELAYstatic final intTID offset in SMB headerstatic final intReturned bygetType()if the resource thisSmbFilerepresents is a communications device.static final intReturned bygetType()if the resource thisSmbFilerepresents is a regular file or directory.static final intReturned bygetType()if the resource thisSmbFilerepresents is a named pipe.static final intReturned bygetType()if the resource thisSmbFilerepresents is a printer.static final intReturned bygetType()if the resource thisSmbFilerepresents is a server.static final intReturned bygetType()if the resource thisSmbFilerepresents is a share.static final intReturned bygetType()if the resource thisSmbFilerepresents is a workgroup.static final TimeZoneDefault timezonestatic final StringUnicode encodingstatic final booleanWhether to use batchingstatic final booleanWhether to use extended securitystatic final booleanWhether to use NT SMBsstatic final booleanWhether to use NT status codesstatic final booleanWhether to use Unicode stringsstatic final intVirtual circuit numberstatic final intWrite DAC access rightstatic final intWrite owner access rightFields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an SmbFile representing a resource on an SMB network such as a file or directory.Constructs an SmbFile representing a resource on an SMB network such as a file or directory.SmbFile(String context, String name, NtlmPasswordAuthentication auth) Constructs an SmbFile representing a resource on an SMB network such as a file or directory.SmbFile(String context, String name, NtlmPasswordAuthentication auth, int shareAccess) Constructs an SmbFile representing a resource on an SMB network such as a file or directory.SmbFile(String url, NtlmPasswordAuthentication auth) Constructs an SmbFile representing a resource on an SMB network such as a file or directory.SmbFile(String url, NtlmPasswordAuthentication auth, int shareAccess) Constructs an SmbFile representing a file on an SMB network.Constructs an SmbFile representing a resource on an SMB network such as a file or directory from aURLobject.SmbFile(URL url, NtlmPasswordAuthentication auth) Constructs an SmbFile representing a resource on an SMB network such as a file or directory from aURLobject and anNtlmPasswordAuthenticationobject.Constructs an SmbFile representing a resource on an SMB network such as a file or directory.Constructs an SmbFile representing a resource on an SMB network such as a file or directory. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRead()Tests to see if the file thisSmbFilerepresents can be read.booleancanWrite()Tests to see if the file thisSmbFilerepresents exists and is not marked read-only.voidconnect()It is not necessary to call this method directly.voidThis method will copy the file or directory represented by thisSmbFileand it's sub-contents to the location specified by thedestparameter.voidCreate a new file but fail if it already exists.longRetrieve the time thisSmbFilewas created.voiddelete()This method will delete the file or directory specified by thisSmbFile.booleanTests to see if twoSmbFileobjects are equal.booleanexists()Tests to see if the SMB resource exists.intReturn the attributes of this file.Returns the full URL of this SMB resource with '.' and '..' components factored out.intThis URLConnection method just returns the result oflength().longgetDate()This URLConnection method just returns the result oflastModified.Returns the DFS path for this file if it resides in a DFS sharelongThis method returns the free disk space in bytes of the drive this share represents or the drive on which the directory or file resides.This URLConnection method just returns a newSmbFileInputStreamcreated with this file.longThis URLConnection method just returns the result oflastModified.getName()Returns the last component of the target URL.This URLConnection method just returns a newSmbFileOutputStreamcreated with this file.Returns the owner group SID for this fileReturns the owner user SID for this fileEverything but the last component of the URL representing this SMB resource is effectivly it's parent.getPath()Returns the full uncanonicalized URL of this SMB resource.Returns the principal used for authenticationACE[]Returns the security information for this fileACE[]getSecurity(boolean resolveSids) Return an array of Access Control Entry (ACE) objects representing the security descriptor associated with this file or directory.Retrieve the hostname of the server for this SMB resource.getShare()Retrieves the share associated with this SMB resource.ACE[]getShareSecurity(boolean resolveSids) Returns the share security information for this shareintgetType()Returns type of of object thisSmbFilerepresents.Retuns the Windows UNC style path with backslashs intead of forward slashes.inthashCode()Computes a hashCode for this file based on the URL string and IP address if the server.booleanTests to see if the file thisSmbFilerepresents is a directory.booleanisFile()Tests to see if the file thisSmbFilerepresents is not a directory.booleanisHidden()Tests to see if the file this SmbFile represents is marked as hidden.longRetrieve the last time the file represented by thisSmbFilewas modified.longlength()Returns the length of thisSmbFilein bytes.String[]list()List the contents of this SMB resource.String[]list(SmbFilenameFilter filter) List the contents of this SMB resource.SmbFile[]List the contents of this SMB resource as an array ofSmbFileobjects.SmbFile[]The CIFS protocol provides for DOS "wildcards" to be used as a performance enhancement.SmbFile[]listFiles(SmbFileFilter filter) List the contents of this SMB resource.SmbFile[]listFiles(SmbFilenameFilter filter) List the contents of this SMB resource.voidmkdir()Creates a directory with the path specified by thisSmbFile.voidmkdirs()Creates a directory with the path specified by thisSmbFileand any parent directories that do not exist.protected booleanpathNamesPossiblyEqual(String path1, String path2) Checks if two path names could possibly be equalvoidChanges the name of the file thisSmbFilerepresents to the name designated by theSmbFileargument.voidsetAttributes(int attrs) Set the attributes of this file.voidsetCreateTime(long time) Set the create time of the file.voidsetLastModified(long time) Set the last modified time of the file.voidMake this file read-only.voidTurn off the read-only attribute of this file.toString()Returns the string representation of this SmbFile object.toURL()Deprecated.Use getURL() insteadMethods 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
-
FILE_NO_SHARE
public static final int FILE_NO_SHAREWhen specified as theshareAccessconstructor parameter, other SMB clients (including other threads making calls into jCIFS) will not be permitted to access the target file and will receive "The file is being accessed by another process" message.- See Also:
-
FILE_SHARE_READ
public static final int FILE_SHARE_READWhen specified as theshareAccessconstructor parameter, other SMB clients will be permitted to read from the target file while this file is open. This constant may be logically OR'd with other share access flags.- See Also:
-
FILE_SHARE_WRITE
public static final int FILE_SHARE_WRITEWhen specified as theshareAccessconstructor parameter, other SMB clients will be permitted to write to the target file while this file is open. This constant may be logically OR'd with other share access flags.- See Also:
-
FILE_SHARE_DELETE
public static final int FILE_SHARE_DELETEWhen specified as theshareAccessconstructor parameter, other SMB clients will be permitted to delete the target file while this file is open. This constant may be logically OR'd with other share access flags.- See Also:
-
ATTR_READONLY
public static final int ATTR_READONLYA file with this bit on as returned bygetAttributes()or set withsetAttributes()will be read-only- See Also:
-
ATTR_HIDDEN
public static final int ATTR_HIDDENA file with this bit on as returned bygetAttributes()or set withsetAttributes()will be hidden- See Also:
-
ATTR_SYSTEM
public static final int ATTR_SYSTEMA file with this bit on as returned bygetAttributes()or set withsetAttributes()will be a system file- See Also:
-
ATTR_VOLUME
public static final int ATTR_VOLUMEA file with this bit on as returned bygetAttributes()is a volume- See Also:
-
ATTR_DIRECTORY
public static final int ATTR_DIRECTORYA file with this bit on as returned bygetAttributes()is a directory- See Also:
-
ATTR_ARCHIVE
public static final int ATTR_ARCHIVEA file with this bit on as returned bygetAttributes()or set withsetAttributes()is an archived file- See Also:
-
TYPE_FILESYSTEM
public static final int TYPE_FILESYSTEMReturned bygetType()if the resource thisSmbFilerepresents is a regular file or directory.- See Also:
-
TYPE_WORKGROUP
public static final int TYPE_WORKGROUPReturned bygetType()if the resource thisSmbFilerepresents is a workgroup.- See Also:
-
TYPE_SERVER
public static final int TYPE_SERVERReturned bygetType()if the resource thisSmbFilerepresents is a server.- See Also:
-
TYPE_SHARE
public static final int TYPE_SHAREReturned bygetType()if the resource thisSmbFilerepresents is a share.- See Also:
-
TYPE_NAMED_PIPE
public static final int TYPE_NAMED_PIPEReturned bygetType()if the resource thisSmbFilerepresents is a named pipe.- See Also:
-
TYPE_PRINTER
public static final int TYPE_PRINTERReturned bygetType()if the resource thisSmbFilerepresents is a printer.- See Also:
-
TYPE_COMM
public static final int TYPE_COMMReturned bygetType()if the resource thisSmbFilerepresents is a communications device.- See Also:
-
dfs
DFS resolver instance -
DEFAULT_PORT
static final int DEFAULT_PORTDefault SMB port number- See Also:
-
DEFAULT_MAX_MPX_COUNT
static final int DEFAULT_MAX_MPX_COUNTDefault maximum multiplex count- See Also:
-
DEFAULT_RESPONSE_TIMEOUT
static final int DEFAULT_RESPONSE_TIMEOUTDefault response timeout in milliseconds- See Also:
-
DEFAULT_SO_TIMEOUT
static final int DEFAULT_SO_TIMEOUTDefault socket timeout in milliseconds- See Also:
-
DEFAULT_RCV_BUF_SIZE
static final int DEFAULT_RCV_BUF_SIZEDefault receive buffer size in bytes- See Also:
-
DEFAULT_SND_BUF_SIZE
static final int DEFAULT_SND_BUF_SIZEDefault send buffer size in bytes- See Also:
-
DEFAULT_SSN_LIMIT
static final int DEFAULT_SSN_LIMITDefault session limit- See Also:
-
DEFAULT_CONN_TIMEOUT
static final int DEFAULT_CONN_TIMEOUTDefault connection timeout in milliseconds- See Also:
-
LADDR
Local address to bind to -
LPORT
static final int LPORTLocal port to bind to -
MAX_MPX_COUNT
static final int MAX_MPX_COUNTMaximum multiplex count -
SND_BUF_SIZE
static final int SND_BUF_SIZESend buffer size in bytes -
RCV_BUF_SIZE
static final int RCV_BUF_SIZEReceive buffer size in bytes -
USE_UNICODE
static final boolean USE_UNICODEWhether to use Unicode strings -
FORCE_UNICODE
static final boolean FORCE_UNICODEWhether to force Unicode usage -
USE_NTSTATUS
static final boolean USE_NTSTATUSWhether to use NT status codes -
SIGNPREF
static final boolean SIGNPREFWhether signing is preferred -
USE_NTSMBS
static final boolean USE_NTSMBSWhether to use NT SMBs -
USE_EXTSEC
static final boolean USE_EXTSECWhether to use extended security -
NETBIOS_HOSTNAME
NetBIOS hostname -
LM_COMPATIBILITY
static final int LM_COMPATIBILITYLM compatibility level -
FLAGS_NONE
static final int FLAGS_NONENo flags set- See Also:
-
FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCK
static final int FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCKLock and read write and unlock flag- See Also:
-
FLAGS_RECEIVE_BUFFER_POSTED
static final int FLAGS_RECEIVE_BUFFER_POSTEDReceive buffer posted flag- See Also:
-
FLAGS_PATH_NAMES_CASELESS
static final int FLAGS_PATH_NAMES_CASELESSPath names are caseless flag- See Also:
-
FLAGS_PATH_NAMES_CANONICALIZED
static final int FLAGS_PATH_NAMES_CANONICALIZEDPath names canonicalized flag- See Also:
-
FLAGS_OPLOCK_REQUESTED_OR_GRANTED
static final int FLAGS_OPLOCK_REQUESTED_OR_GRANTEDOplock requested or granted flag- See Also:
-
FLAGS_NOTIFY_OF_MODIFY_ACTION
static final int FLAGS_NOTIFY_OF_MODIFY_ACTIONNotify of modify action flag- See Also:
-
FLAGS_RESPONSE
static final int FLAGS_RESPONSEResponse flag- See Also:
-
FLAGS2_NONE
static final int FLAGS2_NONENo flags2 set- See Also:
-
FLAGS2_LONG_FILENAMES
static final int FLAGS2_LONG_FILENAMESLong filenames supported flag- See Also:
-
FLAGS2_EXTENDED_ATTRIBUTES
static final int FLAGS2_EXTENDED_ATTRIBUTESExtended attributes supported flag- See Also:
-
FLAGS2_SECURITY_SIGNATURES
static final int FLAGS2_SECURITY_SIGNATURESSecurity signatures supported flag- See Also:
-
FLAGS2_EXTENDED_SECURITY_NEGOTIATION
static final int FLAGS2_EXTENDED_SECURITY_NEGOTIATIONExtended security negotiation flag- See Also:
-
FLAGS2_RESOLVE_PATHS_IN_DFS
static final int FLAGS2_RESOLVE_PATHS_IN_DFSResolve paths in DFS flag- See Also:
-
FLAGS2_PERMIT_READ_IF_EXECUTE_PERM
static final int FLAGS2_PERMIT_READ_IF_EXECUTE_PERMPermit read if execute permission flag- See Also:
-
FLAGS2_STATUS32
static final int FLAGS2_STATUS3232-bit status codes flag- See Also:
-
FLAGS2_UNICODE
static final int FLAGS2_UNICODEUnicode strings flag- See Also:
-
CAP_NONE
static final int CAP_NONENo capabilities- See Also:
-
CAP_RAW_MODE
static final int CAP_RAW_MODERaw mode capability- See Also:
-
CAP_MPX_MODE
static final int CAP_MPX_MODEMPX mode capability- See Also:
-
CAP_UNICODE
static final int CAP_UNICODEUnicode capability- See Also:
-
CAP_LARGE_FILES
static final int CAP_LARGE_FILESLarge files capability- See Also:
-
CAP_NT_SMBS
static final int CAP_NT_SMBSNT SMBs capability- See Also:
-
CAP_RPC_REMOTE_APIS
static final int CAP_RPC_REMOTE_APISRPC remote APIs capability- See Also:
-
CAP_STATUS32
static final int CAP_STATUS3232-bit status codes capability- See Also:
-
CAP_LEVEL_II_OPLOCKS
static final int CAP_LEVEL_II_OPLOCKSLevel II oplocks capability- See Also:
-
CAP_LOCK_AND_READ
static final int CAP_LOCK_AND_READLock and read capability- See Also:
-
CAP_NT_FIND
static final int CAP_NT_FINDNT find capability- See Also:
-
CAP_DFS
static final int CAP_DFSDFS capability- See Also:
-
CAP_EXTENDED_SECURITY
static final int CAP_EXTENDED_SECURITYExtended security capability- See Also:
-
FILE_READ_DATA
static final int FILE_READ_DATAFile read data access right- See Also:
-
FILE_WRITE_DATA
static final int FILE_WRITE_DATAFile write data access right- See Also:
-
FILE_APPEND_DATA
static final int FILE_APPEND_DATAFile append data access right- See Also:
-
FILE_READ_EA
static final int FILE_READ_EAFile read extended attributes access right- See Also:
-
FILE_WRITE_EA
static final int FILE_WRITE_EAFile write extended attributes access right- See Also:
-
FILE_EXECUTE
static final int FILE_EXECUTEFile execute access right- See Also:
-
FILE_DELETE
static final int FILE_DELETEFile delete child access right- See Also:
-
FILE_READ_ATTRIBUTES
static final int FILE_READ_ATTRIBUTESFile read attributes access right- See Also:
-
FILE_WRITE_ATTRIBUTES
static final int FILE_WRITE_ATTRIBUTESFile write attributes access right- See Also:
-
DELETE
static final int DELETEDelete access right- See Also:
-
READ_CONTROL
static final int READ_CONTROLRead control access right- See Also:
-
WRITE_DAC
static final int WRITE_DACWrite DAC access right- See Also:
-
WRITE_OWNER
static final int WRITE_OWNERWrite owner access right- See Also:
-
SYNCHRONIZE
static final int SYNCHRONIZESynchronize access right- See Also:
-
GENERIC_ALL
static final int GENERIC_ALLGeneric all access right- See Also:
-
GENERIC_EXECUTE
static final int GENERIC_EXECUTEGeneric execute access right- See Also:
-
GENERIC_WRITE
static final int GENERIC_WRITEGeneric write access right- See Also:
-
GENERIC_READ
static final int GENERIC_READGeneric read access right- See Also:
-
FLAGS_TARGET_MUST_BE_FILE
static final int FLAGS_TARGET_MUST_BE_FILETarget must be file flag- See Also:
-
FLAGS_TARGET_MUST_BE_DIRECTORY
static final int FLAGS_TARGET_MUST_BE_DIRECTORYTarget must be directory flag- See Also:
-
FLAGS_COPY_TARGET_MODE_ASCII
static final int FLAGS_COPY_TARGET_MODE_ASCIICopy target mode ASCII flag- See Also:
-
FLAGS_COPY_SOURCE_MODE_ASCII
static final int FLAGS_COPY_SOURCE_MODE_ASCIICopy source mode ASCII flag- See Also:
-
FLAGS_VERIFY_ALL_WRITES
static final int FLAGS_VERIFY_ALL_WRITESVerify all writes flag- See Also:
-
FLAGS_TREE_COPY
static final int FLAGS_TREE_COPYTree copy flag- See Also:
-
OPEN_FUNCTION_FAIL_IF_EXISTS
static final int OPEN_FUNCTION_FAIL_IF_EXISTSOpen function fail if exists- See Also:
-
OPEN_FUNCTION_OVERWRITE_IF_EXISTS
static final int OPEN_FUNCTION_OVERWRITE_IF_EXISTSOpen function overwrite if exists- See Also:
-
PID
static final int PIDProcess ID -
SECURITY_SHARE
static final int SECURITY_SHAREShare level security- See Also:
-
SECURITY_USER
static final int SECURITY_USERUser level security- See Also:
-
CMD_OFFSET
static final int CMD_OFFSETCommand offset in SMB header- See Also:
-
ERROR_CODE_OFFSET
static final int ERROR_CODE_OFFSETError code offset in SMB header- See Also:
-
FLAGS_OFFSET
static final int FLAGS_OFFSETFlags offset in SMB header- See Also:
-
SIGNATURE_OFFSET
static final int SIGNATURE_OFFSETSignature offset in SMB header- See Also:
-
TID_OFFSET
static final int TID_OFFSETTID offset in SMB header- See Also:
-
HEADER_LENGTH
static final int HEADER_LENGTHSMB header length- See Also:
-
MILLISECONDS_BETWEEN_1970_AND_1601
static final long MILLISECONDS_BETWEEN_1970_AND_1601Milliseconds between 1970 and 1601- See Also:
-
TZ
Default timezone -
USE_BATCHING
static final boolean USE_BATCHINGWhether to use batching -
OEM_ENCODING
OEM encoding -
UNI_ENCODING
Unicode encoding- See Also:
-
DEFAULT_FLAGS2
static final int DEFAULT_FLAGS2Default FLAGS2 value -
DEFAULT_CAPABILITIES
static final int DEFAULT_CAPABILITIESDefault capabilities -
FLAGS2
static final int FLAGS2FLAGS2 value -
CAPABILITIES
static final int CAPABILITIESCapabilities value -
TCP_NODELAY
static final boolean TCP_NODELAYWhether to use TCP_NODELAY -
RESPONSE_TIMEOUT
static final int RESPONSE_TIMEOUTResponse timeout in milliseconds -
CONNECTIONS
List of active connections -
SSN_LIMIT
static final int SSN_LIMITSession limit -
SO_TIMEOUT
static final int SO_TIMEOUTSocket timeout in milliseconds -
CONN_TIMEOUT
static final int CONN_TIMEOUTConnection timeout in milliseconds -
NATIVE_OS
Native operating system name -
NATIVE_LANMAN
Native LAN manager name -
VC_NUMBER
static final int VC_NUMBERVirtual circuit number- See Also:
-
NULL_TRANSPORT
Null transport instance
-
-
Constructor Details
-
SmbFile
Constructs an SmbFile representing a resource on an SMB network such as a file or directory. See the description and examples of smb URLs above.- Parameters:
url- A URL string- Throws:
MalformedURLException- If theparentandchildparameters do not follow the prescribed syntax
-
SmbFile
Constructs an SmbFile representing a resource on an SMB network such as a file or directory. The second parameter is a relative path from theparent SmbFile. See the description above for examples of using the secondnameparameter.- Parameters:
context- A baseSmbFilename- A path string relative to theparentparemeter- Throws:
MalformedURLException- If theparentandchildparameters do not follow the prescribed syntaxUnknownHostException- If the server or workgroup of thecontextfile cannot be determined
-
SmbFile
Constructs an SmbFile representing a resource on an SMB network such as a file or directory. The second parameter is a relative path from theparent. See the description above for examples of using the secondchileparameter.- Parameters:
context- A URL stringname- A path string relative to thecontextparemeter- Throws:
MalformedURLException- If thecontextandnameparameters do not follow the prescribed syntax
-
SmbFile
Constructs an SmbFile representing a resource on an SMB network such as a file or directory.- Parameters:
url- A URL stringauth- The credentials the client should use for authentication- Throws:
MalformedURLException- If theurlparameter does not follow the prescribed syntax
-
SmbFile
public SmbFile(String url, NtlmPasswordAuthentication auth, int shareAccess) throws MalformedURLException Constructs an SmbFile representing a file on an SMB network. TheshareAccessparameter controls what permissions other clients have when trying to access the same file while this instance is still open. This value is eitherFILE_NO_SHAREor any combination ofFILE_SHARE_READ,FILE_SHARE_WRITE, andFILE_SHARE_DELETElogically OR'd together.- Parameters:
url- A URL stringauth- The credentials the client should use for authenticationshareAccess- Specifies what access other clients have while this file is open.- Throws:
MalformedURLException- If theurlparameter does not follow the prescribed syntax
-
SmbFile
public SmbFile(String context, String name, NtlmPasswordAuthentication auth) throws MalformedURLException Constructs an SmbFile representing a resource on an SMB network such as a file or directory. The second parameter is a relative path from thecontext. See the description above for examples of using the secondnameparameter.- Parameters:
context- A URL stringname- A path string relative to thecontextparemeterauth- The credentials the client should use for authentication- Throws:
MalformedURLException- If thecontextandnameparameters do not follow the prescribed syntax
-
SmbFile
public SmbFile(String context, String name, NtlmPasswordAuthentication auth, int shareAccess) throws MalformedURLException Constructs an SmbFile representing a resource on an SMB network such as a file or directory. The second parameter is a relative path from thecontext. See the description above for examples of using the secondnameparameter. TheshareAccessparameter controls what permissions other clients have when trying to access the same file while this instance is still open. This value is eitherFILE_NO_SHAREor any combination ofFILE_SHARE_READ,FILE_SHARE_WRITE, andFILE_SHARE_DELETElogically OR'd together.- Parameters:
context- A URL stringname- A path string relative to thecontextparemeterauth- The credentials the client should use for authenticationshareAccess- Specifies what access other clients have while this file is open.- Throws:
MalformedURLException- If thecontextandnameparameters do not follow the prescribed syntax
-
SmbFile
public SmbFile(SmbFile context, String name, int shareAccess) throws MalformedURLException, UnknownHostException Constructs an SmbFile representing a resource on an SMB network such as a file or directory. The second parameter is a relative path from thecontext. See the description above for examples of using the secondnameparameter. TheshareAccessparameter controls what permissions other clients have when trying to access the same file while this instance is still open. This value is eitherFILE_NO_SHAREor any combination ofFILE_SHARE_READ,FILE_SHARE_WRITE, andFILE_SHARE_DELETElogically OR'd together.- Parameters:
context- A baseSmbFilename- A path string relative to thecontextfile pathshareAccess- Specifies what access other clients have while this file is open.- Throws:
MalformedURLException- If thecontextandnameparameters do not follow the prescribed syntaxUnknownHostException- if the server cannot be resolved
-
SmbFile
Constructs an SmbFile representing a resource on an SMB network such as a file or directory from aURLobject.- Parameters:
url- The URL of the target resource
-
SmbFile
Constructs an SmbFile representing a resource on an SMB network such as a file or directory from aURLobject and anNtlmPasswordAuthenticationobject.- Parameters:
url- The URL of the target resourceauth- The credentials the client should use for authentication
-
-
Method Details
-
connect
It is not necessary to call this method directly. This is theURLConnectionimplementation ofconnect().- Specified by:
connectin classURLConnection- Throws:
IOException
-
getPrincipal
Returns the principal used for authentication- Returns:
- the authentication principal
-
getName
Returns the last component of the target URL. This will effectively be the name of the file or directory represented by thisSmbFileor in the case of URLs that only specify a server or workgroup, the server or workgroup will be returned. The name of the root URLsmb1://is alsosmb1://. If thisSmbFilerefers to a workgroup, server, share, or directory, the name will include a trailing slash '/' so that composing newSmbFiles will maintain the trailing slash requirement.- Returns:
- The last component of the URL associated with this SMB
resource or
smb1://if the resource issmb1://itself.
-
getParent
Everything but the last component of the URL representing this SMB resource is effectivly it's parent. The root URLsmb1://does not have a parent. In this casesmb1://is returned.- Returns:
- The parent directory of this SMB resource or
smb1://if the resource refers to the root of the URL hierarchy which incedentally is alsosmb1://.
-
getPath
Returns the full uncanonicalized URL of this SMB resource. AnSmbFileconstructed with the result of this method will result in anSmbFilethat is equal to the original.- Returns:
- The uncanonicalized full URL of this SMB resource.
-
getUncPath
Retuns the Windows UNC style path with backslashs intead of forward slashes.- Returns:
- The UNC path.
-
getCanonicalPath
Returns the full URL of this SMB resource with '.' and '..' components factored out. AnSmbFileconstructed with the result of this method will result in anSmbFilethat is equal to the original.- Returns:
- The canonicalized URL of this SMB resource.
-
getServer
Retrieve the hostname of the server for this SMB resource. If thisSmbFilereferences a workgroup, the name of the workgroup is returned. If thisSmbFilerefers to the root of this SMB network hierarchy,nullis returned.- Returns:
- The server or workgroup name or
nullif thisSmbFilerefers to the rootsmb1://resource.
-
getType
Returns type of of object thisSmbFilerepresents.- Returns:
TYPE_FILESYSTEM, TYPE_WORKGROUP, TYPE_SERVER, TYPE_SHARE, TYPE_PRINTER, TYPE_NAMED_PIPE, orTYPE_COMM.- Throws:
SmbException- if an error occurs while determining the type
-
exists
Tests to see if the SMB resource exists. If the resource refers only to a server, this method determines if the server exists on the network and is advertising SMB services. If this resource refers to a workgroup, this method determines if the workgroup name is valid on the local SMB network. If thisSmbFilerefers to the rootsmb1://resourcetrueis always returned. If thisSmbFileis a traditional file or directory, it will be queried for on the specified server as expected.- Returns:
trueif the resource exists or is alive orfalseotherwise- Throws:
SmbException- if an error occurs while checking existence
-
canRead
Tests to see if the file thisSmbFilerepresents can be read. Because any file, directory, or other resource can be read if it exists, this method simply calls theexistsmethod.- Returns:
trueif the file is read-only- Throws:
SmbException- if an error occurs while checking read permissions
-
canWrite
Tests to see if the file thisSmbFilerepresents exists and is not marked read-only. By default, resources are considered to be read-only and therefore forsmb1://,smb1://workgroup/, andsmb1://server/resources will be read-only.- Returns:
trueif the resource exists is not marked read-only- Throws:
SmbException- if an error occurs while checking write permissions
-
isDirectory
Tests to see if the file thisSmbFilerepresents is a directory.- Returns:
trueif thisSmbFileis a directory- Throws:
SmbException- if an error occurs while checking if this is a directory
-
isFile
Tests to see if the file thisSmbFilerepresents is not a directory.- Returns:
trueif thisSmbFileis not a directory- Throws:
SmbException- if an error occurs while checking if this is a file
-
isHidden
Tests to see if the file this SmbFile represents is marked as hidden. This method will also return true for shares with names that end with '$' such asIPC$orC$.- Returns:
trueif theSmbFileis marked as being hidden- Throws:
SmbException- if an error occurs while checking if this is hidden
-
getDfsPath
Returns the DFS path for this file if it resides in a DFS share- Returns:
- the DFS path or null if not in DFS
- Throws:
SmbException- if an error occurs while resolving the DFS path
-
createTime
Retrieve the time thisSmbFilewas created. The value returned is suitable for constructing aDateobject (i.e. seconds since Epoch 1970). Times should be the same as those reported using the properties dialog of the Windows Explorer program. For Win95/98/Me this is actually the last write time. It is currently not possible to retrieve the create time from files on these systems.- Returns:
- The number of milliseconds since the 00:00:00 GMT, January 1,
1970 as a
longvalue - Throws:
SmbException- if an error occurs while retrieving the creation time
-
lastModified
Retrieve the last time the file represented by thisSmbFilewas modified. The value returned is suitable for constructing aDateobject (i.e. seconds since Epoch 1970). Times should be the same as those reported using the properties dialog of the Windows Explorer program.- Returns:
- The number of milliseconds since the 00:00:00 GMT, January 1,
1970 as a
longvalue - Throws:
SmbException- if an error occurs while retrieving the last modified time
-
list
List the contents of this SMB resource. The list returned by this method will be;- files and directories contained within this resource if the resource is a normal disk file directory,
- all available NetBIOS workgroups or domains if this resource is
the top level URL
smb1://, - all servers registered as members of a NetBIOS workgroup if this
resource refers to a workgroup in a
smb1://workgroup/URL, - all browseable shares of a server including printers, IPC
services, or disk volumes if this resource is a server URL in the form
smb1://server/, - or
nullif the resource cannot be resolved.
- Returns:
- A
String[]array of files and directories, workgroups, servers, or shares depending on the context of the resource URL - Throws:
SmbException- if an error occurs while listing the contents
-
list
List the contents of this SMB resource. The list returned will be identical to the list returned by the parameterlesslist()method minus filenames filtered by the specified filter.- Parameters:
filter- a filename filter to exclude filenames from the results- Returns:
- An array of filenames
- Throws:
SmbException- if an error occurs while listing the contents
-
listFiles
List the contents of this SMB resource as an array ofSmbFileobjects. This method is much more efficient than the regularlistmethod when querying attributes of each file in the result set.The list of
SmbFiles returned by this method will be;- files and directories contained within this resource if the resource is a normal disk file directory,
- all available NetBIOS workgroups or domains if this resource is
the top level URL
smb1://, - all servers registered as members of a NetBIOS workgroup if this
resource refers to a workgroup in a
smb1://workgroup/URL, - all browseable shares of a server including printers, IPC
services, or disk volumes if this resource is a server URL in the form
smb1://server/, - or
nullif the resource cannot be resolved.
- Returns:
- An array of
SmbFileobjects representing file and directories, workgroups, servers, or shares depending on the context of the resource URL - Throws:
SmbException- if an error occurs while listing the files
-
listFiles
The CIFS protocol provides for DOS "wildcards" to be used as a performance enhancement. The client does not have to filter the names and the server does not have to return all directory entries.The wildcard expression may consist of two special meta characters in addition to the normal filename characters. The '*' character matches any number of characters in part of a name. If the expression begins with one or more '?'s then exactly that many characters will be matched whereas if it ends with '?'s it will match that many characters or less.
Wildcard expressions will not filter workgroup names or server names.
winnt> ls c?o* clock.avi -rw-- 82944 Mon Oct 14 1996 1:38 AM Cookies drw-- 0 Fri Nov 13 1998 9:42 PM 2 items in 5ms
- Parameters:
wildcard- a wildcard expression- Returns:
- An array of
SmbFileobjects representing file and directories, workgroups, servers, or shares depending on the context of the resource URL - Throws:
SmbException- if an error occurs while listing the files
-
listFiles
List the contents of this SMB resource. The list returned will be identical to the list returned by the parameterlesslistFiles()method minus files filtered by the specified filename filter.- Parameters:
filter- a filter to exclude files from the results- Returns:
- An array of
SmbFileobjects - Throws:
SmbException- if an error occurs while listing the files
-
listFiles
List the contents of this SMB resource. The list returned will be identical to the list returned by the parameterlesslistFiles()method minus filenames filtered by the specified filter.- Parameters:
filter- a file filter to exclude files from the results- Returns:
- An array of
SmbFileobjects - Throws:
SmbException- if an error occurs while listing the files
-
renameTo
Changes the name of the file thisSmbFilerepresents to the name designated by theSmbFileargument. Remember:SmbFiles are immutible and therefore the path associated with thisSmbFileobject will not change). To access the renamed file it is necessary to construct a newSmbFile.- Parameters:
dest- AnSmbFilethat represents the new pathname- Throws:
NullPointerException- If thedestargument isnullSmbException- if an error occurs during the rename operation
-
copyTo
This method will copy the file or directory represented by thisSmbFileand it's sub-contents to the location specified by thedestparameter. This file and the destination file do not need to be on the same host. This operation does not copy extended file attibutes such as ACLs but it does copy regular attributes as well as create and last write times. This method is almost twice as efficient as manually copying as it employs an additional write thread to read and write data concurrently. It is not possible (nor meaningful) to copy entire workgroups or servers.- Parameters:
dest- the destination file or directory- Throws:
SmbException- if an error occurs during the copy operation
-
delete
This method will delete the file or directory specified by thisSmbFile. If the target is a directory, the contents of the directory will be deleted as well. If a file within the directory or it's sub-directories is marked read-only, the read-only status will be removed and the file will be deleted.- Throws:
SmbException- if an error occurs while deleting the file or directory
-
length
Returns the length of thisSmbFilein bytes. If this object is aTYPE_SHAREthe total capacity of the disk shared in bytes is returned. If this object is a directory or a type other thanTYPE_SHARE, 0L is returned.- Returns:
- The length of the file in bytes or 0 if this
SmbFileis not a file. - Throws:
SmbException- if an error occurs while retrieving the file length
-
getDiskFreeSpace
This method returns the free disk space in bytes of the drive this share represents or the drive on which the directory or file resides. Objects other thanTYPE_SHAREorTYPE_FILESYSTEMwill result in 0L being returned.- Returns:
- the free disk space in bytes of the drive on which this file or directory resides
- Throws:
SmbException- if an error occurs while retrieving disk space information
-
mkdir
Creates a directory with the path specified by thisSmbFile. For this method to be successful, the target must not already exist. This method will fail when used withsmb1://,smb1://workgroup/,smb1://server/, orsmb1://server/share/URLs because workgroups, servers, and shares cannot be dynamically created (although in the future it may be possible to create shares).- Throws:
SmbException- if an error occurs while creating the directory
-
mkdirs
Creates a directory with the path specified by thisSmbFileand any parent directories that do not exist. This method will fail when used withsmb1://,smb1://workgroup/,smb1://server/, orsmb1://server/share/URLs because workgroups, servers, and shares cannot be dynamically created (although in the future it may be possible to create shares).- Throws:
SmbException- if an error occurs while creating the directories
-
createNewFile
Create a new file but fail if it already exists. The check for existance of the file and it's creation are an atomic operation with respect to other filesystem activities.- Throws:
SmbException- if an error occurs while creating the file
-
setCreateTime
Set the create time of the file. The time is specified as milliseconds from Jan 1, 1970 which is the same as that which is returned by thecreateTime()method. This method does not apply to workgroups, servers, or shares.- Parameters:
time- the create time as milliseconds since Jan 1, 1970- Throws:
SmbException- if an error occurs while setting the create time
-
setLastModified
Set the last modified time of the file. The time is specified as milliseconds from Jan 1, 1970 which is the same as that which is returned by thelastModified(),getLastModified(), andgetDate()methods. This method does not apply to workgroups, servers, or shares.- Parameters:
time- the last modified time as milliseconds since Jan 1, 1970- Throws:
SmbException- if an error occurs while setting the last modified time
-
getAttributes
Return the attributes of this file. Attributes are represented as a bitset that must be masked withATTR_*constants to determine if they are set or unset. The value returned is suitable for use with thesetAttributes()method.- Returns:
- the
ATTR_*attributes associated with this file - Throws:
SmbException- if an error occurs while retrieving attributes
-
setAttributes
Set the attributes of this file. Attributes are composed into a bitset by bitwise ORing theATTR_*constants. Setting the value returned bygetAttributeswill result in both files having the same attributes.- Parameters:
attrs- the attributes to set- Throws:
SmbException- if an error occurs while setting attributes
-
setReadOnly
Make this file read-only. This is shorthand forsetAttributes( getAttributes() | ATTR_READ_ONLY ).- Throws:
SmbException- if an error occurs while setting the read-only flag
-
setReadWrite
Turn off the read-only attribute of this file. This is shorthand forsetAttributes( getAttributes() & ~ATTR_READONLY ).- Throws:
SmbException- if an error occurs while clearing the read-only flag
-
toURL
Deprecated.Use getURL() insteadReturns aURLfor thisSmbFile. TheURLmay be used as any otherURLmight to access an SMB resource. Currently only retrieving data and information is supported (i.e. nodoOutput).- Returns:
- A new
for thisURLSmbFile - Throws:
MalformedURLException- if the URL is malformed
-
hashCode
public int hashCode()Computes a hashCode for this file based on the URL string and IP address if the server. The hashing function uses the hashcode of the server address, the canonical representation of the URL, and does not compare authentication information. In essance, twoSmbFileobjects that refer to the same file should generate the same hashcode provided it is possible to make such a determination. -
pathNamesPossiblyEqual
Checks if two path names could possibly be equal- Parameters:
path1- the first pathpath2- the second path- Returns:
- true if the paths could be equal
-
equals
Tests to see if twoSmbFileobjects are equal. Two SmbFile objects are equal when they reference the same SMB resource. More specifically, twoSmbFileobjects are equals if their server IP addresses are equal and the canonicalized representation of their URLs, minus authentication parameters, are case insensitivly and lexographically equal. For example, assuming the serverangusresolves to the192.168.1.15IP address, the below URLs would result inSmbFiles that are equal.smb1://192.168.1.15/share/DIR/foo.txt smb1://angus/share/data/../dir/foo.txt
-
toString
Returns the string representation of this SmbFile object. This will be the same as the URL used to construct thisSmbFile. This method will return the same value asgetPath.- Overrides:
toStringin classURLConnection- Returns:
- The original URL representation of this SMB resource
-
getContentLength
public int getContentLength()This URLConnection method just returns the result oflength().- Overrides:
getContentLengthin classURLConnection- Returns:
- the length of this file or 0 if it refers to a directory
-
getDate
public long getDate()This URLConnection method just returns the result oflastModified.- Overrides:
getDatein classURLConnection- Returns:
- the last modified data as milliseconds since Jan 1, 1970
-
getLastModified
public long getLastModified()This URLConnection method just returns the result oflastModified.- Overrides:
getLastModifiedin classURLConnection- Returns:
- the last modified data as milliseconds since Jan 1, 1970
-
getInputStream
This URLConnection method just returns a newSmbFileInputStreamcreated with this file.- Overrides:
getInputStreamin classURLConnection- Throws:
IOException- thrown bySmbFileInputStreamconstructor
-
getOutputStream
This URLConnection method just returns a newSmbFileOutputStreamcreated with this file.- Overrides:
getOutputStreamin classURLConnection- Throws:
IOException- thrown bySmbFileOutputStreamconstructor
-
getSecurity
Return an array of Access Control Entry (ACE) objects representing the security descriptor associated with this file or directory. If no DACL is present, null is returned. If the DACL is empty, an array with 0 elements is returned.- Parameters:
resolveSids- Attempt to resolve the SIDs within each ACE from their numeric representation to their corresponding account names.- Returns:
- an array of ACE entries for this file
- Throws:
IOException- if an I/O error occurs
-
getSecurity
Returns the security information for this file- Returns:
- an array of ACE entries for this file
- Throws:
IOException- if an I/O error occurs
-
getOwnerUser
Returns the owner user SID for this file- Returns:
- the owner user SID
- Throws:
IOException- if an I/O error occurs
-
getOwnerGroup
Returns the owner group SID for this file- Returns:
- the owner group SID
- Throws:
IOException- if an I/O error occurs
-