Interface FileResourcePath
-
- All Superinterfaces:
DatabaseApiValue
public interface FileResourcePath extends DatabaseApiValue
A path identifying either a single file resource or a directory of file resources belonging to a file version.
The path consists of path segments separated by
/(slash) characters, such that the last segment is defined to be the filename of the path. The path may have no path segments (an empty path), in which case the path is the common root directory for all file resources belonging to the file version.An example of a file version containing multiple file resources is a report in the HTML format. The file resources could then, for example, consist of:
report.htmlreport_files/logo.pngreport_files/styles.css
The file resource paths with values
report.htmlorreport_files/styles.cssspecify single file resources of the file version. The file resource pathreport_filesspecifies a directory containing two file resources of the file version. An empty file resource path (one without any path segments) specifies the root directory containing all three file resources of the file version.- See Also:
FileResourceResult
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanequals(java.lang.Object object)Compares the specified object with this file resource path for equality.java.lang.Stringfilename()Get the filename part of the file resource path.inthashCode()Returns the hash code value for this file resource path.static FileResourcePathofSegments(java.lang.String... fileResourcePathSegments)Create a new file resource path from the provided file resource path segments.default java.lang.String[]toSegmentArray()Get the path as an array of path segments.java.util.List<java.lang.String>toSegmentList()Get the path as a list of path segments.java.lang.Stringvalue()Get the (relative) path of the file or directory with individual path segments separated by the/(slash) character.
-
-
-
Method Detail
-
value
java.lang.String value()
Get the (relative) path of the file or directory with individual path segments separated by the/(slash) character.- Returns:
- The path of the file or directory.
-
filename
java.lang.String filename()
Get the filename part of the file resource path. This is defined as the last segment whenvalue()is split on/. Returns null if the path has no segments.- Returns:
- The filename part of the file resource path, or null.
-
toSegmentList
java.util.List<java.lang.String> toSegmentList()
Get the path as a list of path segments. The last segment is the filename of the file resource path. Returns an empty list if the path has no segments.- Returns:
- A list of relative path segments. The last segment is the filename of the file resource path.
-
hashCode
int hashCode()
Returns the hash code value for this file resource path. The hash code is defined to be the hash code of the string value returned byvalue().- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code value for this instance.
-
equals
boolean equals(java.lang.Object object)
Compares the specified object with this file resource path for equality. Returns true if and only if the specified object is also a file resource path and if both have the same value (as returned byvalue()).- Overrides:
equalsin classjava.lang.Object- Parameters:
object- The object to test equality against.- Returns:
- True if the specified object is equal to this file resource path.
-
toSegmentArray
default java.lang.String[] toSegmentArray()
Get the path as an array of path segments. The last segment is the filename of the file resource path. Returns an empty array if the path has no segments.- Returns:
- An array of relative path segments. The last segment is the filename of the file resource path.
-
ofSegments
static FileResourcePath ofSegments(java.lang.String... fileResourcePathSegments)
Create a new file resource path from the provided file resource path segments. Pass an empty array to create a file resource path that corresponds to the root directory for all file resources belonging to a file version.- Parameters:
fileResourcePathSegments- A sequence of relative path segments for the file resource path. May be an empty array.- Returns:
- A new file resource path.
-
-