public class XhtmlLinksUpdater extends Object implements LinksUpdater
LinksUpdater.AttachmentReferenceDetails, LinksUpdater.PartialReferenceDetails
Constructor and Description |
---|
XhtmlLinksUpdater(XmlEventReaderFactory xmlEventReaderFactory,
XMLOutputFactory xmlOutputFactory,
XMLEventFactory xmlEventFactory,
Marshaller<ResourceIdentifier> resourceIdentifierMarshaller,
ResourceIdentifierFactory resourceIdentifierFactory) |
Modifier and Type | Method and Description |
---|---|
String |
contractAbsoluteReferencesInContent(SpaceContentEntityObject content)
A companion method to {
LinksUpdater.expandRelativeReferencesInContent(SpaceContentEntityObject) that will convert any absolute
references to itself to be relative. |
String |
expandRelativeReferencesInContent(Comment comment)
Expand any relative links or embedded files/images encountered in the supplied comment.
|
String |
expandRelativeReferencesInContent(SpaceContentEntityObject content)
Expand any relative links or embedded images encountered in the supplied content.
|
String |
updateAttachmentReferencesInContent(String content,
LinksUpdater.AttachmentReferenceDetails old,
LinksUpdater.AttachmentReferenceDetails updated)
Update all the attachment references in the content that referred to the 'old' attachment to now refer to the 'updated' attachment.
|
String |
updateReferencesInContent(String content,
LinksUpdater.PartialReferenceDetails oldLinkDetails,
LinksUpdater.PartialReferenceDetails newLinkDetails)
Update all the links and embedded image references in the content that referred to 'oldDetails' to now refer to 'newDetails'.
|
public XhtmlLinksUpdater(XmlEventReaderFactory xmlEventReaderFactory, XMLOutputFactory xmlOutputFactory, XMLEventFactory xmlEventFactory, Marshaller<ResourceIdentifier> resourceIdentifierMarshaller, ResourceIdentifierFactory resourceIdentifierFactory)
public String updateReferencesInContent(String content, LinksUpdater.PartialReferenceDetails oldLinkDetails, LinksUpdater.PartialReferenceDetails newLinkDetails)
LinksUpdater
LinksUpdater.expandRelativeReferencesInContent(SpaceContentEntityObject)
prior to calling this method to ensure there are no relative links in the content to confuse matters.updateReferencesInContent
in interface LinksUpdater
content
- the content to update references inoldLinkDetails
- specifies the references to be modifiednewLinkDetails
- specifies the reference to be used in place of those identified by 'oldDetails'.public String expandRelativeReferencesInContent(SpaceContentEntityObject content)
LinksUpdater
expandRelativeReferencesInContent
in interface LinksUpdater
content
- the content to be expandedpublic String expandRelativeReferencesInContent(Comment comment)
LinksUpdater
expandRelativeReferencesInContent
in interface LinksUpdater
comment
- the comment to be expandedpublic String updateAttachmentReferencesInContent(String content, LinksUpdater.AttachmentReferenceDetails old, LinksUpdater.AttachmentReferenceDetails updated)
LinksUpdater
LinksUpdater.expandRelativeReferencesInContent(SpaceContentEntityObject)
prior to calling this
method to ensure there are no relative attachment references in the content to confuse matters.updateAttachmentReferencesInContent
in interface LinksUpdater
content
- the content to update attachment references inold
- specifies the attachment references to be modifiedupdated
- specifies the new attachment reference to replace the old one withpublic String contractAbsoluteReferencesInContent(SpaceContentEntityObject content)
LinksUpdater
LinksUpdater.expandRelativeReferencesInContent(SpaceContentEntityObject)
that will convert any absolute
references to itself to be relative. So in a ResourceIdentifier, if a space key is present for the same space as the supplied
content then this will be dropped. If the ResourceIdentifier actually refers to the SpaceContentEntityObject supplied then it
will be dropped altogether.contractAbsoluteReferencesInContent
in interface LinksUpdater
content
- the content to have any suitable absolute references contracted.Copyright © 2003–2015 Atlassian. All rights reserved.