|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.rice.kns.service.impl.AttachmentServiceImpl
@Transactional public class AttachmentServiceImpl
Attachment service implementation
Field Summary | |
---|---|
private AttachmentDao |
attachmentDao
|
private KualiConfigurationService |
kualiConfigurationService
|
private static org.apache.log4j.Logger |
LOG
|
private static int |
MAX_DIR_LEVELS
|
private Map<String,String> |
mimeTypeMapping
|
Constructor Summary | |
---|---|
AttachmentServiceImpl()
|
Method Summary | |
---|---|
String |
convertMimeTypeToIconPath(String attachmentMimeTypeCode)
|
Attachment |
createAttachment(PersistableBusinessObject parent,
String uploadedFileName,
String mimeType,
int fileSize,
InputStream fileContents,
String attachmentTypeCode)
Stores the given fileContents and returns referring Attachment object whieh 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. |
AttachmentDao |
getAttachmentDao()
Retrieves a data access object |
private String |
getDocumentDirectory(String objectId)
|
private String |
getDocumentFileStorageLocation(String objectId)
|
KualiConfigurationService |
getKualiConfigurationService()
Gets the configService attribute. |
Map<String,String> |
getMimeTypeMapping()
|
private String |
getPendingDirectory()
|
private void |
moveAttachmentFromPending(Attachment attachment,
String objectId)
|
void |
moveAttachmentsWherePending(List notes,
String objectId)
Moves attachments on notes from the pending directory to the real one |
InputStream |
retrieveAttachmentContents(Attachment attachment)
/* (non-Javadoc) |
void |
setAttachmentDao(AttachmentDao d)
Sets the data access object |
void |
setKualiConfigurationService(KualiConfigurationService configService)
Sets the configService attribute value. |
void |
setMimeTypeMapping(Map<String,String> mimeTypeMapping)
|
private void |
writeInputStreamToFileStorage(InputStream fileContents,
String fullPathUniqueFileName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int MAX_DIR_LEVELS
private static org.apache.log4j.Logger LOG
private KualiConfigurationService kualiConfigurationService
private AttachmentDao attachmentDao
private Map<String,String> mimeTypeMapping
Constructor Detail |
---|
public AttachmentServiceImpl()
Method Detail |
---|
public Attachment getAttachmentByNoteId(Long noteId)
getAttachmentByNoteId
in interface AttachmentService
AttachmentService.getAttachmentByNoteId(java.lang.Long)
public String convertMimeTypeToIconPath(String attachmentMimeTypeCode)
convertMimeTypeToIconPath
in interface AttachmentService
public Attachment createAttachment(PersistableBusinessObject parent, String uploadedFileName, String mimeType, int fileSize, InputStream fileContents, String attachmentTypeCode) throws IOException
AttachmentService
createAttachment
in interface AttachmentService
IOException
org.kuali.rice.kns.service.DocumentAttachmentService#createAttachment(java.lang.String, java.lang.String, int,
java.io.InputStream, Document)
private void writeInputStreamToFileStorage(InputStream fileContents, String fullPathUniqueFileName) throws IOException
IOException
public void moveAttachmentsWherePending(List notes, String objectId)
AttachmentService
moveAttachmentsWherePending
in interface AttachmentService
private void moveAttachmentFromPending(Attachment attachment, String objectId) throws IOException
IOException
public void deleteAttachmentContents(Attachment attachment)
AttachmentService
deleteAttachmentContents
in interface AttachmentService
private String getPendingDirectory()
private String getDocumentDirectory(String objectId)
public InputStream retrieveAttachmentContents(Attachment attachment) throws IOException
retrieveAttachmentContents
in interface AttachmentService
IOException
org.kuali.rice.kns.service.DocumentAttachmentService#retrieveAttachmentContents(org.kuali.rice.kns.document.DocumentAttachment)
private String getDocumentFileStorageLocation(String objectId)
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 void setAttachmentDao(AttachmentDao d)
d
- public AttachmentDao getAttachmentDao()
public KualiConfigurationService getKualiConfigurationService()
public void setKualiConfigurationService(KualiConfigurationService configService)
configService
- The configService to set.public Map<String,String> getMimeTypeMapping()
public void setMimeTypeMapping(Map<String,String> mimeTypeMapping)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |