Package org.xwiki.filemanager.job
Interface FileManager
-
@Role @Unstable public interface FileManagerExposes APIs to run file system jobs.- Since:
- 2.0M1
- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description static StringJOB_ID_PREFIXThe string used as a prefix for all file system jobs.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringcopy(Collection<Path> paths, Path destination)Schedules a job to copy the specified files and folders to the given destination.Stringdelete(Collection<Path> paths)Schedules a job to delete the specified files and folders.List<String>getActiveJobs()org.xwiki.job.event.status.JobStatusgetJobStatus(String jobId)Stringmove(Collection<Path> paths, Path destination)Schedules a job to move the specified files and folders to the given destination.Stringpack(Collection<Path> paths, org.xwiki.model.reference.AttachmentReference outputFileReference)Packs the specified files and folders in a single ZIP archive that is written in the specified output file.
-
-
-
Field Detail
-
JOB_ID_PREFIX
static final String JOB_ID_PREFIX
The string used as a prefix for all file system jobs.- See Also:
- Constant Field Values
-
-
Method Detail
-
move
String move(Collection<Path> paths, Path destination) throws org.xwiki.job.JobException
Schedules a job to move the specified files and folders to the given destination.- Parameters:
paths- the files and folders to movedestination- where to move the specified files and folders- Returns:
- the id of the move job that has been scheduled
- Throws:
org.xwiki.job.JobException- if scheduling the move job fails
-
copy
String copy(Collection<Path> paths, Path destination) throws org.xwiki.job.JobException
Schedules a job to copy the specified files and folders to the given destination.- Parameters:
paths- the files and folders to copydestination- where to copy the specified files and folders- Returns:
- the id of the copy job that has been scheduled
- Throws:
org.xwiki.job.JobException- if scheduling the copy job fails
-
delete
String delete(Collection<Path> paths) throws org.xwiki.job.JobException
Schedules a job to delete the specified files and folders.- Parameters:
paths- the files and folders to delete- Returns:
- the id of the delete job that has been scheduled
- Throws:
org.xwiki.job.JobException- if scheduling the delete job fails
-
pack
String pack(Collection<Path> paths, org.xwiki.model.reference.AttachmentReference outputFileReference) throws org.xwiki.job.JobException
Packs the specified files and folders in a single ZIP archive that is written in the specified output file.The
DocumentReferencepart of the givenAttachmentReferencerepresents the document that is going to be used to access the output ZIP file. This means that only users with view right on this document can access the output file. Thenameproperty of the givenAttachmentReferencewill be used as the name of the output ZIP file.The output file is a temporary file (deleted automatically when the server is stopped) that can be accessed through the 'temp' action, e.g.:
/xwiki/temp/Space/Page/filemanager/file.zip.- Parameters:
paths- the files and folders to be packedoutputFileReference- the reference to the temporary output file- Returns:
- the id of the pack job that has been scheduled
- Throws:
org.xwiki.job.JobException- if scheduling the pack job fails- Since:
- 2.0M2
-
getJobStatus
org.xwiki.job.event.status.JobStatus getJobStatus(String jobId)
- Parameters:
jobId- the job whose status to return- Returns:
- the status of the specified job
-
-