public interface ExecutionStrategy
extends java.lang.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.
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,
java.lang.String exifTool,
java.util.List<java.lang.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 |
shutdown()
Shutdown the strategy.
|
void execute(CommandExecutor executor, java.lang.String exifTool, java.util.List<java.lang.String> arguments, OutputHandler handler) throws java.io.IOException
executor
- ExifTool withExecutor.exifTool
- ExifTool withPath.arguments
- Command line arguments.handler
- Handler to read command output.java.io.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 java.lang.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 java.lang.AutoCloseable
java.lang.Exception
- If an error occurred while stopping exiftool client.void shutdown() throws java.lang.Exception
java.lang.Exception
- If an error occurred while stopping exiftool client.Copyright © 2019. All Rights Reserved.