org.wso2.carbon.registry.core
Class ResourcePath

java.lang.Object
  extended by org.wso2.carbon.registry.core.ResourcePath

public class ResourcePath
extends java.lang.Object

This class represents resource paths used inside the embedded registry. i.e. paths in the form /c1/c2/r1;version:2;view:1


Constructor Summary
ResourcePath(java.lang.String rawPath)
          Create a resource path with a row path.
 
Method Summary
 void appendPath(java.lang.String pathToAppend)
          Append a component to the current path.
 java.lang.String getCompletePath()
          Return the complete path.
 java.lang.String getParameterValue(java.lang.String key)
          Get the parameter value.
 java.lang.String getPath()
          Return the path component, without any parameters.
 java.lang.String getPathWithVersion()
          Return the path with version, if there is no version, just return the path.
 boolean isCurrentVersion()
          Check whether the path is not a version-ed path.
 boolean parameterExists(java.lang.String key)
          Check whether a parameter with the provided key exist.
 void setParameter(java.lang.String key, java.lang.String value)
          Set the parameter.
 java.lang.String toString()
          The path to string, same as getCompletePath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourcePath

public ResourcePath(java.lang.String rawPath)
Create a resource path with a row path.

Parameters:
rawPath - the raw path.
Method Detail

getCompletePath

public java.lang.String getCompletePath()
Return the complete path.

Returns:
the complete path.

getPath

public java.lang.String getPath()
Return the path component, without any parameters. (the path component before the ';' token).

Returns:
the path value.

parameterExists

public boolean parameterExists(java.lang.String key)
Check whether a parameter with the provided key exist.

Parameters:
key - the parameter key.
Returns:
true, if the parameter exists, false otherwise.

getParameterValue

public java.lang.String getParameterValue(java.lang.String key)
Get the parameter value.

Parameters:
key - the parameter key.
Returns:
the parameter value.

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Set the parameter.

Parameters:
key - the parameter key.
value - the parameter value.

appendPath

public void appendPath(java.lang.String pathToAppend)
Append a component to the current path.

Parameters:
pathToAppend - the path to append.

isCurrentVersion

public boolean isCurrentVersion()
Check whether the path is not a version-ed path.

Returns:
true, if it is a non-version-ed path, false otherwise.

getPathWithVersion

public java.lang.String getPathWithVersion()
Return the path with version, if there is no version, just return the path.

Returns:
the path with the version.

toString

public java.lang.String toString()
The path to string, same as getCompletePath

Overrides:
toString in class java.lang.Object
Returns:
the string value of the path.


Copyright © 2011 WSO2 Inc. All Rights Reserved.