public class FileSystemAttachmentService extends java.lang.Object implements AttachmentService
Constructor and Description |
---|
FileSystemAttachmentService(java.lang.String attachmentsDirectory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
copy(java.lang.String jobId,
java.io.File destination)
Copy all the attachments for a job into the specified directory.
|
void |
delete(java.lang.String jobId)
Delete the attachments for the given job.
|
void |
save(java.lang.String jobId,
java.lang.String filename,
java.io.InputStream content)
Save a given attachment for a job for later retrieval.
|
public FileSystemAttachmentService(java.lang.String attachmentsDirectory)
attachmentsDirectory
- The directory to use or null if want to default to system temp directorypublic void save(java.lang.String jobId, java.lang.String filename, java.io.InputStream content) throws GenieException
save
in interface AttachmentService
jobId
- The id of the job to save the attachment forfilename
- The name of the attachmentcontent
- A stream to access the contents of the attachmentGenieException
- For any error during the save processpublic void copy(java.lang.String jobId, java.io.File destination) throws GenieException
copy
in interface AttachmentService
jobId
- The id of the job to get the attachments for.destination
- The directory to copy the attachments intoGenieException
- For any error during the copy processpublic void delete(java.lang.String jobId) throws GenieException
delete
in interface AttachmentService
jobId
- The id of the job to delete the attachments forGenieException
- For any error during the delete process