Class LayeredFileNameParser

java.lang.Object
org.apache.commons.vfs2.provider.AbstractFileNameParser
org.apache.commons.vfs2.provider.LayeredFileNameParser
All Implemented Interfaces:
FileNameParser

public class LayeredFileNameParser extends AbstractFileNameParser
Implementation for layered file systems.

Additionally encodes the '!' character.

  • Field Details

  • Constructor Details

    • LayeredFileNameParser

      public LayeredFileNameParser()
  • Method Details

    • getInstance

      public static LayeredFileNameParser getInstance()
      Returns the Parser.
      Returns:
      The Parser.
    • encodeCharacter

      public boolean encodeCharacter(char ch)
      Determines if a character should be encoded.
      Specified by:
      encodeCharacter in interface FileNameParser
      Overrides:
      encodeCharacter in class AbstractFileNameParser
      Parameters:
      ch - The character to check.
      Returns:
      true if the character should be encoded.
    • parseUri

      public FileName parseUri(VfsComponentContext context, FileName baseFileName, String fileName) throws FileSystemException
      Parses the base and name into a FileName.
      Parameters:
      context - The component context.
      baseFileName - The base FileName.
      fileName - name The target file name.
      Returns:
      The constructed FileName.
      Throws:
      FileSystemException - if an error occurs.
    • extractRootName

      protected String extractRootName(StringBuilder uri)
      Pops the root prefix off a URI, which has had the scheme removed.
      Parameters:
      uri - string builder which gets modified.
      Returns:
      the extracted root name.