|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.vfs.provider.AbstractFileNameParser
org.apache.commons.vfs.provider.HostFileNameParser
public class HostFileNameParser
Implementation for any url based filesystem.
Parses the url into user/password/host/port/path
Does not handle a query string (after ?)
URLFileNameParser for the implementation which also handles the query string too
Nested Class Summary | |
---|---|
protected static class |
HostFileNameParser.Authority
Parsed authority info (scheme, hostname, userinfo, port) |
Constructor Summary | |
---|---|
HostFileNameParser(int defaultPort)
|
Method Summary | |
---|---|
boolean |
encodeCharacter(char ch)
Check if a character needs encoding (%nn). |
protected String |
extractHostName(StringBuffer name)
Extracts the hostname from a URI. |
protected int |
extractPort(StringBuffer name,
String uri)
Extracts the port from a URI. |
protected HostFileNameParser.Authority |
extractToPath(String uri,
StringBuffer name)
Extracts the scheme, userinfo, hostname and port components of a generic URI. |
protected String |
extractUserInfo(StringBuffer name)
Extracts the user info from a URI. |
int |
getDefaultPort()
|
FileName |
parseUri(VfsComponentContext context,
FileName base,
String filename)
parses a String into a filename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HostFileNameParser(int defaultPort)
Method Detail |
---|
public int getDefaultPort()
public boolean encodeCharacter(char ch)
FileNameParser
encodeCharacter
in interface FileNameParser
encodeCharacter
in class AbstractFileNameParser
ch
- the character
public FileName parseUri(VfsComponentContext context, FileName base, String filename) throws FileSystemException
FileNameParser
context
- The component context.base
- The base FileName.filename
- The target file name.
FileSystemException
- if an error occurs parsing the URI.protected HostFileNameParser.Authority extractToPath(String uri, StringBuffer name) throws FileSystemException
uri
- The absolute URI to parse.name
- Used to return the remainder of the URI.
FileSystemException
protected String extractUserInfo(StringBuffer name)
protected String extractHostName(StringBuffer name)
protected int extractPort(StringBuffer name, String uri) throws FileSystemException
FileSystemException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |