Class DefaultAttachmentManager
- java.lang.Object
-
- com.atlassian.confluence.pages.DefaultAttachmentManager
-
- All Implemented Interfaces:
AttachmentManagerInternal,AttachmentManager
public class DefaultAttachmentManager extends Object implements AttachmentManagerInternal
Default implementation ofAttachmentManager. The storage location of attachments is not defined, and is handled by the AttachmentDao.
-
-
Constructor Summary
Constructors Constructor Description DefaultAttachmentManager()Deprecated.since 5.2, use#DefaultAttachmentManager(AttachmentDaoInternal, ContentEntityObjectDaoInternal>, EventPublisher, UserPreferencesAccessor, NotificationManager, RelationManager, RetentionFeatureChecker, ContentReconciliationManager)DefaultAttachmentManager(AttachmentDaoInternal attachmentDao, ContentEntityObjectDaoInternal<?> contentEntityObjectDao, com.atlassian.event.api.EventPublisher eventPublisher, UserPreferencesAccessor userPreferencesAccessor, NotificationManager notificationManager, RelationManager relationManager, RetentionFeatureChecker retentionFeatureChecker, ContentReconciliationManager reconciliationManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcopyAttachment(Attachment attachment, ContentEntityObject destinationContent)Copy specified attachment to specified destination content.voidcopyAttachments(ContentEntityObject sourceContent, ContentEntityObject destinationContent)Copy the latest version of all the attachments on the sourceContent to the destinationContent.voidcopyAttachments(ContentEntityObject sourceContent, ContentEntityObject destinationContent, SaveContext saveContext)Copy the latest version of all the attachments on the sourceContent to the destinationContent.intcountLatestVersionsOfAttachments(ContentEntityObject content)Returns a count of the number of latest versions of attachmentsintcountLatestVersionsOfAttachmentsOnPageSince(ContentEntityObject content, Date since)Fetches number of attachments changed on a page since a specific timestampintcountLatestVersionsOfAttachmentsWithAnyStatus(ContentEntityObject content)Returns a count of the number of latest versions of attachments (including trashed)voiddeepAttachmentDelete(AttachmentDeleteOptions attachmentDeleteOptions)Support delete multiple attachments in batchList<Attachment>getAllVersions(Attachment attachment)Get all versions of an attachment, starting with the current versionList<Attachment>getAllVersionsOfAttachments(ContentEntityObject content)Returns a list of all attachments, old and new.AttachmentgetAttachment(long id)AttachmentgetAttachment(ContentEntityObject content, String attachmentFileName)Get the most recent version of an attachment with a given name for a particular page.AttachmentgetAttachment(ContentEntityObject content, String attachmentFileName, int version)Retrieve a named attachment from a page.AttachmentDaogetAttachmentDao()Retrieves the AttachmentDao for the AttachmentManagerInputStreamgetAttachmentData(Attachment attachment)Retrieve the data for attachmentInputStreamgetAttachmentData(Attachment attachment, Optional<RangeRequest> range)Retrieve the specified range of data for attachmentStringgetAttachmentDownloadPath(ContentEntityObject content, String attachmentFileName)Get the download path for the most recent version of an attachment with the given name for some contentcom.atlassian.fugue.Maybe<Attachment>getAttachmentForDownloadPath(String downloadPath)Deprecated.since 7.0.1.PageResponse<Attachment>getAttachments(ContentEntityObject content, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Attachment> filterPredicate)Deprecated.since 7.0.1.List<Attachment>getAttachments(List<Long> ids)Returns a list of attachments matching the given list of IDs.Optional<AttachmentStatisticsDTO>getAttachmentStatistics()Fetches statistics about attachmentsAttachmentDataStorageTypegetBackingStorageType()Returns the currently active storage type.AttachmentDao.AttachmentCopiergetCopier(AttachmentManager destination)Retrieves a AttachmentDao.AttachmentCopier that will allow the attachments from one data store to be copied across to another.List<Attachment>getLastAddedVersionsOf(Attachment attachment)Retrieves all the last added versions for each user who has added a version of the attachment That is, if a user has added multiple versions, only the latest added version will be added to the list returned.List<Attachment>getLatestVersionsOfAttachments(ContentEntityObject content)Returns a list of only latest versions of attachments.List<Attachment>getLatestVersionsOfAttachmentsForMultipleCeos(Iterable<? extends ContentEntityObject> contentEntityObjects)Returns a list of all the latest versions of attachments for all the CEOs providedList<Attachment>getLatestVersionsOfAttachmentsWithAnyStatus(ContentEntityObject content)Returns a list of only latest versions of attachments (including trashed).List<Attachment>getLatestVersionsOfAttachmentsWithAnyStatusForContainers(Iterable<? extends ContentEntityObject> contentEntityObjects)Returns a list of all the latest versions of attachments for all the CEOs provided (including trashed)AttachmentDao.AttachmentMigratorgetMigrator(AttachmentManager destination)Retrieves a AttachmentDao.AttachmentMigrator that will allow the attachments from one data store to be moved across to another.List<Attachment>getPreviousVersions(Attachment attachment)Get all non-current versions of an attachment, not including the current version.Map<Long,Long>getRemappedAttachmentIds()Gets a list of remapped attachment IDs.voidmoveAttachment(Attachment attachment, ContentEntityObject newContainer)Moves an attachment to a differentContentEntityObjectcontainer.voidmoveAttachment(Attachment latestVersion, String newFileName, ContentEntityObject newContent)voidremoveAttachmentFromServer(Attachment latestVersion)Removes the attachment and all previous versionsvoidremoveAttachments(List<? extends Attachment> attachments)Removes the contents of attachments from the servervoidremoveAttachmentVersionFromServer(Attachment attachment)Removes the given version of the Attachment and its data from the server and data store.voidremoveAttachmentVersionFromServerWithoutNotifications(Attachment attachment)Removes the given version of the Attachment and its data from the server and data store while suppressing notifications.voidremoveAttachmentWithoutNotifications(Attachment latestVersion)Removes an Attachment and its data from the server while suppressing notifications.voidrestore(Attachment attachment)Restores an attachment from trash.voidsaveAttachment(Attachment attachment, Attachment previousVersion, InputStream attachmentData)Saves an Attachment and its datavoidsaveAttachment(Attachment attachment, Attachment previousVersion, InputStream attachmentData, SaveContext saveContext)Saves an Attachment and its data, taking aSaveContextto allow more useful event handling.voidsaveAttachments(List<SavableAttachment> savableAttachments)Saves multiple attachment and their datavoidsaveAttachments(List<SavableAttachment> savableAttachments, SaveContext saveContext)Saves multiple attachment and their dataprotected voidsaveNewAttachment(Attachment attachment, InputStream attachmentData, SaveContext saveContext)protected voidsaveNewAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream attachmentData, SaveContext saveContext)voidsetAttachmentDao(AttachmentDaoInternal attachmentDao)voidsetAttachmentData(Attachment attachment, InputStream attachmentData)Set the data belonging to attachmentvoidtrash(Attachment attachment)Moves an attachment to the trash.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.pages.AttachmentManager
findAttachmentForDownloadPath
-
Methods inherited from interface com.atlassian.confluence.internal.pages.AttachmentManagerInternal
getFilteredAttachments
-
-
-
-
Constructor Detail
-
DefaultAttachmentManager
public DefaultAttachmentManager(AttachmentDaoInternal attachmentDao, ContentEntityObjectDaoInternal<?> contentEntityObjectDao, com.atlassian.event.api.EventPublisher eventPublisher, UserPreferencesAccessor userPreferencesAccessor, NotificationManager notificationManager, RelationManager relationManager, RetentionFeatureChecker retentionFeatureChecker, ContentReconciliationManager reconciliationManager)
- Since:
- 7.16
-
DefaultAttachmentManager
@Deprecated public DefaultAttachmentManager()
Deprecated.since 5.2, use#DefaultAttachmentManager(AttachmentDaoInternal, ContentEntityObjectDaoInternal>, EventPublisher, UserPreferencesAccessor, NotificationManager, RelationManager, RetentionFeatureChecker, ContentReconciliationManager)
-
-
Method Detail
-
getAttachment
public Attachment getAttachment(ContentEntityObject content, String attachmentFileName)
Get the most recent version of an attachment with a given name for a particular page. If the supplied content parameter is not a type which contains attachments (e.g. Comment) then attempt to find the nearest owner that does have attachments.- Specified by:
getAttachmentin interfaceAttachmentManager- Parameters:
content- the page the attachment is attached toattachmentFileName- the filename of the attachment to be retrieved- Returns:
- the appropriate attachment, or null if no such attachment exists
-
getAttachmentDownloadPath
public String getAttachmentDownloadPath(ContentEntityObject content, String attachmentFileName)
Description copied from interface:AttachmentManagerGet the download path for the most recent version of an attachment with the given name for some content- Specified by:
getAttachmentDownloadPathin interfaceAttachmentManager- Parameters:
content- the content the attachment is attached toattachmentFileName- the filename of the attachment to be retrieved- Returns:
- the appropriate attachment download path, or null if no such attachment exists
-
getAttachment
public Attachment getAttachment(ContentEntityObject content, String attachmentFileName, int version)
Retrieve a named attachment from a page. If the supplied content parameter is not a type which contains attachments (e.g. Comment) then attempt to find the nearest owner that does have attachments.- Specified by:
getAttachmentin interfaceAttachmentManager- Parameters:
content- the page the attachment is attached toattachmentFileName- the filename of the attachment to retrieveversion- the version of the attachment to retrieve. If you provide a version of 0 or less, you'll get the most recent version, but you should probably use #getAttachment(AbstractPage, String) instead for that purpose instead- Returns:
- the requested attachment, or null if the requested attachment does not exist.
-
saveAttachment
public void saveAttachment(Attachment attachment, Attachment previousVersion, InputStream attachmentData) throws IOException
Description copied from interface:AttachmentManagerSaves an Attachment and its data- Specified by:
saveAttachmentin interfaceAttachmentManager- Parameters:
attachment- the modified version of the AttachmentpreviousVersion- the original version of the Attachment (null if new)attachmentData- an InputStream representing the data of the Attachment- Throws:
IOException
-
saveAttachment
public void saveAttachment(Attachment attachment, Attachment previousVersion, InputStream attachmentData, SaveContext saveContext) throws IOException
Description copied from interface:AttachmentManagerSaves an Attachment and its data, taking aSaveContextto allow more useful event handling.- Specified by:
saveAttachmentin interfaceAttachmentManager- Parameters:
attachment- the modified version of the AttachmentpreviousVersion- the original version of the Attachment (null if new)attachmentData- an InputStream representing the data of the AttachmentsaveContext- provides more information about the circumstances of the save- Throws:
IOException
-
saveAttachments
public void saveAttachments(List<SavableAttachment> savableAttachments) throws IOException
Description copied from interface:AttachmentManagerSaves multiple attachment and their data- Specified by:
saveAttachmentsin interfaceAttachmentManager- Parameters:
savableAttachments- the modified version of the Attachment- Throws:
IOException
-
saveAttachments
public void saveAttachments(List<SavableAttachment> savableAttachments, SaveContext saveContext) throws IOException
Description copied from interface:AttachmentManagerSaves multiple attachment and their data- Specified by:
saveAttachmentsin interfaceAttachmentManager- Parameters:
savableAttachments- the modified version of the AttachmentsaveContext- provides more details about saving. If in doubt passDefaultSaveContext.DEFAULT.- Throws:
IOException
-
saveNewAttachment
protected final void saveNewAttachment(Attachment attachment, InputStream attachmentData, SaveContext saveContext)
-
saveNewAttachmentVersion
protected final void saveNewAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream attachmentData, SaveContext saveContext) throws IOException
- Throws:
IOException
-
getPreviousVersions
public List<Attachment> getPreviousVersions(Attachment attachment)
Description copied from interface:AttachmentManagerGet all non-current versions of an attachment, not including the current version. (ordered from most recent)- Specified by:
getPreviousVersionsin interfaceAttachmentManager- Parameters:
attachment- the attachment to get all non-current versions for.
-
getLastAddedVersionsOf
public List<Attachment> getLastAddedVersionsOf(Attachment attachment)
Description copied from interface:AttachmentManagerRetrieves all the last added versions for each user who has added a version of the attachment That is, if a user has added multiple versions, only the latest added version will be added to the list returned. Result will be sorted with the earliest version coming first.- Specified by:
getLastAddedVersionsOfin interfaceAttachmentManager- Parameters:
attachment- attachment (must be the latest version)- Returns:
- the last added versions for each user who has added a version of the attachment
-
getAttachmentData
public InputStream getAttachmentData(Attachment attachment)
Description copied from interface:AttachmentManagerRetrieve the data for attachment- Specified by:
getAttachmentDatain interfaceAttachmentManager- Parameters:
attachment- the Attachment the data belongs to- Returns:
- InputStream representing the data
-
getAttachmentData
public InputStream getAttachmentData(Attachment attachment, Optional<RangeRequest> range)
Description copied from interface:AttachmentManagerRetrieve the specified range of data for attachment- Specified by:
getAttachmentDatain interfaceAttachmentManager- Parameters:
attachment- the Attachment the data belongs torange- the range of data to retrieve. Seecom.atlassian.filestore.client.api.entity.ByteRanges- Returns:
- InputStream representing the data
-
getLatestVersionsOfAttachments
public List<Attachment> getLatestVersionsOfAttachments(ContentEntityObject content)
Description copied from interface:AttachmentManagerReturns a list of only latest versions of attachments.- Specified by:
getLatestVersionsOfAttachmentsin interfaceAttachmentManager
-
getLatestVersionsOfAttachmentsForMultipleCeos
public List<Attachment> getLatestVersionsOfAttachmentsForMultipleCeos(Iterable<? extends ContentEntityObject> contentEntityObjects)
Description copied from interface:AttachmentManagerReturns a list of all the latest versions of attachments for all the CEOs provided- Specified by:
getLatestVersionsOfAttachmentsForMultipleCeosin interfaceAttachmentManager
-
getLatestVersionsOfAttachmentsWithAnyStatusForContainers
public List<Attachment> getLatestVersionsOfAttachmentsWithAnyStatusForContainers(Iterable<? extends ContentEntityObject> contentEntityObjects)
Description copied from interface:AttachmentManagerInternalReturns a list of all the latest versions of attachments for all the CEOs provided (including trashed)- Specified by:
getLatestVersionsOfAttachmentsWithAnyStatusForContainersin interfaceAttachmentManagerInternal
-
getLatestVersionsOfAttachmentsWithAnyStatus
public List<Attachment> getLatestVersionsOfAttachmentsWithAnyStatus(ContentEntityObject content)
Description copied from interface:AttachmentManagerReturns a list of only latest versions of attachments (including trashed).- Specified by:
getLatestVersionsOfAttachmentsWithAnyStatusin interfaceAttachmentManager
-
getAttachments
@Deprecated public PageResponse<Attachment> getAttachments(ContentEntityObject content, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Attachment> filterPredicate)
Deprecated.Description copied from interface:AttachmentManagerInternalReturns the current attachments under the CEO.- Specified by:
getAttachmentsin interfaceAttachmentManagerInternal- Parameters:
content- the content to return attachments forpageRequest- the pagination requestedfilterPredicate- the predicate for filtering found attachments- Returns:
- the paginated response of Page entities
-
countLatestVersionsOfAttachments
public int countLatestVersionsOfAttachments(ContentEntityObject content)
Description copied from interface:AttachmentManagerReturns a count of the number of latest versions of attachments- Specified by:
countLatestVersionsOfAttachmentsin interfaceAttachmentManager
-
countLatestVersionsOfAttachmentsWithAnyStatus
public int countLatestVersionsOfAttachmentsWithAnyStatus(ContentEntityObject content)
Description copied from interface:AttachmentManagerReturns a count of the number of latest versions of attachments (including trashed)- Specified by:
countLatestVersionsOfAttachmentsWithAnyStatusin interfaceAttachmentManager
-
countLatestVersionsOfAttachmentsOnPageSince
public int countLatestVersionsOfAttachmentsOnPageSince(ContentEntityObject content, Date since)
Description copied from interface:AttachmentManagerFetches number of attachments changed on a page since a specific timestamp- Specified by:
countLatestVersionsOfAttachmentsOnPageSincein interfaceAttachmentManager- Parameters:
content- the content objectsince- the date of earliest change- Returns:
- the number of attachments on a content object (including trashed) changed since
-
getAttachmentStatistics
public Optional<AttachmentStatisticsDTO> getAttachmentStatistics()
Description copied from interface:AttachmentManagerFetches statistics about attachments- Specified by:
getAttachmentStatisticsin interfaceAttachmentManager- Returns:
- an AttachmentStatisticsDTO object with statistics about attachments such as total and current count
-
deepAttachmentDelete
public void deepAttachmentDelete(AttachmentDeleteOptions attachmentDeleteOptions)
Description copied from interface:AttachmentManagerSupport delete multiple attachments in batch- Specified by:
deepAttachmentDeletein interfaceAttachmentManager
-
getAttachment
public Attachment getAttachment(long id)
- Specified by:
getAttachmentin interfaceAttachmentManager- Returns:
- attachment with id
-
getAttachments
public List<Attachment> getAttachments(List<Long> ids)
Description copied from interface:AttachmentManagerReturns a list of attachments matching the given list of IDs. Returns an empty list if no such attachments exist. In the case where some IDs exist and some don't, only the existing Attachments will be returned.- Specified by:
getAttachmentsin interfaceAttachmentManager- Parameters:
ids- list of IDs to retrieve.- Returns:
- attachments matching ids in the list
-
getAllVersionsOfAttachments
public List<Attachment> getAllVersionsOfAttachments(ContentEntityObject content)
Description copied from interface:AttachmentManagerReturns a list of all attachments, old and new.- Specified by:
getAllVersionsOfAttachmentsin interfaceAttachmentManager
-
getAllVersions
public List<Attachment> getAllVersions(Attachment attachment)
Description copied from interface:AttachmentManagerGet all versions of an attachment, starting with the current version- Specified by:
getAllVersionsin interfaceAttachmentManager
-
removeAttachments
public void removeAttachments(List<? extends Attachment> attachments)
Description copied from interface:AttachmentManagerRemoves the contents of attachments from the server- Specified by:
removeAttachmentsin interfaceAttachmentManager- Parameters:
attachments- a List of Attachments- See Also:
AttachmentManager.removeAttachmentFromServer(Attachment)
-
removeAttachmentFromServer
public void removeAttachmentFromServer(Attachment latestVersion)
Removes the attachment and all previous versions- Specified by:
removeAttachmentFromServerin interfaceAttachmentManager- Parameters:
latestVersion- latest version of the attachment to remove
-
removeAttachmentWithoutNotifications
public void removeAttachmentWithoutNotifications(Attachment latestVersion)
Description copied from interface:AttachmentManagerRemoves an Attachment and its data from the server while suppressing notifications. This is useful when you don't want to send notifications when removing the file.- Specified by:
removeAttachmentWithoutNotificationsin interfaceAttachmentManager
-
removeAttachmentVersionFromServer
public void removeAttachmentVersionFromServer(Attachment attachment)
Description copied from interface:AttachmentManagerRemoves the given version of the Attachment and its data from the server and data store.In case of the given attachment being the latest version, the previous version (if any) gets removed and the given object impersonates the previous version as the latest version.
- Specified by:
removeAttachmentVersionFromServerin interfaceAttachmentManager- Parameters:
attachment- the Attachment to remove
-
removeAttachmentVersionFromServerWithoutNotifications
public void removeAttachmentVersionFromServerWithoutNotifications(Attachment attachment)
Description copied from interface:AttachmentManagerRemoves the given version of the Attachment and its data from the server and data store while suppressing notifications. This is useful when you don't want to send notifications when removing the file.In case of the given attachment being the latest version, the previous version (if any) gets removed and the given object impersonates the previous version as the latest version.
- Specified by:
removeAttachmentVersionFromServerWithoutNotificationsin interfaceAttachmentManager- Parameters:
attachment- the Attachment to remove
-
moveAttachment
public void moveAttachment(Attachment latestVersion, String newFileName, ContentEntityObject newContent)
- Specified by:
moveAttachmentin interfaceAttachmentManager- Parameters:
latestVersion- The attachment to be movednewFileName- New name of the filenewContent- The new contentEntiityObject which will be parent to the attachment
-
moveAttachment
public void moveAttachment(Attachment attachment, ContentEntityObject newContainer)
Description copied from interface:AttachmentManagerInternalMoves an attachment to a differentContentEntityObjectcontainer.- Specified by:
moveAttachmentin interfaceAttachmentManagerInternal- Parameters:
attachment- The attachment to be movednewContainer- The new ContentEntiityObject which will be parent to the attachment
-
copyAttachments
public void copyAttachments(ContentEntityObject sourceContent, ContentEntityObject destinationContent, SaveContext saveContext) throws IOException
Description copied from interface:AttachmentManagerCopy the latest version of all the attachments on the sourceContent to the destinationContent.- Specified by:
copyAttachmentsin interfaceAttachmentManager- Parameters:
sourceContent- the content with attachments to be copied.destinationContent- the content to copy the attachments to.saveContext- details the circumstances under which the attachments are being copied.- Throws:
IOException- if there are problems reading or writing attachment data during the copy.
-
copyAttachments
public void copyAttachments(ContentEntityObject sourceContent, ContentEntityObject destinationContent) throws IOException
Description copied from interface:AttachmentManagerCopy the latest version of all the attachments on the sourceContent to the destinationContent.- Specified by:
copyAttachmentsin interfaceAttachmentManager- Parameters:
sourceContent- the content with attachments to be copied.destinationContent- the content to copy the attachments to.- Throws:
IOException- if there are problems reading or writing attachment data during the copy.
-
copyAttachment
public void copyAttachment(Attachment attachment, ContentEntityObject destinationContent) throws IOException
Description copied from interface:AttachmentManagerCopy specified attachment to specified destination content.- Specified by:
copyAttachmentin interfaceAttachmentManager- Parameters:
attachment- the attachmentdestinationContent- the destination- Throws:
IOException
-
setAttachmentData
public void setAttachmentData(Attachment attachment, InputStream attachmentData) throws AttachmentDataExistsException
Description copied from interface:AttachmentManagerSet the data belonging to attachmentThis method can be used when there is missing data for an Attachment (e.g. during imports) and the data needs to be set manually.
- Specified by:
setAttachmentDatain interfaceAttachmentManager- Parameters:
attachment- Attachment the data belongs toattachmentData- the data to be saved- Throws:
AttachmentDataExistsException- if data for attachment already exists
-
getMigrator
public AttachmentDao.AttachmentMigrator getMigrator(AttachmentManager destination)
Description copied from interface:AttachmentManagerRetrieves a AttachmentDao.AttachmentMigrator that will allow the attachments from one data store to be moved across to another.- Specified by:
getMigratorin interfaceAttachmentManager- Parameters:
destination- the AttachmentManager the data is being moved to- Returns:
- an AttachmentMigrator object
-
getCopier
public AttachmentDao.AttachmentCopier getCopier(AttachmentManager destination)
Description copied from interface:AttachmentManagerRetrieves a AttachmentDao.AttachmentCopier that will allow the attachments from one data store to be copied across to another.- Specified by:
getCopierin interfaceAttachmentManager- Parameters:
destination- the AttachmentManager the data is being copied to- Returns:
- an AttachmentCopier object
-
getAttachmentDao
public AttachmentDao getAttachmentDao()
Description copied from interface:AttachmentManagerRetrieves the AttachmentDao for the AttachmentManager- Specified by:
getAttachmentDaoin interfaceAttachmentManager- Returns:
- An AttachmentDao instance
-
setAttachmentDao
public void setAttachmentDao(AttachmentDaoInternal attachmentDao)
-
getBackingStorageType
public AttachmentDataStorageType getBackingStorageType()
Description copied from interface:AttachmentManagerReturns the currently active storage type.- Specified by:
getBackingStorageTypein interfaceAttachmentManager- See Also:
AttachmentDao.getBackingStorageType()
-
getAttachmentForDownloadPath
@Deprecated public com.atlassian.fugue.Maybe<Attachment> getAttachmentForDownloadPath(String downloadPath)
Deprecated.since 7.0.1. UseAttachmentManager.findAttachmentForDownloadPath(String)Description copied from interface:AttachmentManagerFind anAttachmentfor the givendownloadPath.The path must at least contain the segment produced by
Attachment.getDownloadPath(), that is /download/attachments/<contentId>/<fileName> where <contentId> identifies a validContentEntityObjectand <fileName> identifies a validAttachmentattached to thatContentEntityObject.- Specified by:
getAttachmentForDownloadPathin interfaceAttachmentManager- Parameters:
downloadPath- the download path identifying anAttachment.This value is expected to be url encoded, with spaces converted to %20 instead of a '+'- Returns:
- maybe the attachment if the given download path matches the criteria as described above and the referenced objects are known to the system
- See Also:
Attachment.getDownloadPath()
-
getRemappedAttachmentIds
public Map<Long,Long> getRemappedAttachmentIds()
Description copied from interface:AttachmentManagerGets a list of remapped attachment IDs. The key is the old ID and the value is the new ID.- Specified by:
getRemappedAttachmentIdsin interfaceAttachmentManager- Returns:
- A map where the key is the original ID and the value is the new ID.
-
trash
public void trash(Attachment attachment)
Description copied from interface:AttachmentManagerMoves an attachment to the trash.- Specified by:
trashin interfaceAttachmentManager- Parameters:
attachment- the attachment to be trashed
-
restore
public void restore(Attachment attachment)
Description copied from interface:AttachmentManagerRestores an attachment from trash.- Specified by:
restorein interfaceAttachmentManager- Parameters:
attachment- the attachment to restore
-
-