Package org.apache.sling.api.resource.path

# Class PathBuilder

java.lang.Object
org.apache.sling.api.resource.path.PathBuilder

public final class PathBuilder extends Object
The `PathBuilder` offers a convenient way of creating a valid path from multiple fragments

Since:
  1.0.0 (Sling API Bundle 2.11.0)

## Constructor Summary

Constructors
Constructor
Description
`PathBuilder(String path)`
Creates a new `PathBuilder` instance

## Method Summary

Modifier and Type
Method
Description
`PathBuilder`
`append(String path)`
Appends a new path fragment
`String`
`toString()`
Returns the path

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### PathBuilder

public PathBuilder(String path)
Creates a new `PathBuilder` instance

Parameters:
  `path` - the initial path

## Method Details

### append

public PathBuilder append(String path)
Appends a new path fragment

Parameters:
  `path` - the path fragment to append
Returns:
  this instance

### toString

public String toString()
Returns the path

Overrides:
  `toString` in class `Object`
Returns:
  the path