Class ExportUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ExportUtilsstatic final Stringstatic final Stringbuild number of the earliest confluence version that this export can be imported bystatic final Stringbuild number of the version of confluence that was used to generate exportstatic final StringDefault users group for this instance, used to remap group permissions on import.static final Stringstatic final StringIndicates a specific space key which has been exported.static final StringIndicates a collections of space keys which have been exported.static final StringPlugin version used to export (Mostly for ActiveObjects data)static final StringEarliest plugin version compatible with exportstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringUtility method to return a version of the content entity's title that's suitable to be used as a filename in an export.static StringgetTitleAsFilename(SearchResult searchResult) Utility method to return a version of the search result's title that's suitable to be used as a filename in an export.static StringgetTitleAsFilename(String title) Deprecated.since 5.1.4.static StringFor a URL encoded filename to be used in a link it will need to be double encoded (since the browser will decode the single encoding when resolving the link, and we have files with encoded names on the filesystem).static StringgetTitleAsHref(SearchResult searchResult) For a URL encoded filename to be used in a link it will need to be double encoded (since the browser will decode the single encoding when resolving the link, and we have files with encoded names on the filesystem).
-
Field Details
-
INSTANCE
-
FILENAME_EXTENSION
- See Also:
-
PROP_BUILD_NUMBER
build number of the earliest confluence version that this export can be imported by- See Also:
-
PROP_EXPORT_TYPE
- See Also:
-
PROP_BACKUP_ATTACHMENTS
- See Also:
-
PROP_SUPPORT_ENTITLEMENT_NUMBER
- See Also:
-
PROP_EXPORTED_SPACEKEY
Indicates a specific space key which has been exported. Used for single-space backups only- See Also:
-
PROP_EXPORTED_SPACEKEYS
Indicates a collections of space keys which have been exported. Used for both single and multiple-space backups.- See Also:
-
PROP_CREATED_BY_BUILD_NUMBER
build number of the version of confluence that was used to generate export- See Also:
-
PROP_DEFAULT_USERS_GROUP
Default users group for this instance, used to remap group permissions on import. See {#link com.atlassian.studio.confluence.importexport.PermissionsImportPreProcessor}- See Also:
-
PROP_PLUGIN_CREATED_BY_VERSION
Plugin version used to export (Mostly for ActiveObjects data)- See Also:
-
PROP_PLUGIN_EARLIEST_VERSION
Earliest plugin version compatible with export- See Also:
-
PROP_PLUGINS_EXPORTING_DATA
- See Also:
-
-
Constructor Details
-
ExportUtils
public ExportUtils()
-
-
Method Details
-
getTitleAsFilename
Utility method to return a version of the content entity's title that's suitable to be used as a filename in an export. Falls back to using the content entity's ID if the title contains unsuitable characters.
This method is used to centralise the code since symmetry is required in the creation of the files during export and the creation of the links to these files in the exported content.
- Parameters:
ceo- the ContentEntityObject to retrieve a suitable filename for.- Returns:
- a suitable filename for the object.
-
getTitleAsFilename
Utility method to return a version of the search result's title that's suitable to be used as a filename in an export. Falls back to using the ID of the entity if the title contains unsuitable characters.
This method is used to centralise the code since symmetry is required in the creation of the files during export and the creation of the links to these files in the exported content.
- Parameters:
searchResult- the SearchResult to retrieve a suitable filename for.- Returns:
- a suitable filename for the object.
-
getTitleAsFilename
Deprecated.since 5.1.4. UsegetTitleAsFilename(ContentEntityObject)instead (see CONF-27260) -
getTitleAsHref
For a URL encoded filename to be used in a link it will need to be double encoded (since the browser will decode the single encoding when resolving the link, and we have files with encoded names on the filesystem).
This utility method calls
getTitleAsFilename(ContentEntityObject)to determine the name of the object on the filesystem. It will then perform a URL encode of the filename, making it suitable for use in links.This is centralised here since links are created both in Velocity (for the index page) and for individual pages as they are exported.
- Parameters:
ceo- the ContentEntityObject to be made suitable for use in an href.- Returns:
- the URL-safe version of the filename for the object.
-
getTitleAsHref
For a URL encoded filename to be used in a link it will need to be double encoded (since the browser will decode the single encoding when resolving the link, and we have files with encoded names on the filesystem).
This utility method calls
getTitleAsFilename(SearchResult)to determine the name of the object on the filesystem. It will then perform a URL encode of the filename, making it suitable for use in links.This is centralised here since links are created both in Velocity (for the index page) and for individual pages as they are exported.
- Parameters:
searchResult- the SearchResult to be made suitable for use in an href.- Returns:
- the URL-safe version of the filename for the object.
-