FileNameParser
FtpFileNameParser
, URLFileNameParser
public class HostFileNameParser extends AbstractFileNameParser
URLFileNameParser for the implementation which also handles the query string too
Modifier and Type | Class | Description |
---|---|---|
protected static class |
HostFileNameParser.Authority |
Parsed authority info (scheme, hostname, userinfo, port)
|
Constructor | Description |
---|---|
HostFileNameParser(int defaultPort) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
encodeCharacter(char ch) |
Check if a character needs encoding (%nn)
|
protected java.lang.String |
extractHostName(java.lang.StringBuffer name) |
Extracts the hostname from a URI.
|
protected int |
extractPort(java.lang.StringBuffer name,
java.lang.String uri) |
Extracts the port from a URI.
|
protected HostFileNameParser.Authority |
extractToPath(java.lang.String uri,
java.lang.StringBuffer name) |
Extracts the scheme, userinfo, hostname and port components of a
generic URI.
|
protected java.lang.String |
extractUserInfo(java.lang.StringBuffer name) |
Extracts the user info from a URI.
|
int |
getDefaultPort() |
|
FileName |
parseUri(VfsComponentContext context,
FileName base,
java.lang.String filename) |
parses a String into a filename
|
public int getDefaultPort()
public boolean encodeCharacter(char ch)
FileNameParser
encodeCharacter
in interface FileNameParser
encodeCharacter
in class AbstractFileNameParser
ch
- the characterpublic FileName parseUri(VfsComponentContext context, FileName base, java.lang.String filename) throws FileSystemException
FileNameParser
FileSystemException
protected HostFileNameParser.Authority extractToPath(java.lang.String uri, java.lang.StringBuffer name) throws FileSystemException
uri
- The absolute URI to parse.name
- Used to return the remainder of the URI.FileSystemException
protected java.lang.String extractUserInfo(java.lang.StringBuffer name)
protected java.lang.String extractHostName(java.lang.StringBuffer name)
protected int extractPort(java.lang.StringBuffer name, java.lang.String uri) throws FileSystemException
FileSystemException