Class ClarityFile

All Implemented Interfaces:
LimsEntity<ClarityFile>, LimsEntityLink<ClarityFile>, LimsEntityLinkable<ClarityFile>, LimsLink<ClarityFile>, Linkable<ClarityFile>, Locatable, Serializable

public class ClarityFile extends LimsEntityLinkBase<ClarityFile> implements LimsEntity<ClarityFile>
The file element contains information about a file in the system.

These are rather strange as the link to a file is just a file object with only the URI set. So they are both entities and links.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected URI
    The URI of the resource that this file is attached to (e.g., a project, sample, process, or artifact).
    protected URI
    The network location URI where the file content can be retrieved.
    protected String
    The LIMS id of the file.
    protected String
    The original name and location of the file before it was imported into the system.
    protected String
    The original name of the file before it was imported into the system.
    protected Boolean
    Indicates whether the file is displayed in LabLink.
    protected URI
    The URI of the file resource.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new, empty ClarityFile.
    Creates a new ClarityFile as a copy of another ClarityFile, copying its URI and LIMS id.
    Creates a new ClarityFile with the specified URI.
    ClarityFile(URI uri, String limsid)
    Creates a new ClarityFile with the specified URI and LIMS id.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Helper method to clear the detail fields (attachedTo, contentLocation, originalLocation and published).
    This element contains a URI that identifies and links to further information about the resource that the file is attached to, such as a project, sample, process, or file-based artifact.
    This element contains a URI that identifies and links to the network location of the file, which can be used to retrieve the file and process its contents.
    Gets the entity class for this file.
    Gets the LIMS id of this file.
    This element provides the original name and location of the file before it was imported into the system.
    This element provides the original name of the file before it was imported into the system.
    Gets the URI of this file resource.
    boolean
    This element specifies whether the file is displayed in LabLink.
    void
    Sets the resource that this file is attached to.
    void
    setContentLocation(URI contentLocation)
    Sets the network location URI where the file content can be retrieved.
    void
    setLimsid(String limsid)
    Sets the LIMS id of this file.
    void
    setOriginalLocation(String originalLocation)
    Sets the original name and location of the file before it was imported into the system.
    void
    setOriginalName(String originalName)
    Sets the original name of the file before it was imported into the system.
    void
    setPublished(Boolean published)
    Sets whether the file should be displayed in LabLink.
    void
    setUri(URI uri)
    Sets the URI of this file resource.

    Methods inherited from class com.genologics.ri.LimsLinkBase

    equals, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    getLink

    Methods inherited from interface com.genologics.ri.LimsEntityLinkable

    getLimsId, getLink, setLimsId
  • Field Details

    • attachedTo

      protected URI attachedTo
      The URI of the resource that this file is attached to (e.g., a project, sample, process, or artifact).
    • contentLocation

      protected URI contentLocation
      The network location URI where the file content can be retrieved.
    • originalLocation

      protected String originalLocation
      The original name and location of the file before it was imported into the system.
    • originalName

      protected String originalName
      The original name of the file before it was imported into the system.
      Since:
      2.26
    • published

      protected Boolean published
      Indicates whether the file is displayed in LabLink.
    • limsid

      protected String limsid
      The LIMS id of the file.
    • uri

      protected URI uri
      The URI of the file resource.
  • Constructor Details

    • ClarityFile

      public ClarityFile()
      Creates a new, empty ClarityFile.
    • ClarityFile

      public ClarityFile(URI uri)
      Creates a new ClarityFile with the specified URI.
      Parameters:
      uri - The URI of the file resource.
    • ClarityFile

      public ClarityFile(URI uri, String limsid)
      Creates a new ClarityFile with the specified URI and LIMS id.
      Parameters:
      uri - The URI of the file resource.
      limsid - The LIMS id of the file.
    • ClarityFile

      public ClarityFile(ClarityFile file)
      Creates a new ClarityFile as a copy of another ClarityFile, copying its URI and LIMS id.
      Parameters:
      file - The file to copy from.
      Throws:
      NullPointerException - if file is null.
  • Method Details

    • getAttachedTo

      public URI getAttachedTo()
      This element contains a URI that identifies and links to further information about the resource that the file is attached to, such as a project, sample, process, or file-based artifact.
      Returns:
      The URI of the entity the file is attached to.
    • setAttachedTo

      public void setAttachedTo(Linkable<?> link)
      Sets the resource that this file is attached to.
      Parameters:
      link - The linkable entity to attach this file to, or null to clear the attachment.
    • getContentLocation

      public URI getContentLocation()
      This element contains a URI that identifies and links to the network location of the file, which can be used to retrieve the file and process its contents.
      Returns:
      The file's location.
    • setContentLocation

      public void setContentLocation(URI contentLocation)
      Sets the network location URI where the file content can be retrieved.
      Parameters:
      contentLocation - The URI of the file content location.
    • getOriginalLocation

      public String getOriginalLocation()
      This element provides the original name and location of the file before it was imported into the system. Note: If the file was uploaded from the Clarity web interface, the original-location element will not contain the full file path due to browser security limitations. Only the original file name will be available.
      Returns:
      The original file location.
    • setOriginalLocation

      public void setOriginalLocation(String originalLocation)
      Sets the original name and location of the file before it was imported into the system.
      Parameters:
      originalLocation - The original file location string.
    • getOriginalName

      public String getOriginalName()
      This element provides the original name of the file before it was imported into the system. This is calculated from the original-location.
      Returns:
      The original file name.
      Since:
      2.26
    • setOriginalName

      public void setOriginalName(String originalName)
      Sets the original name of the file before it was imported into the system.
      Parameters:
      originalName - The original file name.
      Since:
      2.26
    • isPublished

      public boolean isPublished()
      This element specifies whether the file is displayed in LabLink.
      Returns:
      true to be visible in Lablink, false to be invisible.
    • setPublished

      public void setPublished(Boolean published)
      Sets whether the file should be displayed in LabLink.
      Parameters:
      published - true to make the file visible in Lablink, false to make it invisible.
    • getLimsid

      public String getLimsid()
      Gets the LIMS id of this file.
      Specified by:
      getLimsid in interface LimsEntityLinkable<ClarityFile>
      Returns:
      The LIMS id.
    • setLimsid

      public void setLimsid(String limsid)
      Sets the LIMS id of this file.
      Specified by:
      setLimsid in interface LimsEntityLinkable<ClarityFile>
      Parameters:
      limsid - The LIMS id to set.
    • getUri

      public URI getUri()
      Gets the URI of this file resource.
      Specified by:
      getUri in interface LimsLink<ClarityFile>
      Specified by:
      getUri in interface Locatable
      Returns:
      The URI.
    • setUri

      public void setUri(URI uri)
      Sets the URI of this file resource.
      Specified by:
      setUri in interface Locatable
      Parameters:
      uri - The URI to set.
    • clearDetailFields

      public void clearDetailFields()
      Helper method to clear the detail fields (attachedTo, contentLocation, originalLocation and published). This may be necessary if a new file is created with these values set and that object then set on, say, an artifact that needs to be updated. Internally, the link will have been set on the server.
    • getEntityClass

      public Class<ClarityFile> getEntityClass()
      Gets the entity class for this file.
      Specified by:
      getEntityClass in interface LimsLink<ClarityFile>
      Returns:
      The ClarityFile class.