Class UrlFileNameParser

  • All Implemented Interfaces:
    FileNameParser

    public class UrlFileNameParser
    extends AbstractFileNameParser
    Implementation for any java.net.url based filesystem.
    Composite of URLFilenameParser and GenericFilenameParser
    Version:
    $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Wed, 29 Nov 2006) $
    Author:
    imario@apache.org
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int countSlashes​(java.lang.String filename)
      This method counts the slashes after the scheme.
      boolean encodeCharacter​(char ch)
      Check if a character needs encoding (%nn)
      protected boolean isUrlBased​(FileName base, java.lang.String filename)
      Guess is the given filename is a url with host or not.
      FileName parseUri​(VfsComponentContext context, FileName base, java.lang.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

      • UrlFileNameParser

        public UrlFileNameParser()
    • Method Detail

      • isUrlBased

        protected boolean isUrlBased​(FileName base,
                                     java.lang.String filename)
        Guess is the given filename is a url with host or not. VFS treats such urls differently.
        A filename is url-based if the base is a URLFileName or there are only 2 slashes after the scheme.
        e.g: http://host/path, file:/path/to/file, file:///path/to/file
      • countSlashes

        protected int countSlashes​(java.lang.String filename)
        This method counts the slashes after the scheme.
        Parameters:
        filename -
        Returns:
        nuof slashes