Package org.gradle.api.file
Klasse RelativePath
java.lang.Object
org.gradle.api.file.RelativePath
- Alle implementierten Schnittstellen:
Serializable,CharSequence,Comparable<RelativePath>
public class RelativePath
extends Object
implements Serializable, Comparable<RelativePath>, CharSequence
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.
- Siehe auch:
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRelativePath(boolean endsWithFile, String... segments) Creates aRelativePath. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungAppends the given names to the end of this path.append(RelativePath other) Appends the given path to the end of this path.charcharAt(int index) intbooleanReturns the parent of this path.String[]inthashCode()booleanisFile()intlength()static RelativePathstatic RelativePathparse(boolean isFile, RelativePath parent, String path) plus(RelativePath other) Appends the given path to the end of this path.Prepends the given names to the start of this path.replaceLastName(String name) Returns a copy of this path, with the last name replaced with the given name.subSequence(int start, int end) toString()Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden java.lang.CharSequence
chars, codePoints, isEmpty
-
Felddetails
-
EMPTY_ROOT
-
-
Konstruktordetails
-
RelativePath
Creates aRelativePath.- Parameter:
endsWithFile- - if true, the path ends with a file, otherwise a directory
-
-
Methodendetails
-
getSegments
-
segmentIterator
-
isFile
public boolean isFile() -
getPathString
-
length
public int length()- Angegeben von:
lengthin SchnittstelleCharSequence
-
charAt
public char charAt(int index) - Angegeben von:
charAtin SchnittstelleCharSequence
-
subSequence
- Angegeben von:
subSequencein SchnittstelleCharSequence
-
getFile
-
getLastName
-
equals
-
hashCode
public int hashCode() -
toString
- Angegeben von:
toStringin SchnittstelleCharSequence- Setzt außer Kraft:
toStringin KlasseObject
-
getParent
Returns the parent of this path.- Gibt zurück:
- The parent of this path, or null if this is the root path.
-
parse
-
parse
-
replaceLastName
Returns a copy of this path, with the last name replaced with the given name.
- Parameter:
name- The name.- Gibt zurück:
- The path.
-
append
Appends the given path to the end of this path.
- Parameter:
other- The path to append- Gibt zurück:
- The new path
-
plus
Appends the given path to the end of this path.
- Parameter:
other- The path to append- Gibt zurück:
- The new path
-
append
Appends the given names to the end of this path.- Parameter:
endsWithFile- when true, the new path refers to a file.segments- The names to append.- Gibt zurück:
- The new path.
-
prepend
Prepends the given names to the start of this path.- Parameter:
segments- The names to prepend- Gibt zurück:
- The new path.
-
compareTo
- Angegeben von:
compareToin SchnittstelleComparable<RelativePath>
-