public class AttachmentFile extends SeparateAssociate implements KcAttachment
| Modifier and Type | Class and Description |
|---|---|
static class |
AttachmentFile.CreateException
Exception thrown when unable to create instance from static factory.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_FILE_NAME_LENGTH
the max file name length.
|
static int |
MAX_FILE_TYPE_LENGTH
the max file type length.
|
UPDATE_USER_LENGTH| Constructor and Description |
|---|
AttachmentFile()
empty ctor to satisfy JavaBean convention.
|
AttachmentFile(String name,
String type,
byte[] data)
Convenience ctor to set the relevant properties of this class.
|
| Modifier and Type | Method and Description |
|---|---|
static AttachmentFile |
createFromFormFile(org.apache.struts.upload.FormFile formFile)
factory method creating an instance from a
FormFile. |
boolean |
equals(Object obj) |
byte[] |
getData()
Gets the Protocol Attachment File data.
|
String |
getIconPath()
Return the image file path based on mime type or other criteria.
|
Long |
getId()
Gets the id.
|
String |
getName()
Gets the Protocol Attachment File name.
|
String |
getType()
Gets the Protocol Attachment File type.
|
int |
hashCode() |
void |
setData(byte[] data)
Sets the Protocol Attachment File data.
|
void |
setId(Long id)
Sets the id.
|
void |
setName(String name)
Sets the Protocol Attachment File name.
|
void |
setType(String type)
Sets the Protocol Attachment File type.
|
getSequenceNumber, incrementSequenceNumber, resetPersistenceState, setSequenceNumbergetAuthorPersonName, getKcPersonService, getUpdateTimestamp, getUpdateUser, isUpdateUserSet, postPersist, prePersist, preUpdate, setUpdateTimestamp, setUpdateUser, setUpdateUserSetafterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, buildListOfDeletionAwareLists, getExtension, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isNewCollectionRecord, linkEditableUserFields, postLoad, postRemove, postUpdate, preRemove, refresh, refreshNonUpdateableReferences, refreshReferenceObject, setExtension, setNewCollectionRecord, setObjectId, setVersionNumberpublic static final int MAX_FILE_NAME_LENGTH
public static final int MAX_FILE_TYPE_LENGTH
public AttachmentFile()
public static final AttachmentFile createFromFormFile(org.apache.struts.upload.FormFile formFile)
FormFile.
If the file name's length > MAX_FILE_NAME_LENGTH then the name will be
modified.
If the file type's length > MAX_FILE_TYPE_LENGTH then the type will be
modified.
formFile - the FormFileIllegalArgumentException - if the formfile is null.AttachmentFile.CreateException - if unable to create from FormFile.public String getName()
getName in interface KcAttachmentpublic void setName(String name)
name - the Protocol Attachment File namepublic String getType()
getType in interface KcAttachmentpublic void setType(String type)
type - the Protocol Attachment File typepublic byte[] getData()
getData in interface KcAttachmentpublic void setData(byte[] data)
data - the Protocol Attachment File datapublic int hashCode()
hashCode in class SeparateAssociatepublic boolean equals(Object obj)
equals in class SeparateAssociatepublic String getIconPath()
KcAttachmentgetIconPath in interface KcAttachmentpublic Long getId()
SeparateAssociategetId in class SeparateAssociatepublic void setId(Long id)
SeparateAssociatesetId in class SeparateAssociateid - the idCopyright © 2013 The Kuali Foundation. All Rights Reserved.