Class Checkm

java.lang.Object
org.cdlib.mrt.core.Checkm

public class Checkm extends Object
 Dflat POST manifest row support
 This routine is used in conjunction with Manifest for parsing the manifest
 process line. This manifest is passed as part of a POST addVersion process.

 For this format this consists of:
 URL for accessing file
 checksum type
 checksum
 file size
 last modified date String (or -) if not spplied
 file name
 
Author:
David Loy
  • Field Details

  • Constructor Details

    • Checkm

      public Checkm(LoggerInf logger, String[] manifestComments) throws TException
      Constructor
      Parameters:
      logger - process logger
      manifestComments - semantic checkm headers
      Throws:
      TException
  • Method Details

    • getSaveComments

      public String[] getSaveComments()
    • handleHeaders

      public void handleHeaders(String[] comments, String[] profiles) throws TException
      Validate Profile from external manifest headers
      Parameters:
      comments - #% comments preceding content
      Throws:
      TException - process exception
    • setHeaders

      protected void setHeaders(String[] comments) throws TException
      Process the local headers to define row organization and content
      Parameters:
      comments - local header
      Throws:
      TException
    • dumpHeaders

      protected void dumpHeaders(String msg, String[] headers)
    • trimBlanks

      protected String trimBlanks(String val)
      trim leading and trailing blanks
      Parameters:
      val - item to be trimmed
      Returns:
      trimmed data
    • sequenceColumns

      protected void sequenceColumns(String columnsS) throws TException
      Build tables with sequencing of known columns
      Parameters:
      columnsS - #%columns header
      Throws:
      TException - process exception
    • setPrefix

      protected void setPrefix(String comment) throws TException
      Parse prefix line
      Parameters:
      comment - comment line to be processed
      Throws:
      TException - porcess exception
    • matchPat

      protected String[] matchPat(String data) throws TException
      Throws:
      TException
    • setRow

      public void setRow(FileComponent fileComponent, String line) throws TException
      From manifest line parse out fileComponent elements and set those values in fileComponent
      Parameters:
      fileComponent - target for setting values
      line - manifest line
      Throws:
      TException - process exception
    • testVal

      protected boolean testVal(Checkm.ColMap type, String[] items)
      Does content for this column exist
      Parameters:
      type - column content type
      items - parsed line content
      Returns:
      true=column exists in parsed line content; false=content for column does not exist
    • getVal

      protected String getVal(Checkm.ColMap type, String[] items)
      Get content for this column
      Parameters:
      type - column content type
      items - parsed line content
      Returns:
      true=column exists in parsed line content; false=content for column does not exist
    • getValNoDec

      protected String getValNoDec(Checkm.ColMap type, String[] items)
      Get value of column without decoding
      Parameters:
      type - column type to decode
      items - manifest line columns
      Returns:
      column value
    • getLine

      public String getLine(FileComponent fileComponent) throws TException
      Build output manifest line from fileComponent
      Parameters:
      fileComponent - file component to convert to manifest line
      Returns:
      manifest line
      Throws:
      TException - process exception
    • setCol

      protected void setCol(String[] disp, Checkm.ColMap val, String value) throws TException
      Set col output display of content for column exists
      Parameters:
      disp - columns
      val - content type
      value - value to be set
      Throws:
      TException - process exception
    • getCol

      protected Integer getCol(Checkm.ColMap val) throws TException
      From column content type get column position
      Parameters:
      val - column content type
      Returns:
      position in manifest line for this content
      Throws:
      TException - process exception
    • enc

      public static String enc(String in)
      simplied encoding that encodes a leading or trailing blank and any internal vertical bars
      Parameters:
      in - data to be encoded
      Returns:
      encoded data
    • dec

      public static String dec(String in)
      Encode leading and trailing blanks and pipe
      Parameters:
      in - data to be decoded
      Returns:
      decoded data
    • handleEOF

      public void handleEOF(String prevLine) throws TException
      Raise error if #%eof not found as last entry in manifest
      Parameters:
      prevLine - last line of manifest
      Throws:
      TException
    • getLocalProfile

      public String getLocalProfile()
    • setLocalProfile

      public void setLocalProfile(String localProfile)
    • getProfile

      public static String getProfile(String header) throws TException
      Throws:
      TException
    • getColumns

      public static String getColumns(String header) throws TException
      Throws:
      TException
    • getPrefix

      public static String getPrefix(String header) throws TException
      Throws:
      TException
    • squeezeHeader

      public static String squeezeHeader(String name, String header) throws TException
      Throws:
      TException