public interface ExecutionStrategy extends AutoCloseable
stay_open
flag: this strategy means that a
process is started and re-used for next executions.
execute(com.thebuzzmedia.exiftool.process.CommandExecutor, java.lang.String, java.util.List<java.lang.String>, com.thebuzzmedia.exiftool.process.OutputHandler)
method.
Implementation should also define a close method: this method
will be used to stop remaining process and clean previous execution.
Calling close()
method should not prevent instances to be used
for a next execution.Modifier and Type | Method and Description |
---|---|
void |
close()
This method should be used to:
Close remaining process (if any).
Clean previous executions.
For instance, with the
stay_open flag, this method should:
Close opened process.
Stop task used to automatically close process.
Once closed, ExifTool should still be able to use this strategy
if a call to execute(com.thebuzzmedia.exiftool.process.CommandExecutor, java.lang.String, java.util.List<java.lang.String>, com.thebuzzmedia.exiftool.process.OutputHandler) is made. |
void |
execute(CommandExecutor executor,
String exifTool,
List<String> arguments,
OutputHandler handler)
Execute exiftool command.
|
boolean |
isRunning()
Check if exiftool process is currently running.
|
boolean |
isSupported(Version version)
Check if this strategy should is supported with this specific version.
|
void execute(CommandExecutor executor, String exifTool, List<String> arguments, OutputHandler handler) throws IOException
executor
- ExifTool withExecutor.exifTool
- ExifTool withPath.arguments
- Command line arguments.handler
- Handler to read command output.IOException
- If an error occurred during execution.boolean isRunning()
stay_open
flag has been enabled.true
if exiftool
process is currently open, false
otherwise.boolean isSupported(Version version)
version
- ExifTool Version.true
if this strategy may be used safely with this specific version, false
otherwise.void close() throws Exception
stay_open
flag, this method should:
execute(com.thebuzzmedia.exiftool.process.CommandExecutor, java.lang.String, java.util.List<java.lang.String>, com.thebuzzmedia.exiftool.process.OutputHandler)
is made.close
in interface AutoCloseable
Exception
Copyright © 2015. All Rights Reserved.