Class LocalFileNameParser
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileNameParser
-
- org.apache.commons.vfs2.provider.local.LocalFileNameParser
-
- All Implemented Interfaces:
FileNameParser
- Direct Known Subclasses:
GenericFileNameParser
,WindowsFileNameParser
public abstract class LocalFileNameParser extends AbstractFileNameParser
A name parser.
-
-
Constructor Summary
Constructors Constructor Description LocalFileNameParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract FileName
createFileName(java.lang.String scheme, java.lang.String rootFile, java.lang.String path, FileType type)
protected abstract java.lang.String
extractRootPrefix(java.lang.String uri, java.lang.StringBuilder name)
Pops the root prefix off a URI, which has had the scheme removed.boolean
isAbsoluteName(java.lang.String name)
Determines if a name is an absolute file name.FileName
parseUri(VfsComponentContext context, FileName base, java.lang.String uri)
parses a String into a filename.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileNameParser
encodeCharacter
-
-
-
-
Constructor Detail
-
LocalFileNameParser
public LocalFileNameParser()
-
-
Method Detail
-
isAbsoluteName
public boolean isAbsoluteName(java.lang.String name)
Determines if a name is an absolute file name.- Parameters:
name
- The file name.- Returns:
- true if the name is absolute, false otherwise.
-
extractRootPrefix
protected abstract java.lang.String extractRootPrefix(java.lang.String uri, java.lang.StringBuilder name) throws FileSystemException
Pops the root prefix off a URI, which has had the scheme removed.- Parameters:
name
- the URI to modify.uri
- the whole URI for error reporting.- Returns:
- the root prefix extracted.
- Throws:
FileSystemException
- if an error occurs.
-
parseUri
public FileName parseUri(VfsComponentContext context, FileName base, java.lang.String uri) throws FileSystemException
Description copied from interface:FileNameParser
parses a String into a filename.- Parameters:
context
- The component context.base
- The base FileName.uri
- The target file name.- Returns:
- A FileName that represents the taret file.
- Throws:
FileSystemException
- if an error occurs parsing the URI.
-
createFileName
protected abstract FileName createFileName(java.lang.String scheme, java.lang.String rootFile, java.lang.String path, FileType type)
-
-