Class BwResource

All Implemented Interfaces:
Serializable, Comparable<BwResource>, OwnedEntity, ShareableEntity, org.bedework.util.logging.Logged

public class BwResource extends BwShareableContainedDbentity<BwResource>
Represent a resource stored within the system, e.g an attachment or an image. The actual content is stored in a BwResourceContent object to allow us to put off retrieval of content - or maybe even store outside of the db.
Author:
Mike Douglass douglm - bedework.edu
See Also:
  • Field Details

    • tombstoned

      public static final String tombstoned
      Value of encoding for a tombstoned resource
      See Also:
    • tombstonedSuffix

      public static final String tombstonedSuffix
      Value of suffix on path for a tombstoned resource
      See Also:
  • Constructor Details

    • BwResource

      public BwResource()
      Constructor
  • Method Details

    • setHref

      public void setHref(String val)
      Set the href - ignored
      Overrides:
      setHref in class BwUnversionedDbentity<BwResource>
      Parameters:
      val - String href
    • getHref

      public String getHref()
      Overrides:
      getHref in class BwUnversionedDbentity<BwResource>
      Returns:
      non null unique href for the entity
    • setName

      public void setName(String val)
      Set the name
      Parameters:
      val - String name
    • getName

      public String getName()
      Get the name
      Returns:
      String name
    • setCreated

      public void setCreated(String val)
      Parameters:
      val - created date
    • getCreated

      public String getCreated()
      Returns:
      String created
    • setLastmod

      public void setLastmod(String val)
      Parameters:
      val - lastmod date
    • getLastmod

      public String getLastmod()
      Returns:
      String lastmod
    • setSequence

      public void setSequence(int val)
      Set the sequence
      Parameters:
      val - sequence number
    • getSequence

      public int getSequence()
      Get the sequence
      Returns:
      int the sequence
    • setContentType

      public void setContentType(String val)
      Set the contentType - may be null for unknown. For internal use extra information can be appended by adding a TAB character then the extra. On delivery the TAB and anything after stripped
      Parameters:
      val - String contentType
    • getContentType

      public String getContentType()
      Get the contentType
      Returns:
      String contentType
    • setEncoding

      public void setEncoding(String val)
      Set the encoding
      Parameters:
      val - String encoding
    • getEncoding

      public String getEncoding()
      Get the encoding
      Returns:
      String encoding
    • setContentLength

      public void setContentLength(long val)
      Set the length
      Parameters:
      val - int
    • getContentLength

      public long getContentLength()
      Get the length
      Returns:
      long length
    • getContentTypeStripped

      public String getContentTypeStripped()
      Get the contentType stripped
      Returns:
      String contentType
    • getContentTypeExtra

      public String getContentTypeExtra()
      Get the extra stuff appended to the content type
      Returns:
      String extra data
    • copyTo

      public void copyTo(BwResource val)
      Copy this objects values into the parameter
      Parameters:
      val - target resource
    • updateLastmod

      public void updateLastmod(Timestamp val)
      Update last mod fields
      Parameters:
      val - timestamp
    • setPrevLastmod

      public void setPrevLastmod(String val)
      Set the resource's previous lastmod - used to allow if none match
      Parameters:
      val - lastmod
    • getPrevLastmod

      public String getPrevLastmod()
      Get the resource's previous lastmod - used to allow if none match
      Returns:
      the event's lastmod
    • setPrevSeq

      public void setPrevSeq(int val)
      Set the event's previous seq - used to allow if none match
      Parameters:
      val - sequence number
    • getPrevSeq

      public int getPrevSeq()
      Get the event's previous seq - used to allow if none match
      Returns:
      the event's seq
    • setContent

      public void setContent(BwResourceContent val)
      Set the content
      Parameters:
      val - BwResourceContent
    • getContent

      public BwResourceContent getContent()
      Get the content
      Returns:
      BwResourceContent content
    • getEtag

      public String getEtag()
      Returns:
      etag for this resource.
    • getEtagValue

      public String getEtagValue()
      Returns:
      unquoted etag for this resource.
    • getPreviousEtag

      public String getPreviousEtag()
      Returns:
      prev tag or null for no values set.
    • tombstone

      public void tombstone()
      Make this thing a tombstoned resource. Non-reversible
    • getTombstoned

      public boolean getTombstoned()
      Is this resource tombstoned?
      Returns:
      true/false
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BwUnversionedDbentity<BwResource>
    • compareTo

      public int compareTo(BwResource that)
      Specified by:
      compareTo in interface Comparable<BwResource>
      Overrides:
      compareTo in class BwUnversionedDbentity<BwResource>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Object clone()
      Description copied from class: BwUnversionedDbentity
      Make visible
      Overrides:
      clone in class BwUnversionedDbentity<BwResource>
      Returns:
      Object of class T