public class

SimplePath

extends Object
implements Path Serializable Comparable<T>
java.lang.Object
   ↳ com.atlassian.stash.content.SimplePath

Summary

Fields
public static final String[] EMPTY
public static final SimplePath ROOT
Public Constructors
SimplePath(Path path)
SimplePath(CharSequence path)
SimplePath(CharSequence path, boolean allowSloshes)
SimplePath(SimplePath aParent, String aPath)
SimplePath(SimplePath aParent, String... aPath)
SimplePath(SimplePath aParent, SimplePath aPath)
SimplePath(SimplePath aParent, String aPath, boolean allowSloshes)
SimplePath(String aParent, SimplePath aPath)
SimplePath(List<String> start)
Public Methods
SimplePath abbreviate(int maxLength)
abbreviate a path by removing path components from the middle until the length of the path (as via .getPath()) is not greater then maxLength.
SimplePath[] abbreviatePathComponents(int maxLength)
Returns a similar result to getPathComponents(), but abbreviates the result (inserts null at the break point)
int compareTo(SimplePath o)
boolean equals(Object o)
SimplePath getCommonRoot(SimplePath other)
String getComponent(int i)
String[] getComponents()
String getExtension()
String getName()
int getNumComponents()
String getParent()
SimplePath getParentPath()
String getPath()
String getPath(boolean caseSensitive)
SimplePath[] getPathComponents()
SimplePath getPathHead()
SimplePath getStripTail(SimplePath other, boolean caseSensitive)
if other is an exact tail of this, return the path leading up to that tail otherwise return null
SimplePath getSubPath(int depth)
String getTail()
SimplePath getTailPath()
boolean hasPrefix(SimplePath p, boolean caseSensitive)
boolean hasPrefix(SimplePath p)
determines if this path begins with all of p
int hashCode()
boolean isAncestor(SimplePath descendant)
boolean isRoot()
static String join(String a, String b)
Intelligently Put a "/" between two strings.
SimplePath simplify()
static String[] split(CharSequence aPath)
static String[] split(CharSequence aPath, boolean allowSloshes)
String toString()
SimplePath trimFirst()
SimplePath trimFirst(int n)
SimplePath trimLast()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.stash.content.Path
From interface java.lang.Comparable

Fields

public static final String[] EMPTY

public static final SimplePath ROOT

Public Constructors

public SimplePath (Path path)

public SimplePath (CharSequence path)

public SimplePath (CharSequence path, boolean allowSloshes)

public SimplePath (SimplePath aParent, String aPath)

public SimplePath (SimplePath aParent, String... aPath)

public SimplePath (SimplePath aParent, SimplePath aPath)

public SimplePath (SimplePath aParent, String aPath, boolean allowSloshes)

public SimplePath (String aParent, SimplePath aPath)

public SimplePath (List<String> start)

Public Methods

public SimplePath abbreviate (int maxLength)

abbreviate a path by removing path components from the middle until the length of the path (as via .getPath()) is not greater then maxLength.

The first and last path component are always in the returned path.

If any path components were removed, an ellipses "..." will appear in the middle

The returned path may in some cases still be greater.

Parameters
maxLength maximum number of characters
Returns
  • an abbreviated path

public SimplePath[] abbreviatePathComponents (int maxLength)

Returns a similar result to getPathComponents(), but abbreviates the result (inserts null at the break point)

public int compareTo (SimplePath o)

public boolean equals (Object o)

public SimplePath getCommonRoot (SimplePath other)

public String getComponent (int i)

public String[] getComponents ()

public String getExtension ()

public String getName ()

public int getNumComponents ()

public String getParent ()

public SimplePath getParentPath ()

public String getPath ()

Returns
  • the string representation of the path

public String getPath (boolean caseSensitive)

public SimplePath[] getPathComponents ()

public SimplePath getPathHead ()

public SimplePath getStripTail (SimplePath other, boolean caseSensitive)

if other is an exact tail of this, return the path leading up to that tail otherwise return null

public SimplePath getSubPath (int depth)

public String getTail ()

Returns
  • a String composed of all the path segments after the first segment

public SimplePath getTailPath ()

public boolean hasPrefix (SimplePath p, boolean caseSensitive)

public boolean hasPrefix (SimplePath p)

determines if this path begins with all of p

public int hashCode ()

public boolean isAncestor (SimplePath descendant)

public boolean isRoot ()

public static String join (String a, String b)

Intelligently Put a "/" between two strings.

public SimplePath simplify ()

public static String[] split (CharSequence aPath)

public static String[] split (CharSequence aPath, boolean allowSloshes)

public String toString ()

public SimplePath trimFirst ()

public SimplePath trimFirst (int n)

Parameters
n number of components to trim

public SimplePath trimLast ()