Package jcifs
Interface SmbResourceLocator
-
- All Known Subinterfaces:
SmbResourceLocatorInternal
public interface SmbResourceLocator
Location information for a SMB resource- Author:
- mbechler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Address
getAddress()
String
getCanonicalURL()
Returns the full URL of this SMB resource with '.' and '..' components factored out.String
getDfsPath()
If the path of thisSmbFile
falls within a DFS volume, this method will return the referral path to which it maps.DfsReferralData
getDfsReferral()
String
getName()
Returns the last component of the target URL.String
getParent()
Everything but the last component of the URL representing this SMB resource is effectively it's parent.String
getPath()
Returns the full uncanonicalized URL of this SMB resource.int
getPort()
String
getServer()
Retrieve the hostname of the server for this SMB resource.String
getServerWithDfs()
Retrieve the hostname of the server for this SMB resource.String
getShare()
Retrieves the share associated with this SMB resource.int
getType()
Returns type of of object this SmbFile represents.String
getUNCPath()
URL
getURL()
String
getURLPath()
boolean
isIPC()
boolean
isRoot()
boolean
isWorkgroup()
-
-
-
Method Detail
-
getName
String getName()
Returns the last component of the target URL. This will effectively be the name of the file or directory represented by thisSmbFile
or in the case of URLs that only specify a server or workgroup, the server or workgroup will be returned. The name of the root URLsmb://
is alsosmb://
. If this SmbFile refers to a workgroup, server, share, or directory, the name will include a trailing slash '/' so that composing new SmbFiles will maintain the trailing slash requirement.- Returns:
- The last component of the URL associated with this SMB
resource or
smb://
if the resource issmb://
itself.
-
getDfsReferral
DfsReferralData getDfsReferral()
- Returns:
- dfs referral data
-
getParent
String getParent()
Everything but the last component of the URL representing this SMB resource is effectively it's parent. The root URLsmb://
does not have a parent. In this casesmb://
is returned.- Returns:
- The parent directory of this SMB resource or
smb://
if the resource refers to the root of the URL hierarchy which incidentally is alsosmb://
.
-
getPath
String getPath()
Returns the full uncanonicalized URL of this SMB resource. AnSmbFile
constructed with the result of this method will result in anSmbFile
that is equal to the original.- Returns:
- The uncanonicalized full URL of this SMB resource.
-
getCanonicalURL
String getCanonicalURL()
Returns the full URL of this SMB resource with '.' and '..' components factored out. AnSmbFile
constructed with the result of this method will result in anSmbFile
that is equal to the original.- Returns:
- The canonicalized URL of this SMB resource.
-
getUNCPath
String getUNCPath()
- Returns:
- The canonicalized UNC path of this SMB resource (relative to it's share)
-
getURLPath
String getURLPath()
- Returns:
- The canonicalized URL path (relative to the server/domain)
-
getShare
String getShare()
Retrieves the share associated with this SMB resource. In the case ofsmb://
,smb://workgroup/
, andsmb://server/
URLs which do not specify a share,null
will be returned.- Returns:
- The share component or
null
if there is no share
-
getServerWithDfs
String getServerWithDfs()
Retrieve the hostname of the server for this SMB resource. If the resources has been resolved by DFS this will return the target name.- Returns:
- The server name
-
getServer
String getServer()
Retrieve the hostname of the server for this SMB resource. If thisSmbFile
references a workgroup, the name of the workgroup is returned. If thisSmbFile
refers to the root of this SMB network hierarchy,null
is returned.- Returns:
- The server or workgroup name or
null
if thisSmbFile
refers to the rootsmb://
resource.
-
getDfsPath
String getDfsPath()
If the path of thisSmbFile
falls within a DFS volume, this method will return the referral path to which it maps. Otherwisenull
is returned.- Returns:
- URL to the DFS volume
-
getPort
int getPort()
- Returns:
- the transport port, if specified
-
getURL
URL getURL()
- Returns:
- the original URL
-
getAddress
Address getAddress() throws CIFSException
- Returns:
- resolved server address
- Throws:
CIFSException
-
isIPC
boolean isIPC()
- Returns:
- whether this is a IPC connection
-
getType
int getType() throws CIFSException
Returns type of of object this SmbFile represents.- Returns:
- TYPE_FILESYSTEM, TYPE_WORKGROUP, TYPE_SERVER, TYPE_NAMED_PIPE, or TYPE_SHARE in which case it may be either TYPE_SHARE, TYPE_PRINTER or TYPE_COMM.
- Throws:
CIFSException
-
isWorkgroup
boolean isWorkgroup() throws CIFSException
- Returns:
- whether this is a workgroup reference
- Throws:
CIFSException
-
isRoot
boolean isRoot()
- Returns:
- whether this is a root resource
-
-