Gets the file extension of the file or URL.
The file extension of the file or URL.
Checks if the path is a valid URL.
True if the path is a valid URL, false otherwise.
Gets the name of the file or URL.
The name of the file or URL.
Gets the parent directory of the file or URL.
The parent directory of the file or URL.
Creates a URL object from the Resource.
A URL object representing the Resource. Will be a file URL if the path is not a valid URL.
Compares the paths of two Resource instances and returns the differences.
The other Resource instance to compare with.
An array of segments that are different between the two paths.
Checks if the file or URL exists.
True if the file or URL exists, false otherwise.
Fetches the contents of the file or URL.
The contents of file the Resource points to.
Joins the Resource with other segments to create a new Resource.
The segments to join with the Resource.
A new Resource instance with the joined path.
Splits the Resource path into an array of segments.
An array of segments in the path, in order of occurrence.
Returns the string representation of the Resource instance.
The path of the Resource.
Static
cwdCreates a new Resource instance with the current working directory.
A new Resource instance with the current working directory.
Resource class for handling file and URL paths.