Class ExifToolProcessor
- java.lang.Object
-
- org.nuxeo.binary.metadata.internals.ExifToolProcessor
-
- All Implemented Interfaces:
BinaryMetadataProcessor
public class ExifToolProcessor extends Object implements BinaryMetadataProcessor
- Since:
- 7.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringCOMMAND_NOT_AVAILABLEprotected static StringCOMMAND_NOT_EXECUTABLE_NULL_BLOBprotected com.fasterxml.jackson.databind.ObjectMapperjacksonMapperprotected static PatternVALID_EXT
-
Constructor Summary
Constructors Constructor Description ExifToolProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected List<String>getCommandTags(List<String> metadataList)protected List<String>getCommandTags(Map<String,Object> metadataMap)protected BlobgetTemporaryBlob(Blob blob)Gets a new blob on a temporary file which is a copy of the blob's.protected CloseableFilegetTemporaryFile(Blob blob)We don't want to rely onBlob.getCloseableFile()because it may return the original and we always want a temporary one to be sure we have a clean filename to pass.protected voidparseDates(Map<String,Object> resultMap)protected Map<String,Object>readMetadata(String command, Blob blob, List<String> metadata)protected Map<String,Object>readMetadata(String command, Blob blob, List<String> metadata, boolean ignorePrefix)Deprecated.since 11.5, usereadMetadata(String, Blob, List)insteadMap<String,Object>readMetadata(Blob blob, boolean ignorePrefix)Read all metadata from a given blob.Map<String,Object>readMetadata(Blob blob, List<String> metadata, boolean ignorePrefix)Read from a given blob given metadata map.protected Map<String,Object>returnResultMap(ExecResult er)BlobwriteMetadata(Blob blob, Map<String,Object> metadata, boolean ignorePrefix)Write given metadata into given blob.
-
-
-
Field Detail
-
COMMAND_NOT_AVAILABLE
protected static final String COMMAND_NOT_AVAILABLE
- See Also:
- Constant Field Values
-
COMMAND_NOT_EXECUTABLE_NULL_BLOB
protected static final String COMMAND_NOT_EXECUTABLE_NULL_BLOB
- See Also:
- Constant Field Values
-
jacksonMapper
protected final com.fasterxml.jackson.databind.ObjectMapper jacksonMapper
-
VALID_EXT
protected static final Pattern VALID_EXT
-
-
Method Detail
-
writeMetadata
public Blob writeMetadata(Blob blob, Map<String,Object> metadata, boolean ignorePrefix)
Description copied from interface:BinaryMetadataProcessorWrite given metadata into given blob. Since 7.3 ignorePrefix is added.- Specified by:
writeMetadatain interfaceBinaryMetadataProcessor- Parameters:
blob- Blob to write.metadata- Metadata to inject.- Returns:
- the updated blob, or
nullif there was an error (since 7.4)
-
readMetadata
@Deprecated(since="11.5") protected Map<String,Object> readMetadata(String command, Blob blob, List<String> metadata, boolean ignorePrefix)
Deprecated.since 11.5, usereadMetadata(String, Blob, List)instead
-
readMetadata
protected Map<String,Object> readMetadata(String command, Blob blob, List<String> metadata)
- Since:
- 11.5
-
readMetadata
public Map<String,Object> readMetadata(Blob blob, List<String> metadata, boolean ignorePrefix)
Description copied from interface:BinaryMetadataProcessorRead from a given blob given metadata map. Since 7.3 ignorePrefix is added.- Specified by:
readMetadatain interfaceBinaryMetadataProcessor- Parameters:
blob- Blob to read.metadata- Metadata to extract.- Returns:
- Metadata map.
-
readMetadata
public Map<String,Object> readMetadata(Blob blob, boolean ignorePrefix)
Description copied from interface:BinaryMetadataProcessorRead all metadata from a given blob. Since 7.3 ignorePrefix is added.- Specified by:
readMetadatain interfaceBinaryMetadataProcessor- Parameters:
blob- Blob to read.- Returns:
- Metadata map.
-
returnResultMap
protected Map<String,Object> returnResultMap(ExecResult er) throws IOException
- Throws:
IOException
-
getTemporaryFile
protected CloseableFile getTemporaryFile(Blob blob) throws IOException
We don't want to rely onBlob.getCloseableFile()because it may return the original and we always want a temporary one to be sure we have a clean filename to pass.- Throws:
IOException- Since:
- 7.4
-
getTemporaryBlob
protected Blob getTemporaryBlob(Blob blob) throws IOException
Gets a new blob on a temporary file which is a copy of the blob's.- Throws:
IOException- Since:
- 7.4
-
-