***  This API provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.information.metadata
Class PathUrl

java.lang.Object
  |
  +--com.sas.services.information.metadata.PathUrl
All Implemented Interfaces:

public class PathUrl
extends Object
implements java.io.Serializable

This class encapsulates the SBIP formatted URL. IT has a protocol of SBIP, and has a repository name, a root tree name, the path, the entity name, and the type. Instances can be set as write-protected, so the URL can't be changed out from under an object that may be using it to represent a specific entity in the repository. The clone method can be used to create a copy of an instance that can be modified.

See Also:
Serialized Form

Constructor Summary
PathUrl(String url)
          Construct a new PathUrl from a URL string.
PathUrl(String repository, String rootTree, String path, String name, String type)
          Construct a new PathUrl from the URL components.
 
Method Summary
 Object clone()
          Create a copy of this object.
 String getName()
          Get the name of the object.
 String getPath()
          Get the path for this object.
 String getRepository()
          Get the string with the repository name.
 String getRootTree()
          Get the name of the root Tree for this item.
 String getType()
          Get the type of the object.
 boolean isWritable()
          Return the flag indicating if this instance is write-protected.
 void setName(String name)
          Set the name of the object.
 void setPath(String path)
          Set the path from the root folder to the object.
 void setRepository(String repository)
          Set the name of the repository for this object.
 void setRootTree(String tree)
          Set the root tree for this item.
 void setType(String type)
          Set the type for the object.
 void setUnwritable()
          Make this instance write-protected.
 String toString()
          Return the string representation of this URL.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathUrl

public PathUrl(String url)
Construct a new PathUrl from a URL string. A valid string must start with "SBIP://", have a repository name, a root tree name, and an entity name. It may also have a path, and a type.

Parameters:
url - A string of the form SBIP://repository/root[/path]/name[(type)]

PathUrl

public PathUrl(String repository,
               String rootTree,
               String path,
               String name,
               String type)
Construct a new PathUrl from the URL components.

Parameters:
repository - The name of the repository the entity resides in.
rootTree - The name of the tree where the entity resides.
path - The path to the object.
type - The type string for the object.
Method Detail

clone

public Object clone()
Create a copy of this object. The new object will be writable.

Overrides:
clone in class Object
Returns:
a copy of this PathUrl instance.

isWritable

public boolean isWritable()
Return the flag indicating if this instance is write-protected.

Returns:
True if the instance is writable, false otherwise.

setUnwritable

public void setUnwritable()
Make this instance write-protected. No updates will be allowed to this instance. This can't be undone. Once this flag is set, it's set for the life of the object. If you need to update it, create a copy using the clone() method and update that instance.

getRepository

public String getRepository()
Get the string with the repository name.

Returns:
The name of the repository where this object resides.

setRepository

public void setRepository(String repository)
Set the name of the repository for this object.

Parameters:
repository - The name of the repository this object resides in.
Throws:
IllegalStateException - If the instance is write-protected.

getRootTree

public String getRootTree()
Get the name of the root Tree for this item.

Returns:
The name of the root Tree for this entity.

setRootTree

public void setRootTree(String tree)
Set the root tree for this item.

Parameters:
tree - The root tree name under which this item resides.
Throws:
IllegalStateException - if the instance is write-protected.

getPath

public String getPath()
Get the path for this object. This may be null if the object is in a root folder.

Returns:
The path from the root folder to the object.

setPath

public void setPath(String path)
Set the path from the root folder to the object. It is valid for this to be null if the object is in the root folder.
Parameters:
path - The path of the object.
Throws:
IllegalStateException - If the instance is write-protected.

getName

public String getName()
Get the name of the object.

Returns:
The string representing the name of the object in the repository.

setName

public void setName(String name)
Set the name of the object.

Parameters:
name - The repository name of the object
Throws:
IllegalStateException - If the instance is write-protected.

getType

public String getType()
Get the type of the object. This should be a "smart object" type if one exists for the object.

Returns:
The type of the object.

setType

public void setType(String type)
Set the type for the object.

Parameters:
type - The type for the object.
Throws:
IllegalStateException - If the instance is write-protected.

toString

public String toString()
Return the string representation of this URL.
Overrides:
toString in class Object

***  This API provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:28:59