@Transactional public class AttachmentServiceImpl extends Object implements AttachmentService
Modifier and Type | Field and Description |
---|---|
protected DataObjectService |
dataObjectService |
protected ConfigurationService |
kualiConfigurationService |
Constructor and Description |
---|
AttachmentServiceImpl() |
Modifier and Type | Method and Description |
---|---|
Attachment |
createAttachment(GloballyUnique parent,
String uploadedFileName,
String mimeType,
int fileSize,
InputStream fileContents,
String attachmentTypeCode)
Stores the given fileContents and returns referring Attachment object which acts as a momento to the archived object.
|
void |
deleteAttachmentContents(Attachment attachment)
Deletes a given DocumentAttachment contents from the corresponding Attachment object
|
void |
deletePendingAttachmentsModifiedBefore(long modificationTime)
Deletes pending attachments that were last modified before the given time.
|
Attachment |
getAttachmentByNoteId(Long noteId)
Retrieves an Attachment by note identifier.
|
ConfigurationService |
getKualiConfigurationService()
Gets the configService attribute.
|
void |
moveAttachmentWherePending(Note note)
Moves attachments on notes from the pending directory to the real one
|
InputStream |
retrieveAttachmentContents(Attachment attachment)
/* (non-Javadoc)
|
void |
setDataObjectService(DataObjectService dataObjectService) |
void |
setKualiConfigurationService(ConfigurationService configService)
Sets the configService attribute value.
|
protected ConfigurationService kualiConfigurationService
protected DataObjectService dataObjectService
public AttachmentServiceImpl()
public Attachment getAttachmentByNoteId(Long noteId)
getAttachmentByNoteId
in interface AttachmentService
AttachmentService.getAttachmentByNoteId(java.lang.Long)
public Attachment createAttachment(GloballyUnique parent, String uploadedFileName, String mimeType, int fileSize, InputStream fileContents, String attachmentTypeCode) throws IOException
AttachmentService
createAttachment
in interface AttachmentService
parent
- - the document to which the attachment belongsuploadedFileName
- - the name of the uploaded filemimeType
- - the uploaded file's mime typefileSize
- - the size of the uploaded file in bytesfileContents
- - an input stream used to read the file's contentsattachmentTypeCode
- -the attachment type codeIOException
AttachmentService.createAttachment(GloballyUnique,
String, String, int, java.io.InputStream, String)
public void moveAttachmentWherePending(Note note)
AttachmentService
moveAttachmentWherePending
in interface AttachmentService
note
- the Note from which to move attachments. If this Note does not
have an attachment then this method does nothing.public void deleteAttachmentContents(Attachment attachment)
AttachmentService
deleteAttachmentContents
in interface AttachmentService
attachment
- - the attachment whose contents are to be deletedpublic InputStream retrieveAttachmentContents(Attachment attachment) throws IOException
retrieveAttachmentContents
in interface AttachmentService
attachment
- - the attachment whose contents are to be retrievedIOException
AttachmentService.retrieveAttachmentContents(org.kuali.rice.krad.bo.Attachment)
public void deletePendingAttachmentsModifiedBefore(long modificationTime)
AttachmentService
deletePendingAttachmentsModifiedBefore
in interface AttachmentService
modificationTime
- the number of milliseconds since "the epoch" (i.e.January 1, 1970, 00:00:00 GMT). java.util.Date and java.util.Calendar's
methods return time in this format. If a pending attachment was modified before this time, then it will be deleted (unless an error occurs)AttachmentService.deletePendingAttachmentsModifiedBefore(long)
public ConfigurationService getKualiConfigurationService()
public void setKualiConfigurationService(ConfigurationService configService)
configService
- The configService to set.public void setDataObjectService(DataObjectService dataObjectService)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.