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 Details

    • Path

      public Path(String href, String title, boolean isFolder, long size, boolean isReadable, long lastModified)
      Creates an instance of a Path record class.
      Parameters:
      href - the value for the href record component
      title - the value for the title record component
      isFolder - the value for the isFolder record component
      size - the value for the size record component
      isReadable - the value for the isReadable record component
      lastModified - the value for the lastModified record component
  • Method Details

    • isFolder

      public boolean isFolder()
      Returns the value of the isFolder record component.
      Returns:
      the value of the isFolder record component
    • isReadable

      public boolean isReadable()
      Returns the value of the isReadable record component.
      Returns:
      the value of the isReadable record component
    • getHref

      public String getHref()
    • getTitle

      public String getTitle()
    • getIconName

      public String getIconName()
    • getIconClassName

      public String 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • href

      public String href()
      Returns the value of the href record component.
      Returns:
      the value of the href record component
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • size

      public long size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • lastModified

      public long lastModified()
      Returns the value of the lastModified record component.
      Returns:
      the value of the lastModified record component