Package hudson.model
Record Class DirectoryBrowserSupport.Path
java.lang.Object
java.lang.Record
hudson.model.DirectoryBrowserSupport.Path
- Record Components:
href- Relative URL to this path from the current page.title- Name of this path. Just the file name portion.size- File size, or null if this is not a file.isReadable- If the current user can read the file.lastModified- For a file, the last modified timestamp.
- All Implemented Interfaces:
Serializable
- Enclosing class:
DirectoryBrowserSupport
public static record DirectoryBrowserSupport.Path(String href, String title, boolean isFolder, long size, boolean isReadable, long lastModified)
extends Record
implements Serializable
Represents information about one file or folder.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DirectoryBrowserSupport.Pathfinal booleanIndicates whether some other object is "equal to" this one.getHref()longlonggetSize()getTitle()final inthashCode()Returns a hash code value for this object.href()Returns the value of thehrefrecord component.booleanisFolder()Returns the value of theisFolderrecord component.booleanReturns the value of theisReadablerecord component.longReturns the value of thelastModifiedrecord component.longsize()Returns the value of thesizerecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Path
public Path(String href, String title, boolean isFolder, long size, boolean isReadable, long lastModified) Creates an instance of aPathrecord class.- Parameters:
href- the value for thehrefrecord componenttitle- the value for thetitlerecord componentisFolder- the value for theisFolderrecord componentsize- the value for thesizerecord componentisReadable- the value for theisReadablerecord componentlastModified- the value for thelastModifiedrecord component
-
-
Method Details
-
isFolder
public boolean isFolder()Returns the value of theisFolderrecord component.- Returns:
- the value of the
isFolderrecord component
-
isReadable
public boolean isReadable()Returns the value of theisReadablerecord component.- Returns:
- the value of the
isReadablerecord component
-
getHref
-
getTitle
-
getIconName
-
getIconClassName
-
getSize
public long getSize() -
getLastModified
public long getLastModified()- Returns:
- A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if is not possible to obtain the times.
- Since:
- 2.127
-
getLastModifiedAsCalendar
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Calendar getLastModifiedAsCalendar()- Returns:
- A Calendar representing the time the file was last modified, it lastModified is 0L it will return 00:00:00 GMT, January 1, 1970.
- Since:
- 2.127
-
createNotReadableVersionOf
public static DirectoryBrowserSupport.Path createNotReadableVersionOf(DirectoryBrowserSupport.Path that) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
href
Returns the value of thehrefrecord component.- Returns:
- the value of the
hrefrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
size
public long size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
lastModified
public long lastModified()Returns the value of thelastModifiedrecord component.- Returns:
- the value of the
lastModifiedrecord component
-