org.apache.commons.vfs.provider.smb
Class SmbFileName

java.lang.Object
  extended by org.apache.commons.vfs.provider.AbstractFileName
      extended by org.apache.commons.vfs.provider.GenericFileName
          extended by org.apache.commons.vfs.provider.smb.SmbFileName
All Implemented Interfaces:
java.lang.Comparable, FileName

public class SmbFileName
extends GenericFileName

An SMB URI. Adds a share name to the generic URI.

Version:
$Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29. Nov 2006) $
Author:
Adam Murdoch

Field Summary
 
Fields inherited from interface org.apache.commons.vfs.FileName
ROOT_PATH, SEPARATOR, SEPARATOR_CHAR
 
Constructor Summary
protected SmbFileName(java.lang.String scheme, java.lang.String hostName, int port, java.lang.String userName, java.lang.String password, java.lang.String domain, java.lang.String share, java.lang.String path, FileType type)
           
 
Method Summary
protected  void appendCredentials(java.lang.StringBuffer buffer, boolean addPassword)
          put domain before username if both are set
protected  void appendRootUri(java.lang.StringBuffer buffer, boolean addPassword)
          Builds the root URI for this file name.
 FileName createName(java.lang.String path, FileType type)
          Factory method for creating name instances.
 java.lang.String getDomain()
          returns the domain name
 java.lang.String getShare()
          Returns the share name.
 java.lang.String getUriWithoutAuth()
          Construct the path suitable for SmbFile when used with NtlmPasswordAuthentication
 
Methods inherited from class org.apache.commons.vfs.provider.GenericFileName
getDefaultPort, getHostName, getPassword, getPort, getUserName
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileName
checkName, compareTo, createURI, equals, getBaseName, getDepth, getExtension, getFriendlyURI, getParent, getPath, getPathDecoded, getRelativeName, getRoot, getRootURI, getScheme, getType, getURI, getUriTrailer, hashCode, isAncestor, isDescendent, isDescendent, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmbFileName

protected SmbFileName(java.lang.String scheme,
                      java.lang.String hostName,
                      int port,
                      java.lang.String userName,
                      java.lang.String password,
                      java.lang.String domain,
                      java.lang.String share,
                      java.lang.String path,
                      FileType type)
Method Detail

getShare

public java.lang.String getShare()
Returns the share name.


appendRootUri

protected void appendRootUri(java.lang.StringBuffer buffer,
                             boolean addPassword)
Builds the root URI for this file name.

Overrides:
appendRootUri in class GenericFileName
Parameters:
buffer - A StringBuffer to use to construct the URI.
addPassword - true if the password should be added, false otherwise.

appendCredentials

protected void appendCredentials(java.lang.StringBuffer buffer,
                                 boolean addPassword)
put domain before username if both are set

Overrides:
appendCredentials in class GenericFileName

createName

public FileName createName(java.lang.String path,
                           FileType type)
Factory method for creating name instances.

Overrides:
createName in class GenericFileName
Parameters:
path - The absolute path.
type - The FileType.
Returns:
The created FileName.

getUriWithoutAuth

public java.lang.String getUriWithoutAuth()
                                   throws FileSystemException
Construct the path suitable for SmbFile when used with NtlmPasswordAuthentication

Throws:
FileSystemException

getDomain

public java.lang.String getDomain()
returns the domain name



Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.