Package com.sshtools.vfs.smbng
Class SmbFileName
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileName
-
- org.apache.commons.vfs2.provider.GenericFileName
-
- com.sshtools.vfs.smbng.SmbFileName
-
- All Implemented Interfaces:
Comparable<org.apache.commons.vfs2.FileName>,org.apache.commons.vfs2.FileName
public class SmbFileName extends org.apache.commons.vfs2.provider.GenericFileNameAn SMB URI. Adds a share name to the generic URI.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendCredentials(StringBuilder buffer, boolean addPassword)Putdomainbefore @{code username} if both are set.protected voidappendRootUri(StringBuilder buffer, boolean addPassword)Builds the root URI for this file name.org.apache.commons.vfs2.FileNamecreateName(String path, org.apache.commons.vfs2.FileType type)Factory method for creating name instances.StringgetDomain()Returns the domain name.StringgetShare()Returns the share name.StringgetUriWithoutAuth()Construct the path suitable for SmbFile when used with NtlmPasswordAuthentication.-
Methods inherited from class org.apache.commons.vfs2.provider.GenericFileName
getDefaultPort, getHostName, getPassword, getPort, getUserName
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileName
checkName, compareTo, createURI, equals, getBaseName, getDepth, getExtension, getFriendlyURI, getParent, getPath, getPathDecoded, getRelativeName, getRoot, getRootURI, getScheme, getType, getURI, getUriTrailer, hashCode, isAncestor, isDescendent, isDescendent, isFile, toString
-
-
-
-
Method Detail
-
getShare
public String getShare()
Returns the share name.- Returns:
- share name
-
appendRootUri
protected void appendRootUri(StringBuilder buffer, boolean addPassword)
Builds the root URI for this file name.- Overrides:
appendRootUriin classorg.apache.commons.vfs2.provider.GenericFileName
-
appendCredentials
protected void appendCredentials(StringBuilder buffer, boolean addPassword)
Putdomainbefore @{code username} if both are set.Uses super method to add password or password placeholder.
- Overrides:
appendCredentialsin classorg.apache.commons.vfs2.provider.GenericFileName
-
createName
public org.apache.commons.vfs2.FileName createName(String path, org.apache.commons.vfs2.FileType type)
Factory method for creating name instances.- Overrides:
createNamein classorg.apache.commons.vfs2.provider.GenericFileName- Parameters:
path- path of file.type- file or directory- Returns:
- new SmbFileName object, never null.
-
getUriWithoutAuth
public String getUriWithoutAuth() throws org.apache.commons.vfs2.FileSystemException
Construct the path suitable for SmbFile when used with NtlmPasswordAuthentication.- Returns:
- caches and return URI with no username/password, never null
- Throws:
org.apache.commons.vfs2.FileSystemException- if any of the invoked methods throw
-
getDomain
public String getDomain()
Returns the domain name.- Returns:
- domain name
-
-