|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gradle.api.file.RelativePath
public class RelativePath
Represents a relative path from some base directory to a file. Used in file copying to represent both a source and target file path when copying files.
RelativePath instances are immutable.
| Constructor Summary | |
|---|---|
RelativePath(boolean endsWithFile,
String... segments)
Creates a RelativePath. |
|
| Method Summary | |
|---|---|
RelativePath |
append(boolean endsWithFile,
String... segments)
Appends the given names to the end of this path. |
RelativePath |
append(RelativePath other)
Appends the given path to the end of this path. |
boolean |
equals(Object o)
|
File |
getFile(File baseDir)
|
String |
getLastName()
|
RelativePath |
getParent()
Returns the parent of this path. |
String |
getPathString()
|
String[] |
getSegments()
|
int |
hashCode()
|
boolean |
isFile()
|
static RelativePath |
parse(boolean isFile,
RelativePath parent,
String path)
|
static RelativePath |
parse(boolean isFile,
String path)
|
RelativePath |
plus(RelativePath other)
Appends the given path to the end of this path. |
RelativePath |
prepend(String... segments)
Prepends the given names to the start of this path. |
RelativePath |
replaceLastName(String name)
Returns a copy of this path, with the last name replaced with the given name. |
ListIterator<String> |
segmentIterator()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RelativePath(boolean endsWithFile,
String... segments)
RelativePath.
endsWithFile - - if true, the path ends with a file, otherwise a directory| Method Detail |
|---|
public String[] getSegments()
public ListIterator<String> segmentIterator()
public boolean isFile()
public String getPathString()
public File getFile(File baseDir)
public String getLastName()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic RelativePath getParent()
public static RelativePath parse(boolean isFile,
String path)
public static RelativePath parse(boolean isFile,
RelativePath parent,
String path)
public RelativePath replaceLastName(String name)
Returns a copy of this path, with the last name replaced with the given name.
name - The name.
public RelativePath append(RelativePath other)
Appends the given path to the end of this path.
other - The path to append
public RelativePath plus(RelativePath other)
Appends the given path to the end of this path.
other - The path to append
public RelativePath append(boolean endsWithFile,
String... segments)
segments - The names to append.endsWithFile - when true, the new path refers to a file.
public RelativePath prepend(String... segments)
segments - The names to prepend
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||