|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.surf.task.AbstractTask org.springframework.extensions.surf.task.ImportTask
public class ImportTask
Task which can be used to import an archive from a remote location This task was a quick migration from the ScriptImporter bean which was previously used and, as such, does some fairly ridiculous things (like loading the entire byte array into memory). At present, the only archives being distributed are those directly from Alfresco and we know these to be pretty small. Thus, leaving this in for the time being. In short order, however, we should refactor to stream the byte array directly to a temp file on disk.
Field Summary | |
---|---|
protected Connector |
alfrescoConnector
|
protected static String |
DEFAULT_WEBAPP_ID
|
protected static org.apache.commons.logging.Log |
logger
|
protected String |
storeId
|
protected String |
url
|
protected String |
webappId
|
Fields inherited from class org.springframework.extensions.surf.task.AbstractTask |
---|
creator, description, endTime, history, id, isCancelled, isError, isFinished, isRunning, isSuccess, name, progress, progressSize, startTime, status, throwable |
Constructor Summary | |
---|---|
ImportTask(String name)
|
Method Summary | |
---|---|
void |
cancel()
Cancels the task |
void |
execute()
Executes the task |
Connector |
getAlfrescoConnector()
Gets the "alfresco" endpoint connector. |
protected void |
post(ZipFile zf,
ZipEntry zipEntry,
String uri)
|
void |
setAlfrescoConnector(Connector alfrescoConnector)
Sets the "alfresco" endpoint connector |
void |
setStoreId(String storeId)
Sets the store id. |
void |
setUrl(String url)
|
void |
setWebappId(String webappId)
|
protected String |
writeToTempFile(byte[] array)
Writes the contents of an array to a temporary file |
Methods inherited from class org.springframework.extensions.surf.task.AbstractTask |
---|
getCreator, getDescription, getEndTime, getHistory, getId, getName, getProgress, getProgressSize, getStartTime, getStatus, getThrowable, increment, isCancelled, isError, isFinished, isRunning, isSuccess, setCreator, setDescription, setStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log logger
protected static String DEFAULT_WEBAPP_ID
protected Connector alfrescoConnector
protected String storeId
protected String webappId
protected String url
Constructor Detail |
---|
public ImportTask(String name)
Method Detail |
---|
public void setAlfrescoConnector(Connector alfrescoConnector)
context
- the new request contextpublic Connector getAlfrescoConnector()
public void setStoreId(String storeId)
storeId
- the new store idpublic void setWebappId(String webappId)
public void setUrl(String url)
public void cancel()
Task
cancel
in interface Task
cancel
in class AbstractTask
public void execute() throws Throwable
Task
execute
in interface Task
execute
in class AbstractTask
Throwable
protected void post(ZipFile zf, ZipEntry zipEntry, String uri)
protected String writeToTempFile(byte[] array)
array
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |