public class ExifToolProcessor extends Object implements BinaryMetadataProcessor
Modifier and Type | Field and Description |
---|---|
protected CommandLineExecutorService |
commandLineService |
protected org.codehaus.jackson.map.ObjectMapper |
jacksonMapper |
protected Pattern |
VALID_EXT |
Constructor and Description |
---|
ExifToolProcessor() |
Modifier and Type | Method and 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 on
Blob.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) |
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> |
readMetadata(String command,
Blob blob,
List<String> metadata,
boolean ignorePrefix) |
protected Map<String,Object> |
returnResultMap(ExecResult er) |
Blob |
writeMetadata(Blob blob,
Map<String,Object> metadata,
boolean ignorePrefix)
Write given metadata into given blob.
|
protected final org.codehaus.jackson.map.ObjectMapper jacksonMapper
protected final CommandLineExecutorService commandLineService
public ExifToolProcessor()
public Blob writeMetadata(Blob blob, Map<String,Object> metadata, boolean ignorePrefix)
BinaryMetadataProcessor
writeMetadata
in interface BinaryMetadataProcessor
blob
- Blob to write.metadata
- Metadata to inject.null
if there was an error (since 7.4)protected Map<String,Object> readMetadata(String command, Blob blob, List<String> metadata, boolean ignorePrefix)
public Map<String,Object> readMetadata(Blob blob, List<String> metadata, boolean ignorePrefix)
BinaryMetadataProcessor
readMetadata
in interface BinaryMetadataProcessor
blob
- Blob to read.metadata
- Metadata to extract.public Map<String,Object> readMetadata(Blob blob, boolean ignorePrefix)
BinaryMetadataProcessor
readMetadata
in interface BinaryMetadataProcessor
blob
- Blob to read.protected Map<String,Object> returnResultMap(ExecResult er) throws IOException
IOException
protected void parseDates(Map<String,Object> resultMap)
protected List<String> getCommandTags(List<String> metadataList)
protected CloseableFile getTemporaryFile(Blob blob) throws IOException
Blob.getCloseableFile()
because it may return the original and we always want a
temporary one to be sure we have a clean filename to pass.IOException
protected Blob getTemporaryBlob(Blob blob) throws IOException
IOException
Copyright © 2016 Nuxeo SA. All rights reserved.