Package org.sikuli.script.runners
Class ZipRunner
- java.lang.Object
-
- org.sikuli.script.runners.AbstractScriptRunner
-
- org.sikuli.script.runners.AbstractLocalFileScriptRunner
-
- org.sikuli.script.runners.ZipRunner
-
- All Implemented Interfaces:
IScriptRunner
- Direct Known Subclasses:
JarExeRunner,JarRunner,SKLRunner
public class ZipRunner extends AbstractLocalFileScriptRunner
Runs a packed sikulix script- Author:
- mbalmer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sikuli.script.support.IScriptRunner
IScriptRunner.EffectiveRunner, IScriptRunner.Options
-
-
Constructor Summary
Constructors Constructor Description ZipRunner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(String identifier)Checks if this runner can handle the given identifier.protected voiddoAbort()Interrupts the worker thread.protected intdoRunScript(String zipFile, String[] scriptArgs, IScriptRunner.Options options)IScriptRunner.EffectiveRunnergetEffectiveRunner(String zipFile)Needed in the IDE to detect the runner when file or folder is openedString[]getExtensions()returns the list of possible script file extensions, first is the defaultStringgetName()Gets the name of the ScriptRunner.protected StringgetScriptEntryName(ZipFile file)StringgetType()return the type of script this handler can execute.booleanhasTempBundle()booleanisAbortSupported()Checks if abort is supported by this script runner implementation.booleanisSupported()Checks if the current platform supports this runner.protected ZipFileopenZipFile(String identifier)-
Methods inherited from class org.sikuli.script.runners.AbstractLocalFileScriptRunner
adjustBundlePath, resetBundlePath
-
Methods inherited from class org.sikuli.script.runners.AbstractScriptRunner
abort, canHandleFileEnding, close, doClose, doEvalScript, doInit, doRedirect, doRunLines, evalScript, execAfter, execBefore, getDefaultExtension, getFileEndings, hasExtension, init, isAborted, isReady, isRunning, log, redirect, reset, runLines, runScript
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
EXTENSIONS
public static final String[] EXTENSIONS
-
-
Method Detail
-
isSupported
public boolean isSupported()
Description copied from interface:IScriptRunnerChecks if the current platform supports this runner.- Specified by:
isSupportedin interfaceIScriptRunner- Overrides:
isSupportedin classAbstractScriptRunner- Returns:
- true if platform supports this runner, false otherwise
-
getName
public String getName()
Description copied from interface:IScriptRunnerGets the name of the ScriptRunner. Should be unique. This value is needed to distinguish between different ScriptRunners.- Returns:
- Name to identify the ScriptRunner or null if not available
-
getExtensions
public String[] getExtensions()
Description copied from interface:IScriptRunnerreturns the list of possible script file extensions, first is the default- Returns:
- array of strings
-
getType
public String getType()
Description copied from interface:IScriptRunnerreturn the type of script this handler can execute.- Returns:
-
canHandle
public boolean canHandle(String identifier)
Description copied from interface:IScriptRunnerChecks if this runner can handle the given identifier.- Specified by:
canHandlein interfaceIScriptRunner- Overrides:
canHandlein classAbstractLocalFileScriptRunner- Parameters:
identifier- Can be Runner name, type or one of its supported extensions Can also be script code prefixed with the runnerName (e.g. JavaScript*console.log("hello"))- Returns:
- true if the runner can handle the identifier, false otherwise
-
hasTempBundle
public boolean hasTempBundle()
-
openZipFile
protected ZipFile openZipFile(String identifier) throws IOException
- Throws:
IOException
-
doRunScript
protected int doRunScript(String zipFile, String[] scriptArgs, IScriptRunner.Options options)
- Overrides:
doRunScriptin classAbstractScriptRunner
-
getEffectiveRunner
public IScriptRunner.EffectiveRunner getEffectiveRunner(String zipFile)
Description copied from interface:IScriptRunnerNeeded in the IDE to detect the runner when file or folder is opened- Specified by:
getEffectiveRunnerin interfaceIScriptRunner- Overrides:
getEffectiveRunnerin classAbstractScriptRunner- Returns:
- array: EffectiveRunner object
-
isAbortSupported
public boolean isAbortSupported()
Description copied from interface:IScriptRunnerChecks if abort is supported by this script runner implementation.- Specified by:
isAbortSupportedin interfaceIScriptRunner- Overrides:
isAbortSupportedin classAbstractScriptRunner- Returns:
- true is abort is supported, false otherwise
-
doAbort
protected void doAbort()
Description copied from class:AbstractScriptRunnerInterrupts the worker thread. Can be overridden by Runner implementations if an interrupt is not needed.- Overrides:
doAbortin classAbstractScriptRunner
-
-