Class GenericFileNameParser
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileNameParser
-
- org.apache.commons.vfs2.provider.local.LocalFileNameParser
-
- org.apache.commons.vfs2.provider.local.GenericFileNameParser
-
- All Implemented Interfaces:
FileNameParser
- Direct Known Subclasses:
ResourceFileNameParser
public class GenericFileNameParser extends LocalFileNameParser
A general-purpose file name parser.
-
-
Constructor Summary
Constructors Constructor Description GenericFileNameParser()
Constructs a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileName
createFileName(java.lang.String scheme, java.lang.String rootFile, java.lang.String path, FileType type)
Creates a FileName.protected java.lang.String
extractRootPrefix(java.lang.String uri, java.lang.StringBuilder name)
Extracts the root prefix from a URI string, which has had the scheme removed.static GenericFileNameParser
getInstance()
Gets the singleton instance, never null.-
Methods inherited from class org.apache.commons.vfs2.provider.local.LocalFileNameParser
isAbsoluteName, parseUri
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileNameParser
encodeCharacter
-
-
-
-
Constructor Detail
-
GenericFileNameParser
public GenericFileNameParser()
Constructs a new instance.
-
-
Method Detail
-
getInstance
public static GenericFileNameParser getInstance()
Gets the singleton instance, never null.- Returns:
- the singleton instance.
-
createFileName
protected FileName createFileName(java.lang.String scheme, java.lang.String rootFile, java.lang.String path, FileType type)
Description copied from class:LocalFileNameParser
Creates a FileName.- Specified by:
createFileName
in classLocalFileNameParser
- Parameters:
scheme
- The scheme.rootFile
- the root file.path
- the path.type
- the file type.- Returns:
- a FileName.
-
extractRootPrefix
protected java.lang.String extractRootPrefix(java.lang.String uri, java.lang.StringBuilder name) throws FileSystemException
Extracts the root prefix from a URI string, which has had the scheme removed.- Specified by:
extractRootPrefix
in classLocalFileNameParser
- Parameters:
uri
- the whole URI for error reporting.name
- the URI to modify.- Returns:
- the root prefix extracted.
- Throws:
FileSystemException
- if an error occurs.
-
-