public class

SimplePath

extends Object
implements Path Serializable Comparable<T>
java.lang.Object
   ↳ com.atlassian.bitbucket.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)
Abbreviates the path by removing path components from the middle until the length of the path is not greater than 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)
@Nonnull String[] getComponents()
String getExtension()
@Nonnull String getName()
int getNumComponents()
String getParent()
SimplePath getParentPath()
String getPath(boolean caseSensitive)
String getPath()
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)
determines if this path begins with all of p
boolean hasPrefix(SimplePath p, boolean caseSensitive)
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)
@Nonnull String toString()
SimplePath trimFirst()
SimplePath trimFirst(int n)
SimplePath trimLast()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.bitbucket.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)

Abbreviates the path by removing path components from the middle until the length of the path is not greater than maxLength.

The first and last path component are always in the returned path. If any path components are removed, an ellipses ("...") will appear in the middle. The returned path may in some cases still be greater than the specified maxLength.

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)

@Nonnull public String[] getComponents ()

public String getExtension ()

@Nonnull public String getName ()

public int getNumComponents ()

public String getParent ()

public SimplePath getParentPath ()

public String getPath (boolean caseSensitive)

public String getPath ()

Returns
  • the string representation of the path

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)

determines if this path begins with all of p

public boolean hasPrefix (SimplePath p, boolean caseSensitive)

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.

Parameters
a first path component
b second path component
Returns
  • merged path

public SimplePath simplify ()

public static String[] split (CharSequence aPath)

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

@Nonnull public String toString ()

public SimplePath trimFirst ()

public SimplePath trimFirst (int n)

Parameters
n number of components to trim

public SimplePath trimLast ()