Class SmbFileName

  • All Implemented Interfaces:
    Comparable<org.apache.commons.vfs2.FileName>, org.apache.commons.vfs2.FileName

    public class SmbFileName
    extends org.apache.commons.vfs2.provider.GenericFileName
    An SMB URI. Adds a share name to the generic URI.
    • Field Summary

      • Fields inherited from interface org.apache.commons.vfs2.FileName

        EMPTY_ARRAY, ROOT_PATH, SEPARATOR, SEPARATOR_CHAR
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void appendCredentials​(StringBuilder buffer, boolean addPassword)
      Put domain before @{code username} if both are set.
      protected void appendRootUri​(StringBuilder buffer, boolean addPassword)
      Builds the root URI for this file name.
      org.apache.commons.vfs2.FileName createName​(String path, org.apache.commons.vfs2.FileType type)
      Factory method for creating name instances.
      String getDomain()
      Returns the domain name.
      String getShare()
      Returns the share name.
      String getUriWithoutAuth()
      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
    • Constructor Detail

    • 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:
        appendRootUri in class org.apache.commons.vfs2.provider.GenericFileName
      • appendCredentials

        protected void appendCredentials​(StringBuilder buffer,
                                         boolean addPassword)
        Put domain before @{code username} if both are set.

        Uses super method to add password or password placeholder.

        Overrides:
        appendCredentials in class org.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:
        createName in class org.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