Class File


public class File extends CatalogType
This class is the container for any File object, either the RC section, or uses
Version:
$Revision$
Author:
gmehta
  • Field Details

    • mNamespace

      protected String mNamespace
      The namespace on a file. This is used for Executables only
    • mName

      protected String mName
      The logical name of the file.
    • mVersion

      protected String mVersion
      The logical version of the file. This is used for executables only.
    • mOptional

      protected boolean mOptional
      Is the file optional
    • mRegister

      protected boolean mRegister
      Should the file be registered in the replica catalog
    • mTransfer

      protected File.TRANSFER mTransfer
      Should the file be transferred on generation.
    • mExecutable

      protected boolean mExecutable
      Is the file an executable.
    • useForPlanning

      protected boolean useForPlanning
      A boolean tracking whether a file is for use of planner i.e. to be used for planning a sub workflow.
    • mSize

      protected String mSize
      File size of the file no units required
  • Constructor Details

    • File

      public File(String name)
      Create new file object
      Parameters:
      name - The name of the file
    • File

      public File(String name, File.LINK link)
      Create new file object
      Parameters:
      name - The name of the file
      link - The linkage of the file
    • File

      public File(File f)
      Copy constructor
      Parameters:
      f - File
    • File

      public File(File f, File.LINK link)
      Copy constructor, but change the linkage of the file.
      Parameters:
      f - File
      link - Link
    • File

      public File(String namespace, String name, String version)
      Create new File object
      Parameters:
      namespace - namespace
      name - the name
      version - the version
    • File

      public File(String namespace, String name, String version, File.LINK link)
      Create a new file object
      Parameters:
      namespace - The namespace of the file
      name - The name of the file
      version - The version of the file
      link - The linkage of the file.
  • Method Details

    • getName

      public String getName()
      Get the name of the file
      Returns:
      the name
    • getNamespace

      public String getNamespace()
      Get the namespace of the file
      Returns:
      the namespace
    • getVersion

      public String getVersion()
      Get the version of the file
      Returns:
      version
    • getLink

      public File.LINK getLink()
      Get the linkage of the file.
      Returns:
      linkage
    • setLink

      public File setLink(File.LINK link)
      Set the file linkage
      Parameters:
      link - the linkage
      Returns:
      File
      See Also:
    • setOptional

      public File setOptional(boolean optionalflag)
      Set the optional flag on the file. Default is false
      Parameters:
      optionalflag - boolean to indicate if file is optional
      Returns:
      File
    • getOptional

      public boolean getOptional()
      Check the optional flag of the file
      Returns:
      boolean
    • setRegister

      public File setRegister(boolean registerflag)
      Set the register flag of the file. Default is true
      Parameters:
      registerflag - register flag
      Returns:
      File
    • getRegister

      public boolean getRegister()
      Get the register flag of this file.
      Returns:
      boolean
    • setTransfer

      public File setTransfer(File.TRANSFER transferflag)
      Set the transfer type of the file
      Parameters:
      transferflag - the transfer flag for the file
      Returns:
      File
      See Also:
    • getTransfer

      public File.TRANSFER getTransfer()
      Get the transfer type of the file
      Returns:
      the transfer flag
    • setExecutable

      public File setExecutable(boolean executable)
      Mark the file as executable. Default is false
      Parameters:
      executable - set the file to be an executable
      Returns:
      File
    • setExecutable

      public File setExecutable()
      Mark the file as executable. Default is false
      Returns:
      File
    • getExecutable

      public boolean getExecutable()
      Check if the file is an executable
      Returns:
      boolean
    • setUseForPlanning

      public File setUseForPlanning(boolean value)
      Mark the file to be used for planner.
      Parameters:
      value - boolean
      Returns:
      File
    • setUseForPlanning

      public File setUseForPlanning()
      Mark the file to be used for planner.
      Returns:
      File
    • useForPlanning

      public boolean useForPlanning()
      Returns boolean indicating whether the file is marked for planner use.
      Returns:
      boolean
    • setSize

      public File setSize(String size)
      Set the size of the file.
      Parameters:
      size - size of the file
      Returns:
      File
    • getSize

      public String getSize()
      Return the size of the file
      Returns:
      empty string if no size defined, otherwise returns the size
    • isFile

      public boolean isFile()
      Boolean indicating whether is of type file
      Overrides:
      isFile in class CatalogType
      Returns:
      boolean
    • equals

      public boolean equals(Object o)
      Check if this File is equal to Object o
      Overrides:
      equals in class Object
      Parameters:
      o - object being compared
      Returns:
      boolean
    • hashCode

      public int hashCode()
      HashCode of this File
      Overrides:
      hashCode in class Object
      Returns:
      int hashcode
    • clone

      public File clone()
      Return a clone of this File
      Overrides:
      clone in class Object
      Returns:
      cloned File
    • toXML

      public void toXML(edu.isi.pegasus.common.util.XMLWriter writer)
      Write the file object
      Overrides:
      toXML in class CatalogType
      Parameters:
      writer - the xml writer
      See Also:
      • XMLWriter
    • toXML

      public void toXML(edu.isi.pegasus.common.util.XMLWriter writer, int indent)
      Write the file object, with indent level N
      Overrides:
      toXML in class CatalogType
      Parameters:
      writer - xml writer
      indent - number of indent spaces
      See Also:
      • XMLWriter
    • toXML

      public void toXML(edu.isi.pegasus.common.util.XMLWriter writer, int indent, String elementname)
      Write the file object as XML but render it as the elementname
      Parameters:
      writer - xml writer
      indent - number of indent spaces
      elementname - name of the element
    • toReplicaLocation

      public edu.isi.pegasus.planner.classes.ReplicaLocation toReplicaLocation()
      Adapter function to convert File object to Replica Location object so that we can serialize to YAML using existing interface.
      Returns:
      ReplicaLocation object