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.
| Modifier and Type | Class and Description |
|---|---|
static class |
RelativeFile.Type |
| Modifier and Type | Field and Description |
|---|---|
RelativeFile.Type |
type |
| Constructor and Description |
|---|
RelativeFile(java.io.File base,
java.io.File file)
Creates a new relative file.
|
RelativeFile(java.io.File base,
java.lang.String relativePath)
Creates a new relative file.
|
RelativeFile(java.io.File base,
java.lang.String relativePath,
RelativeFile.Type type)
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 or jar.
|
java.lang.String |
getRelativePath()
Obtains the OS independent path.
|
RelativeFile.Type |
getType() |
int |
hashCode() |
java.lang.String |
toString() |
@NonNull public final RelativeFile.Type type
public RelativeFile(@NonNull
java.io.File base,
@NonNull
java.io.File file)
base - the base directory.file - the file, must not be the same as the base directory and must be located inside
basepublic RelativeFile(@NonNull
java.io.File base,
@NonNull
java.lang.String relativePath)
base - the base jar.relativePath - the relative path to the file.public RelativeFile(@NonNull
java.io.File base,
@NonNull
java.lang.String relativePath,
@NonNull
RelativeFile.Type type)
base - the base jar or directory.relativePath - the relative path to the file.type - the type of the base.@NonNull public java.io.File getBase()
@NonNull public java.lang.String getRelativePath()
@NonNull public RelativeFile.Type getType()
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