Class AbsoluteFile
java.lang.Object
de.tomatengames.util.io.AbsoluteFile
An AbsoluteFile represents an absolute and direct path to a file.
It is meant to be used with
Files. See AbsolutePath for usage with Paths.- Since:
- 1.6
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(AbsoluteFile file) contains(AbsoluteFile, boolean)with allowSame=false.booleancontains(AbsoluteFile file, boolean allowSame) Returns whether the specified file is inside this file.static AbsoluteFileReturns anAbsoluteFilethat represents theFile.getCanonicalPath()of the specified file.static AbsoluteFileReturns anAbsoluteFilethat represents theFile.getCanonicalPath()of the specified file.getFile()Returns aFilethat represents this file.getPath()Returns the absolute and direct path that represents this file.resolveInside(String subpath) Returns the file inside this file resolved from the specified subpath.resolveInside(String subpath, boolean allowSame) Returns the file inside this file resolved from the specified subpath.toString()
-
Method Details
-
get
Returns anAbsoluteFilethat represents theFile.getCanonicalPath()of the specified file.- Parameters:
file- the filename- Returns:
- the
AbsoluteFileof the specified file - Throws:
IOException- if anIOExceptionoccurs fromFile.getCanonicalPath()
-
get
Returns anAbsoluteFilethat represents theFile.getCanonicalPath()of the specified file.- Parameters:
file- the file- Returns:
- the
AbsoluteFileof the specified file - Throws:
IOException- if anIOExceptionoccurs fromFile.getCanonicalPath()
-
getPath
Returns the absolute and direct path that represents this file.- Returns:
- the absolute and direct path that represents this file
-
getFile
-
toString
-
contains
contains(AbsoluteFile, boolean)with allowSame=false.- Parameters:
file- the file- Returns:
- whether the specified file is inside this file
-
contains
Returns whether the specified file is inside this file.- Parameters:
file- the fileallowSame- whether to return true if the specified file equals this file- Returns:
- whether the specified file is inside this file.
-
resolveInside
Returns the file inside this file resolved from the specified subpath.- Parameters:
subpath- the subpath to resolve- Returns:
- the resolved file
- Throws:
FileNotFoundException- if the resolved file is not inside this fileIOException- See Also:
-
resolveInside
Returns the file inside this file resolved from the specified subpath.- Parameters:
subpath- the subpath to resolveallowSame- whether to accept the resolved file if it equals this file- Returns:
- the resolved file
- Throws:
FileNotFoundException- if the resolved file is not inside this fileIOException- See Also:
-