public final class AttachmentHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ICON_MIMETYPE_EXT
Extension of the mime type icon
|
static String |
ICON_MIMETYPE_PREFIX
Changing this also check CreateNote.js
|
static String |
MIME_TYPE_APPLICATION_UNKNOWN
Application type for unknown stuff
|
Modifier and Type | Method and Description |
---|---|
static Long[] |
copyAttachments(Collection<Attachment> attachments)
Copies all attachments of a note and returns an array containing the attachment ids of the
copies.
|
static String |
determineAbsoluteAttachmentUrl(Attachment resource)
Determine the absolute URL Path for a resource
|
static String |
determineAbsoluteAttachmentUrl(Attachment resource,
boolean isSecure)
Determine the absolute URL Path for a resource
|
static String |
determineAbsoluteAttachmentUrl(AttachmentData resource,
boolean isSecure)
Determine the absolute URL Path for a resource
|
static String |
determineKnownMimeType(Attachment attachment)
Match the contentype of the attachment to the known mime types
|
static String |
determineKnownMimeType(AttachmentData attachment)
Match the contentype of the attachment to the known mime types
|
static String |
determineKnownMimeType(String mimeType)
Match the mime type to the known mime types
|
static String |
determineMimeTypeIconName(Attachment attachment)
Well its not frontend here, but we do this anyway in here
|
static String |
determineRelativeAttachmentUrl(Attachment resource)
Determine the resource url for download/access for the given item
|
static String |
determineRelativeAttachmentUrl(AttachmentData resource)
Determine the resource URL for download/access for the given list item
|
public static final String ICON_MIMETYPE_PREFIX
public static final String ICON_MIMETYPE_EXT
public static final String MIME_TYPE_APPLICATION_UNKNOWN
public static Long[] copyAttachments(Collection<Attachment> attachments) throws AuthorizationException
attachments
- Attachments, which should be copiedAuthorizationException
- in case there is no current userpublic static String determineAbsoluteAttachmentUrl(Attachment resource)
resource
- the Item to get the absolute URL for accessing this filepublic static String determineAbsoluteAttachmentUrl(Attachment resource, boolean isSecure)
resource
- the Item to get the absolute URL for accessing this fileisSecure
- whether the URL should be rendered with the HTTPS or HTTP protocol. If the
configuration states that HTTPS is not supported, the returned URL will use the
HTTP protocol.public static String determineAbsoluteAttachmentUrl(AttachmentData resource, boolean isSecure)
resource
- the Item to get the absolute URL for accessing this fileisSecure
- whether the URL should be rendered with the HTTPS or HTTP protocol. If the
configuration states that HTTPS is not supported, the returned URL will use the
HTTP protocol.public static String determineKnownMimeType(Attachment attachment)
attachment
- the attachment to usepublic static String determineKnownMimeType(AttachmentData attachment)
attachment
- the attachment to usepublic static String determineKnownMimeType(String mimeType)
mimeType
- the mime type to matchpublic static String determineMimeTypeIconName(Attachment attachment)
attachment
- the attachmentpublic static String determineRelativeAttachmentUrl(Attachment resource)
resource
- the resourcepublic static String determineRelativeAttachmentUrl(AttachmentData resource)
resource
- the resource list itemCopyright © 2019 Communote team. All rights reserved.