Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.vfs.provider
Class UriParser

    java.lang.Object
      org.apache.commons.vfs.provider.UriParser

public final class UriParser
extends Object

Utilities for dealing with URIs. See RFC 2396 for details.

Version:
  $Revision: 480428 $ $Date: 2005-10-13 21:11:33 +0200 (Do, 13 Okt 2005) $
Author:
  Adam Murdoch

Field Summary
`static char` | `TRANS_SEPARATOR` The set of valid separators.

Method Summary
`static void` | `appendEncoded(StringBuffer buffer, String unencodedValue, char[] reserved)` Encodes and appends a string to a StringBuffer.
`static void` | `canonicalizePath(StringBuffer buffer, int offset, int length, FileNameParser fileNameParser)`
`static void` | `checkUriEncoding(String uri)`
`static String` | `decode(String encodedStr)` Removes %nn encodings from a string.
`static void` | `decode(StringBuffer buffer, int offset, int length)` Removes %nn encodings from a string.
`static String` | `encode(String decodedStr)` Removes %nn encodings from a string.
`static String[]` | `encode(String[] strings)`
`static void` | `encode(StringBuffer buffer, int offset, int length, char[] reserved)` Encodes a set of reserved characters in a StringBuffer, using the URI %nn encoding.
`static String` | `encode(String decodedStr, char[] reserved)`
`static String` | `extractFirstElement(StringBuffer name)` Extracts the first element of a path.
`static String` | `extractQueryString(StringBuffer name)`
`static String` | `extractScheme(String uri)` Extracts the scheme from a URI.
`static String` | `extractScheme(String uri, StringBuffer buffer)` Extracts the scheme from a URI.
`static boolean` | `fixSeparators(StringBuffer name)` Normalises the separators in a name.
`static FileType` | `normalisePath(StringBuffer path)` Normalises a path.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRANS_SEPARATOR

    public static final char TRANS_SEPARATOR

  The set of valid separators. These are all converted to the normalised one. Does not contain the normalised separator

  See Also:
    Constant Field Values

Method Detail

### extractFirstElement

    public static String extractFirstElement(StringBuffer name)

  Extracts the first element of a path.

### normalisePath

    public static FileType normalisePath(StringBuffer path)
                                  throws FileSystemException

  Normalises a path. Does the following:
  - Removes empty path elements.
  - Handles '.' and '..' elements.
  - Removes trailing separator.
  Its assumed that the separators are already fixed.

  Throws:
    `FileSystemException`
  See Also:
    `fixSeparators(java.lang.StringBuffer)`

### fixSeparators

    public static boolean fixSeparators(StringBuffer name)

  Normalises the separators in a name.

### extractScheme

    public static String extractScheme(String uri)

  Extracts the scheme from a URI.

  Parameters:
    `uri` - The URI.
  Returns:
    The scheme name. Returns null if there is no scheme.

### extractScheme

    public static String extractScheme(String uri,
                                       StringBuffer buffer)

  Extracts the scheme from a URI. Removes the scheme and ':' delimiter from the front of the URI.

  Parameters:
    `uri` - The URI.
    `buffer` - Returns the remainder of the URI.
  Returns:
    The scheme name. Returns null if there is no scheme.

### decode

    public static String decode(String encodedStr)
                         throws FileSystemException

  Removes %nn encodings from a string.

  Throws:
    `FileSystemException`

### decode

    public static void decode(StringBuffer buffer,
                              int offset,
                              int length)
                       throws FileSystemException

  Removes %nn encodings from a string.

  Throws:
    `FileSystemException`

### appendEncoded

    public static void appendEncoded(StringBuffer buffer,
                                     String unencodedValue,
                                     char[] reserved)

  Encodes and appends a string to a StringBuffer.

### encode

    public static void encode(StringBuffer buffer,
                              int offset,
                              int length,
                              char[] reserved)

  Encodes a set of reserved characters in a StringBuffer, using the URI %nn encoding. Always encodes % characters.

### encode

    public static String encode(String decodedStr)

  Removes %nn encodings from a string.

### encode

    public static String encode(String decodedStr,
                                char[] reserved)

### encode

    public static String[] encode(String[] strings)

### checkUriEncoding

    public static void checkUriEncoding(String uri)
                                 throws FileSystemException

  Throws:
    `FileSystemException`

### canonicalizePath

    public static void canonicalizePath(StringBuffer buffer,
                                        int offset,
                                        int length,
                                        FileNameParser fileNameParser)
                                 throws FileSystemException

  Throws:
    `FileSystemException`

### extractQueryString

    public static String extractQueryString(StringBuffer name)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2006 The Apache Software Foundation. All Rights Reserved.