@Component @Named(value="xar") @Singleton @Unstable public class XarScriptService extends Object implements org.xwiki.script.service.ScriptService
| Modifier and Type | Field and Description |
|---|---|
static String |
ERROR_KEY
The key under which the last encountered error is stored in the current execution context.
|
protected org.xwiki.context.Execution |
execution
Provides access to the current context.
|
| Constructor and Description |
|---|
XarScriptService() |
| Modifier and Type | Method and Description |
|---|---|
Exception |
getLastError()
Get the error generated while performing the previously called action.
|
XarPackage |
getXarPackage(File file)
Generate a
XarPackage from the passed XAR file. |
XarPackage |
getXarPackage(InputStream stream,
boolean close)
Generate a
XarPackage from the passed XAR file. |
protected void |
setError(Exception e)
Store a caught exception in the context, so that it can be later retrieved using
getLastError(). |
public static final String ERROR_KEY
@Inject protected org.xwiki.context.Execution execution
public Exception getLastError()
null if no exception was thrownprotected void setError(Exception e)
getLastError().e - the exception to store, can be null to clear the previously stored exceptiongetLastError()public XarPackage getXarPackage(File file)
XarPackage from the passed XAR file.file - the XAR filepublic XarPackage getXarPackage(InputStream stream, boolean close)
XarPackage from the passed XAR file.stream - the XAR fileclose - indicate if the passed stream should be closed at the endCopyright © 2004–2015 XWiki. All rights reserved.