Class LibraryEntry

java.lang.Object
org.deltava.beans.fleet.LibraryEntry
All Implemented Interfaces:
Serializable, Cloneable, Comparable<LibraryEntry>, Auditable, ViewEntry, Cacheable
Direct Known Subclasses:
FileEntry, FleetEntry, Newsletter

public abstract class LibraryEntry extends Object implements Comparable<LibraryEntry>, Cacheable, ViewEntry, Auditable
An abstract bean to store information about Library entries.
Since:
1.0
Version:
10.4
Author:
Luke
See Also:
  • Constructor Details

    • LibraryEntry

      protected LibraryEntry(File f)
      Creates a new Library entry.
      Parameters:
      f - the File
  • Method Details

    • getName

      public final String getName()
      Returns the name of the resource.
      Returns:
      the name
      See Also:
    • getFullName

      public String getFullName()
      Gets the full pathname of the resource on the local filesystem.
      Returns:
      the full path to the resource
      See Also:
    • getFileName

      public String getFileName()
      Returns the filename of the resource, without paths.
      Returns:
      the filename
      See Also:
    • getDescription

      public String getDescription()
      Returns a description of this resource.
      Returns:
      the resource's description
      See Also:
    • getOwner

      public AirlineInformation getOwner()
      Returns the owning Virtual Airline.
      Returns:
      an AirlineInformation bean
      See Also:
    • getDownloadCount

      public int getDownloadCount()
      Returns the number of times this resource has been downloaded.
      Returns:
      the number of downloads
      See Also:
    • getSecurity

      public Security getSecurity()
      Returns this resource's security level.
      Returns:
      the security level for this entry
      See Also:
    • getSize

      public long getSize()
      Returns the size of the resource.
      Returns:
      the size of the resource in bytes, or 0 if it does not exist on the filesystem
      See Also:
    • setDownloadCount

      public void setDownloadCount(int count)
      Updates the number of times this resource has been downloaded.
      Parameters:
      count - the download count
    • setDescription

      public void setDescription(String desc)
      Updates the description of this resource.
      Parameters:
      desc - the description
      Throws:
      NullPointerException - if desc is null
      See Also:
    • setName

      public void setName(String name)
      Updates the name of this resource.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
      See Also:
    • setSize

      public void setSize(long size)
      Updates the size of this resource.
      Parameters:
      size - the size of the file in bytes
      See Also:
    • setSecurity

      public void setSecurity(Security level)
      Updates this resource's security level.
      Parameters:
      level - the security level code
      See Also:
    • setOwner

      public void setOwner(AirlineInformation ai)
      Updates the owning Virtual Airline.
      Parameters:
      ai - an AirlineInfromation bean
      See Also:
    • file

      public File file()
      Returns the underlying filesystem entry.
      Returns:
      the filesystem entry
    • getAuditID

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID
    • compareTo

      public int compareTo(LibraryEntry e2)
      Specified by:
      compareTo in interface Comparable<LibraryEntry>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none
    • cacheKey

      public final Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object
    • toString

      public String toString()
      Overrides:
      toString in class Object