Interface TargetReader

All Known Subinterfaces:
TargetStore
All Known Implementing Classes:
FileSystemTufStore

public interface TargetReader
Interface that defines reading targets from local storage.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an input stream to a TUF target file in the local TUF store.
    boolean
    hasTarget(String targetName)
    Checks if the local TUF store actually contains a target file with name.
    byte[]
    readTarget(String targetName)
    Reads a TUF target file from the local TUF store.
  • Method Details

    • readTarget

      byte[] readTarget(String targetName) throws IOException
      Reads a TUF target file from the local TUF store. Target names may include path elements and the storage engine should be consistent when handling writing and reading these.
      Parameters:
      targetName - the name of the target file to read (e.g. ctfe.pub)
      Returns:
      the content of the file as bytes
      Throws:
      IOException - if an error occurs
    • getTargetInputSteam

      InputStream getTargetInputSteam(String targetName) throws IOException
      Returns an input stream to a TUF target file in the local TUF store. Target names may include path elements and the storage engine should be consistent when handling writing and reading these.
      Parameters:
      targetName - the name of the target file to read (e.g. ctfe.pub)
      Returns:
      an input steam to the target file in the local store, the consumer must close the input stream
      Throws:
      IOException - if an error occurs
    • hasTarget

      boolean hasTarget(String targetName) throws IOException
      Checks if the local TUF store actually contains a target file with name.
      Parameters:
      targetName - the name of the target file to read (e.g. ctfe.pub)
      Returns:
      true if the target exists locally
      Throws:
      IOException - if an error occurs