public class StayOpenStrategy extends Object implements ExecutionStrategy
exiftool
with the stay_open
feature.Constructor and Description |
---|
StayOpenStrategy(Scheduler scheduler)
Create strategy.
|
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 ExecutionStrategy.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.
|
protected void |
finalize() |
boolean |
isRunning()
Check if exiftool process is currently running.
|
boolean |
isSupported(Version version)
Check if this strategy should is supported with this specific version.
|
public StayOpenStrategy(Scheduler scheduler)
scheduler
- Delay between automatic cleanup.public void execute(CommandExecutor executor, String exifTool, List<String> arguments, OutputHandler handler) throws IOException
ExecutionStrategy
execute
in interface ExecutionStrategy
executor
- ExifTool withExecutor.exifTool
- ExifTool withPath.arguments
- Command line arguments.handler
- Handler to read command output.IOException
- If an error occurred during execution.public boolean isRunning()
ExecutionStrategy
stay_open
flag has been enabled.isRunning
in interface ExecutionStrategy
true
if exiftool
process is currently open, false
otherwise.public boolean isSupported(Version version)
ExecutionStrategy
isSupported
in interface ExecutionStrategy
version
- ExifTool Version.true
if this strategy may be used safely with this specific version, false
otherwise.public void close() throws Exception
ExecutionStrategy
stay_open
flag, this method should:
ExecutionStrategy.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 ExecutionStrategy
close
in interface AutoCloseable
Exception
Copyright © 2015. All Rights Reserved.