com.rapidminer.repository
Class RepositoryLocation

java.lang.Object
  extended by com.rapidminer.repository.RepositoryLocation

public class RepositoryLocation
extends java.lang.Object

A location in a repository. Format: //Repository/path/to/object All constructors throw IllegalArugmentExceptions if names are malformed, contain illegal characters etc.

Author:
Simon Fischer

Field Summary
static java.lang.String REPOSITORY_PREFIX
           
static char SEPARATOR
           
 
Constructor Summary
RepositoryLocation(RepositoryLocation parent, java.lang.String childName)
          Appends a child entry to a given parent location.
RepositoryLocation(java.lang.String absoluteLocation)
          Constructs a RepositoryLocation from a string of the form //Repository/path/to/object.
RepositoryLocation(java.lang.String repositoryName, java.lang.String[] pathComponents)
          Creates a RepositoryLocation for a given repository and a set of path components which will be concatenated by a /.
 
Method Summary
 Folder createFoldersRecursively()
          Creates this folder and its parents.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAbsoluteLocation()
          Returns the absolute location of this RepoositoryLocation.
 RepositoryAccessor getAccessor()
           
 java.lang.String getName()
          Returns the last path component.
 java.lang.String getPath()
          Returns the path within the repository.
 Repository getRepository()
          Returns the repository associated with this location.
 java.lang.String getRepositoryName()
          Returns the name of the repository associated with this location.
 int hashCode()
           
static boolean isAbsolute(java.lang.String loc)
           
 Entry locateEntry()
          Locates the corresponding entry in the repository.
 java.lang.String makeRelative(RepositoryLocation relativeToFolder)
          Assume absoluteLocation == "//MyRepos/foo/bar/object" and relativeToFolder=//MyRepos/foo/baz/, then this method will return ..
 RepositoryLocation parent()
           
 void setAccessor(RepositoryAccessor accessor)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

public static final char SEPARATOR
See Also:
Constant Field Values

REPOSITORY_PREFIX

public static final java.lang.String REPOSITORY_PREFIX
See Also:
Constant Field Values
Constructor Detail

RepositoryLocation

public RepositoryLocation(java.lang.String absoluteLocation)
                   throws MalformedRepositoryLocationException
Constructs a RepositoryLocation from a string of the form //Repository/path/to/object.

Throws:
MalformedRepositoryLocationException

RepositoryLocation

public RepositoryLocation(java.lang.String repositoryName,
                          java.lang.String[] pathComponents)
                   throws MalformedRepositoryLocationException
Creates a RepositoryLocation for a given repository and a set of path components which will be concatenated by a /.

Throws:
MalformedRepositoryLocationException

RepositoryLocation

public RepositoryLocation(RepositoryLocation parent,
                          java.lang.String childName)
                   throws MalformedRepositoryLocationException
Appends a child entry to a given parent location. Child can be composed of subcomponents separated by /. Dots ("..") will resolve to the parent folder.

Throws:
MalformedRepositoryLocationException
Method Detail

getAbsoluteLocation

public java.lang.String getAbsoluteLocation()
Returns the absolute location of this RepoositoryLocation.


getRepository

public Repository getRepository()
                         throws RepositoryException
Returns the repository associated with this location.

Throws:
RepositoryException

getRepositoryName

public java.lang.String getRepositoryName()
Returns the name of the repository associated with this location.


getPath

public java.lang.String getPath()
Returns the path within the repository.


locateEntry

public Entry locateEntry()
                  throws RepositoryException
Locates the corresponding entry in the repository.

Throws:
RepositoryException

getName

public java.lang.String getName()
Returns the last path component.


parent

public RepositoryLocation parent()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

makeRelative

public java.lang.String makeRelative(RepositoryLocation relativeToFolder)
Assume absoluteLocation == "//MyRepos/foo/bar/object" and relativeToFolder=//MyRepos/foo/baz/, then this method will return ../bar/object.


isAbsolute

public static boolean isAbsolute(java.lang.String loc)

createFoldersRecursively

public Folder createFoldersRecursively()
                                throws RepositoryException
Creates this folder and its parents.

Throws:
RepositoryException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setAccessor

public void setAccessor(RepositoryAccessor accessor)

getAccessor

public RepositoryAccessor getAccessor()


Copyright © 2001-2009 by Rapid-I