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 CommandLineExecutorService
commandLineService
protected com.fasterxml.jackson.databind.ObjectMapper
jacksonMapper
protected Pattern
VALID_EXT
-
Constructor Summary
Constructors Constructor Description ExifToolProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>
getCommandTags(List<String> metadataList)
protected List<String>
getCommandTags(Map<String,Object> metadataMap)
protected Blob
getTemporaryBlob(Blob blob)
Gets a new blob on a temporary file which is a copy of the blob's.protected CloseableFile
getTemporaryFile(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 void
parseDates(Map<String,Object> resultMap)
protected Map<String,Object>
readMetadata(String command, Blob blob, List<String> metadata, boolean ignorePrefix)
Map<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)
Blob
writeMetadata(Blob blob, Map<String,Object> metadata, boolean ignorePrefix)
Write given metadata into given blob.
-
-
-
Field Detail
-
jacksonMapper
protected final com.fasterxml.jackson.databind.ObjectMapper jacksonMapper
-
commandLineService
protected final CommandLineExecutorService commandLineService
-
-
Constructor Detail
-
ExifToolProcessor
public ExifToolProcessor()
-
-
Method Detail
-
writeMetadata
public Blob writeMetadata(Blob blob, Map<String,Object> metadata, boolean ignorePrefix)
Description copied from interface:BinaryMetadataProcessor
Write given metadata into given blob. Since 7.3 ignorePrefix is added.- Specified by:
writeMetadata
in interfaceBinaryMetadataProcessor
- Parameters:
blob
- Blob to write.metadata
- Metadata to inject.- Returns:
- the updated blob, or
null
if there was an error (since 7.4)
-
readMetadata
protected Map<String,Object> readMetadata(String command, Blob blob, List<String> metadata, boolean ignorePrefix)
-
readMetadata
public Map<String,Object> readMetadata(Blob blob, List<String> metadata, boolean ignorePrefix)
Description copied from interface:BinaryMetadataProcessor
Read from a given blob given metadata map. Since 7.3 ignorePrefix is added.- Specified by:
readMetadata
in 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:BinaryMetadataProcessor
Read all metadata from a given blob. Since 7.3 ignorePrefix is added.- Specified by:
readMetadata
in interfaceBinaryMetadataProcessor
- Parameters:
blob
- Blob to read.- Returns:
- Metadata map.
-
returnResultMap
protected Map<String,Object> returnResultMap(ExecResult er) throws IOException
- Throws:
IOException
-
parseDates
protected void parseDates(Map<String,Object> resultMap)
- Since:
- 7.4
-
getCommandTags
protected List<String> getCommandTags(List<String> metadataList)
-
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
-
-