Package de.firemage.autograder.core.file
Class SourcePath
java.lang.Object
de.firemage.autograder.core.file.SourcePath
- All Implemented Interfaces:
Serializable,Comparable<SourcePath>
This represents a path to a source folder or file.
Why does this class exist and why not just use Path?
SourceInfo does not always represent files that have a real path on the file-system.
It is possible to load source code from memory, so those files would not have a path.
Additionally, it would be possible to have paths with ".." that have to be normalized first, which
makes comparisons harder.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(SourcePath other) booleangetName()The name of the file or folder represented by this path.inthashCode()static SourcePathstatic SourcePathstatic SourcePathtoPath()toString()
-
Method Details
-
of
-
of
-
of
-
getName
The name of the file or folder represented by this path.For a file, this includes the file extension.
- Returns:
- the name of the file or folder. Will never be null or an empty string
-
toPath
-
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<SourcePath>
-