- All Known Subinterfaces:
SmbResourceLocatorInternal
public interface SmbResourceLocator
Location information for a SMB resource
- Author:
- mbechler
-
Method Summary
Modifier and TypeMethodDescriptionReturns the resolved network address of the server hosting this SMB resource.Returns the full URL of this SMB resource with '.' and '..' components factored out.If the path of thisSmbFilefalls within a DFS volume, this method will return the referral path to which it maps.Returns the DFS referral data associated with this resource if it has been resolved through DFS.getName()Returns the last component of the target URL.Everything but the last component of the URL representing this SMB resource is effectively it's parent.getPath()Returns the full uncanonicalized URL of this SMB resource.intgetPort()Returns the transport port number for this SMB resource connection.Retrieve the hostname of the server for this SMB resource.Retrieve the hostname of the server for this SMB resource.getShare()Retrieves the share associated with this SMB resource.intgetType()Returns type of of object thisSmbFilerepresents.Returns the canonicalized UNC path of this SMB resource relative to its share.getURL()Returns the original URL object used to create this SMB resource.Returns the canonicalized URL path relative to the server or domain.booleanisIPC()Determines whether this resource represents an IPC (Inter-Process Communication) connection.booleanisRoot()Determines whether this resource represents the root of the SMB hierarchy.booleanDetermines whether this resource represents a workgroup reference.
-
Method Details
-
getName
String 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 URLsmb://is alsosmb://. 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
smb://if the resource issmb://itself.
-
getDfsReferral
DfsReferralData getDfsReferral()Returns the DFS referral data associated with this resource if it has been resolved through DFS.- 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. 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.
-
getCanonicalURL
String getCanonicalURL()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.
-
getUNCPath
String getUNCPath()Returns the canonicalized UNC path of this SMB resource relative to its share.- 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 or domain.- Returns:
- The canonicalized URL path (relative to the server/domain)
-
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 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 rootsmb://resource.
-
getDfsPath
String getDfsPath()If the path of thisSmbFilefalls within a DFS volume, this method will return the referral path to which it maps. Otherwisenullis returned.- Returns:
- URL to the DFS volume
-
getPort
int getPort()Returns the transport port number for this SMB resource connection.- Returns:
- the transport port, if specified
-
getURL
URL getURL()Returns the original URL object used to create this SMB resource.- Returns:
- the original URL
-
getAddress
Returns the resolved network address of the server hosting this SMB resource.- Returns:
- resolved server address
- Throws:
CIFSException- if the address cannot be resolved
-
isIPC
boolean isIPC()Determines whether this resource represents an IPC (Inter-Process Communication) connection.- Returns:
- whether this is a IPC connection
-
getType
Returns type of of object thisSmbFilerepresents.- Returns:
TYPE_FILESYSTEM, TYPE_WORKGROUP, TYPE_SERVER, TYPE_NAMED_PIPE, orTYPE_SHAREin which case it may be eitherTYPE_SHARE,TYPE_PRINTERorTYPE_COMM.- Throws:
CIFSException- if the type cannot be determined
-
isWorkgroup
Determines whether this resource represents a workgroup reference.- Returns:
- whether this is a workgroup reference
- Throws:
CIFSException- if the determination cannot be made
-
isRoot
boolean isRoot()Determines whether this resource represents the root of the SMB hierarchy.- Returns:
- whether this is a root resource
-