Class RepositoryPath

java.lang.Object
org.eclipse.dirigible.repository.api.RepositoryPath

public class RepositoryPath
extends Object
Utility class representing the path object in the Repository.
  • Constructor Details

    • RepositoryPath

      public RepositoryPath​(String path)
      Instantiates a new repository path.
      Parameters:
      path - the path
    • RepositoryPath

      public RepositoryPath​(RepositoryPath repositoryPath)
      Instantiates a new repository path.
      Parameters:
      repositoryPath - the repository path
    • RepositoryPath

      public RepositoryPath​(String... input)
      Instantiates a new repository path.
      Parameters:
      input - the input
  • Method Details

    • getLastSegment

      public String getLastSegment()
      Getter for the last segment.
      Returns:
      the last segment
    • getParentPath

      public RepositoryPath getParentPath()
      Getter for the path of the parent.
      Returns:
      the parent path
    • append

      public RepositoryPath append​(String name)
      Add new segment after the last position.
      Parameters:
      name - the name
      Returns:
      the repository path
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string
    • build

      public String build()
      Builds the.
      Returns:
      the string
    • getPath

      public String getPath()
      Gets the path.
      Returns:
      the path
    • equals

      public boolean equals​(Object obj)
      Equals.
      Overrides:
      equals in class Object
      Parameters:
      obj - the obj
      Returns:
      true, if successful
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int
    • getSegments

      public String[] getSegments()
      Gets the segments.
      Returns:
      the segments
    • constructPathTo

      public String constructPathTo​(int number)
      Construct path to.
      Parameters:
      number - the number
      Returns:
      the string
    • constructPathFrom

      public String constructPathFrom​(int number)
      Construct path from.
      Parameters:
      number - the number
      Returns:
      the string
    • normalizePath

      public static String normalizePath​(String path, String name)
      Normalize path.
      Parameters:
      path - the path
      name - the name
      Returns:
      the string
    • normalizeName

      public static String normalizeName​(String name)
      Normalize name.
      Parameters:
      name - the name
      Returns:
      the string
    • setSegment

      public void setSegment​(int index, String value)
      Set the segment of the given index position to the given value, starting with zero.
      Parameters:
      index - the index
      value - the value