org.apache.commons.vfs.provider
Class LayeredFileNameParser

java.lang.Object
  extended by org.apache.commons.vfs.provider.AbstractFileNameParser
      extended by org.apache.commons.vfs.provider.LayeredFileNameParser
All Implemented Interfaces:
FileNameParser

public class LayeredFileNameParser
extends AbstractFileNameParser

Implementation for layered filesystems.

Additionally encodes the '!' character.

Author:
Commons VFS team

Constructor Summary
LayeredFileNameParser()
           
 
Method Summary
 boolean encodeCharacter(char ch)
          Determines if a character should be encoded.
protected  String extractRootName(StringBuffer 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, String filename)
          Parse the base and name into a FileName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 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 base,
                         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 String extractRootName(StringBuffer uri)
                          throws FileSystemException
Pops the root prefix off a URI, which has had the scheme removed.

Throws:
FileSystemException


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