Class ReadAnnotationFromFile
Object
ReadAnnotationFromFile
Utility class for reading
ImageLabelAnnotation from a file.-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<ImageLabelAnnotation> readAssumeExists(Path path, OperationContext context) Reads anImageLabelAnnotationfrom a file, assuming the file exists.static Optional<ImageLabelAnnotation> readCheckExists(Path path, OperationContext context) Reads anImageLabelAnnotationfrom a file if it exists.
-
Method Details
-
readCheckExists
public static Optional<ImageLabelAnnotation> readCheckExists(Path path, OperationContext context) throws InputReadFailedException Reads anImageLabelAnnotationfrom a file if it exists.- Parameters:
path- thePathto the file to read from.context- theOperationContextfor the read operation.- Returns:
- an
Optionalcontaining theImageLabelAnnotationif the file exists and can be read, or an empty Optional otherwise. - Throws:
InputReadFailedException- if an error occurs while reading the file.
-
readAssumeExists
public static Optional<ImageLabelAnnotation> readAssumeExists(Path path, OperationContext context) throws InputReadFailedException Reads anImageLabelAnnotationfrom a file, assuming the file exists.- Parameters:
path- thePathto the file to read from.context- theOperationContextfor the read operation.- Returns:
- an
Optionalcontaining theImageLabelAnnotationif it can be read, or an empty Optional otherwise. - Throws:
InputReadFailedException- if an error occurs while reading the file.
-