Package dev.sigstore.tuf
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 TypeMethodDescriptiongetTargetInputSteam(String targetName) Returns an input stream to a TUF target file in the local TUF store.booleanChecks 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
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
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
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
-