Package org.xwiki.filemanager.job
Interface FileManager
@Role
@Unstable
public interface FileManager
Exposes APIs to run file system jobs.
- Since:
- 2.0M1
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe string used as a prefix for all file system jobs. -
Method Summary
Modifier and TypeMethodDescriptioncopy(Collection<Path> paths, Path destination) Schedules a job to copy the specified files and folders to the given destination.delete(Collection<Path> paths) Schedules a job to delete the specified files and folders.org.xwiki.job.event.status.JobStatusgetJobStatus(String jobId) move(Collection<Path> paths, Path destination) Schedules a job to move the specified files and folders to the given destination.pack(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 Details
-
JOB_ID_PREFIX
The string used as a prefix for all file system jobs.- See Also:
-
-
Method Details
-
move
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
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
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
- Parameters:
jobId- the job whose status to return- Returns:
- the status of the specified job
-
getActiveJobs
- Returns:
- the list of jobs that are running or are pending for execution
-