org.apache.commons.vfs2.provider
Class URLFileNameParser
java.lang.Object
org.apache.commons.vfs2.provider.AbstractFileNameParser
org.apache.commons.vfs2.provider.HostFileNameParser
org.apache.commons.vfs2.provider.URLFileNameParser
- All Implemented Interfaces:
- FileNameParser
- Direct Known Subclasses:
- HttpFileNameParser, HttpsFileNameParser, SftpFileNameParser
public class URLFileNameParser
- extends HostFileNameParser
Implementation for any url based filesystem.
Parses the url into user/password/host/port/path/queryString
- Author:
- Commons VFS team
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLFileNameParser
public URLFileNameParser(int defaultPort)
encodeCharacter
public boolean encodeCharacter(char ch)
- Description copied from interface:
FileNameParser
- Check if a character needs encoding (%nn).
- Specified by:
encodeCharacter
in interface FileNameParser
- Overrides:
encodeCharacter
in class HostFileNameParser
- Parameters:
ch
- the character
- Returns:
- true if character should be encoded
parseUri
public FileName parseUri(VfsComponentContext context,
FileName base,
String filename)
throws FileSystemException
- Description copied from interface:
FileNameParser
- parses a String into a filename.
- Specified by:
parseUri
in interface FileNameParser
- Overrides:
parseUri
in class HostFileNameParser
- 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.
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.