Package org.apache.commons.vfs2.provider
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 filesystems.Additionally encodes the '!' character.
-
-
Constructor Summary
Constructors Constructor Description LayeredFileNameParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
encodeCharacter(char ch)
Determines if a character should be encoded.protected java.lang.String
extractRootName(java.lang.StringBuilder uri)
Pops the root prefix off a URI, which has had the scheme removed.static LayeredFileNameParser
getInstance()
Return the Parser.FileName
parseUri(VfsComponentContext context, FileName base, java.lang.String filename)
Parse the base and name into a FileName.
-
-
-
Constructor Detail
-
LayeredFileNameParser
public LayeredFileNameParser()
-
-
Method Detail
-
getInstance
public static LayeredFileNameParser getInstance()
Return the Parser.- Returns:
- The Parser.
-
encodeCharacter
public boolean encodeCharacter(char ch)
Determines if a character should be encoded.- Specified by:
encodeCharacter
in interfaceFileNameParser
- Overrides:
encodeCharacter
in classAbstractFileNameParser
- Parameters:
ch
- The character to check.- Returns:
- true if the character should be encoded.
-
parseUri
public FileName parseUri(VfsComponentContext context, FileName base, java.lang.String filename) throws FileSystemException
Parse the base and name into a FileName.- Parameters:
context
- The component context.base
- The base FileName.filename
- The target file name.- Returns:
- The constructed FileName.
- Throws:
FileSystemException
- if an error occurs.
-
extractRootName
protected java.lang.String extractRootName(java.lang.StringBuilder uri) throws FileSystemException
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.
- Throws:
FileSystemException
- if error occurs.
-
-