Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.servlet.servlets
Class Path  view Path download Path.java

java.lang.Object
  extended byorg.enhydra.servlet.servlets.Path

class Path
extends java.lang.Object

Utility class to help manipulate paths. Method cleans up multiple '/' or '\' when constructing the object and prevents adding additional '/' or '\' when appending paths. For the purposes of this class a 'UrlPath' is a path with the path separators character of '/', regardless of platform; A 'FilePath' is a path with system dependent path separators characters (UNIX - '/' DOS - '\').

Version:
$Revision: 1.4.12.1 $

Field Summary
private  java.lang.String path
           
 
Constructor Summary
(package private) Path(java.lang.String p)
          Constructs a Path Object based on String p.
(package private) Path(java.lang.String p1, java.lang.String p2)
          Constructs a Path Object as by appending p2 to the end of p1.
 
Method Summary
 java.lang.String appendFilePath(java.lang.String p)
          Appends a path to the end of this object, and returns a string representing the new File path without changing the this object.
private  java.lang.String appendPath(java.lang.String p)
           
 java.lang.String appendUrlPath(java.lang.String p)
          Appends a path to the end of this object, and returns a string representing the new Url path without changing the this object.
private  java.lang.String cleanUpPath(java.lang.String p)
           
 java.lang.String getFilePath()
          Converts the Path object to 'FilePath' format.
 java.lang.String getUrlPath()
          Converts the Path object to 'UrlPath' format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

path

private java.lang.String path
Constructor Detail

Path

Path(java.lang.String p)
Constructs a Path Object based on String p.


Path

Path(java.lang.String p1,
     java.lang.String p2)
Constructs a Path Object as by appending p2 to the end of p1.

Method Detail

getUrlPath

public java.lang.String getUrlPath()
Converts the Path object to 'UrlPath' format. 'UrlPath' is a path with the path separators character of '/', regardless of platform.


getFilePath

public java.lang.String getFilePath()
Converts the Path object to 'FilePath' format. A 'FilePath' is a path with system dependent path separators characters (UNIX - '/' DOS - '\').


appendUrlPath

public java.lang.String appendUrlPath(java.lang.String p)
Appends a path to the end of this object, and returns a string representing the new Url path without changing the this object.


appendFilePath

public java.lang.String appendFilePath(java.lang.String p)
Appends a path to the end of this object, and returns a string representing the new File path without changing the this object.


appendPath

private java.lang.String appendPath(java.lang.String p)

cleanUpPath

private java.lang.String cleanUpPath(java.lang.String p)