Package org.apache.commons.vfs2.provider
Class GenericURLFileNameParser
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileNameParser
-
- org.apache.commons.vfs2.provider.HostFileNameParser
-
- org.apache.commons.vfs2.provider.GenericURLFileNameParser
-
- All Implemented Interfaces:
FileNameParser
- Direct Known Subclasses:
Http4FileNameParser
,Http4sFileNameParser
public class GenericURLFileNameParser extends HostFileNameParser
Generic implementation for any url based file system, without depending a specific library.Parses the url into user/password/host/port/path/queryString.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.commons.vfs2.provider.HostFileNameParser
HostFileNameParser.Authority
-
-
Constructor Summary
Constructors Constructor Description GenericURLFileNameParser(int defaultPort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
encodeCharacter(char ch)
Check if a character needs encoding (%nn).FileName
parseUri(VfsComponentContext context, FileName base, java.lang.String fileName)
Parses a String into a file name.-
Methods inherited from class org.apache.commons.vfs2.provider.HostFileNameParser
extractHostName, extractPort, extractToPath, extractToPath, extractUserInfo, getDefaultPort
-
-
-
-
Method Detail
-
encodeCharacter
public boolean encodeCharacter(char ch)
Description copied from interface:FileNameParser
Check if a character needs encoding (%nn).- Specified by:
encodeCharacter
in interfaceFileNameParser
- Overrides:
encodeCharacter
in classAbstractFileNameParser
- Parameters:
ch
- the character- Returns:
- true if character should be encoded
-
parseUri
public FileName parseUri(VfsComponentContext context, FileName base, java.lang.String fileName) throws FileSystemException
Description copied from interface:FileNameParser
Parses a String into a file name.- Specified by:
parseUri
in interfaceFileNameParser
- Overrides:
parseUri
in classHostFileNameParser
- Parameters:
context
- The component context.base
- The base FileName.fileName
- The target file name.- Returns:
- A FileName that represents the taret file.
- Throws:
FileSystemException
- if an error occurs parsing the URI.
-
-