public class RelativeFile
extends java.lang.Object
RelativeFile contains
information on the file, the base directory and the relative path from the base directory to
the file. The relative path is kept in OS independent form with sub directories separated by
slashes.
Neither the file nor the base need to exist. They are treated as abstract paths.
| Constructor and Description |
|---|
RelativeFile(java.io.File base,
java.io.File file)
Creates a new relative file.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.io.File |
getBase()
Obtains the base directory.
|
java.io.File |
getFile()
Obtains the file.
|
java.lang.String |
getOsIndependentRelativePath()
Obtains the OS independent path.
|
int |
hashCode() |
java.lang.String |
toString() |
public RelativeFile(@NonNull
java.io.File base,
@NonNull
java.io.File file)
base - the base directoryfile - the file, must not be the same as the base directory and must be located inside
base@NonNull public java.io.File getBase()
@NonNull public java.io.File getFile()
@NonNull public java.lang.String getOsIndependentRelativePath()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object