|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gradle.api.file.RelativePath
public class RelativePath extends java.lang.Object
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, java.lang.String... segments)
Creates a RelativePath. |
Method Summary | |
---|---|
RelativePath
|
append(RelativePath other)
|
RelativePath
|
append(boolean endsWithFile, java.lang.String... segments)
Appends the given names to the end of this path. |
boolean
|
equals(java.lang.Object o)
|
java.io.File
|
getFile(java.io.File baseDir)
|
java.lang.String
|
getLastName()
|
RelativePath
|
getParent()
Returns the parent of this path. |
java.lang.String
|
getPathString()
|
java.lang.String[]
|
getSegments()
|
int
|
hashCode()
|
boolean
|
isFile()
|
static RelativePath
|
parse(boolean isFile, java.lang.String path)
|
static RelativePath
|
parse(boolean isFile, RelativePath parent, java.lang.String path)
|
RelativePath
|
plus(RelativePath other)
|
RelativePath
|
prepend(java.lang.String... segments)
Prepends the given names to the start of this path. |
RelativePath
|
replaceLastName(java.lang.String name)
|
java.util.ListIterator
|
segmentIterator()
|
java.lang.String
|
toString()
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public RelativePath(boolean endsWithFile, java.lang.String... segments)
endsWithFile
- - if true, the path ends with a file, otherwise a directory
Method Detail |
---|
public RelativePath append(RelativePath other)
Appends the given path to the end of this path.
other
- The path to append
public RelativePath append(boolean endsWithFile, java.lang.String... segments)
segments
- The names to append.endsWithFile
- when true, the new path refers to a file.
@Override public boolean equals(java.lang.Object o)
public java.io.File getFile(java.io.File baseDir)
public java.lang.String getLastName()
public RelativePath getParent()
public java.lang.String getPathString()
public java.lang.String[] getSegments()
@Override public int hashCode()
public boolean isFile()
public static RelativePath parse(boolean isFile, java.lang.String path)
public static RelativePath parse(boolean isFile, RelativePath parent, java.lang.String path)
public RelativePath plus(RelativePath other)
Appends the given path to the end of this path.
other
- The path to append
public RelativePath prepend(java.lang.String... segments)
segments
- The names to prepend
public RelativePath replaceLastName(java.lang.String name)
Returns a copy of this path, with the last name replaced with the given name.
name
- The name.
public java.util.ListIterator segmentIterator()
@Override public java.lang.String toString()
Groovy Documentation