All Superinterfaces:
Comparable<ICCFile>, ICCBase, ICCCoverageData, ICCCoverageDataBasic, ICCFile, ICCImportFlowPointParent, ICCImportStatementData, ICCPercentItem, ICCSource, ICCStatementData, ICCStatementDataBasic, ICCTreeItem

public interface ICCImportFile extends ICCFile, ICCImportStatementData, ICCImportFlowPointParent
An importer will use this to add content about an imported file
Since:
3.1
  • Method Details

    • setFile

      void setFile(File file)
      Set a reference to a cached or local copy of the file content NOTE: if the source/listing is in a zip then this method is not expected to return a file The API suggests that ICCFile.getStream() be used to retrieve content. This means that the contents do not need to be extracted but can be obtained directly from the zip
      Parameters:
      file - sets content to a local file
    • setFile

      void setFile(File file, boolean external)
      Similar to setFile(File) but allows for the "external" flag. If external is true then the file is considered external to the results see ICCSource.isExternal() Files that are external to the results may be treated differently. e.g. Files that are stored with the results should be considered read only
      Parameters:
      file - sets content to a local file
      external - indicates that file is external to results
      Since:
      5.0
    • setSourceZipPath

      void setSourceZipPath(String sourceZipPath)
      Set to the full path to the zip that contains the source/listing
      Parameters:
      sourceZipPath - - full path to the zip that contains the source/listing
      Since:
      4.0
    • setSourceDirectory

      void setSourceDirectory(String sourcePath)
      Optional method to set the path where source/listing content is stored When the source/listing is in a zip this is the relative path to the source
      Parameters:
      sourcePath - path to where source/listing can be found
    • setLanguage

      void setLanguage(int language)
      Set language for this file see ICCConstants
      Parameters:
      language - programming language
    • addLines

      void addLines(Integer[] lines) throws CCImportException
      Add an array of executable lines NOTE: in v9 the behavior of adding lines in a batch has changed If the array of lines passed includes duplicates they will be converted to statements e.g. 12,13,14,14,15 will be imported as 12,13,14.0,14.1,15 If the line already exists before adding the passed ones then they will be ignored as duplicates
      Parameters:
      lines - executable lines
      Throws:
      CCImportException - where there is a problem adding the lines
    • addHitLines

      void addHitLines(int testID, Integer[] lines)
      Add an array of hit lines. Hit lines can be added in batches. Duplicates are ignored
      Parameters:
      testID - testcase id that should be associated with the hit lines
      lines - hit lines (subset of executable lines)
    • setQualifiedName

      void setQualifiedName(String qualifiedName)
      Set a name that may include path information
      Parameters:
      qualifiedName - qualified name of file with path information
    • setBaseFileName

      void setBaseFileName(String baseFileName)
      Unqualified file name Normally this will be the qualified name without any path information
      Parameters:
      baseFileName - unqualified file name
      Since:
      4.0
    • setBaseName

      void setBaseName(String commonName)
      Set a "normalized" or "common" name for this file that can be used to compare. The name has information that can change during build from the name allowing for comparisons
      Parameters:
      commonName - common name if different from base name
      Since:
      4.0
    • addPart

      boolean addPart(ICCImportPart part)
      Add an associated part to this file A part can be a program in the case of compiled languages This represents the artifact(s) created as a result of compiling this file
      Parameters:
      part - if the part already exists then nothing is changed
      Returns:
      true if part added, false if it already existed
      Since:
      9.0
    • setSignature

      void setSignature(byte[] signature)
      Set a unique signature for the file contents Based on MD5 it is used to compare file contents without opening the file
      Parameters:
      signature - a binary signature based on the contents of the file
      Since:
      6.0
    • setEncoding

      void setEncoding(String encoding)
      Set the codepage/encoding of this file's content See Charset for possible values
      Parameters:
      encoding - file encoding
      Since:
      7.0
    • removeLine

      void removeLine(int lineNumber)
      When required by an importer individual lines can be removed; Nothing is done if the line number does not exist
      Parameters:
      lineNumber - to remove
      Since:
      10.1