Class PathEntry
- java.lang.Object
-
- org.apache.sling.jcr.contentloader.ImportOptions
-
- org.apache.sling.jcr.contentloader.PathEntry
-
public class PathEntry extends ImportOptions
A path entry from the manifest for initial content.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTOCHECKOUT_DIRECTIVEThe autoCheckout directive specifying whether versionable nodes should be checked out when necessarystatic java.lang.StringCHECKIN_DIRECTIVEThe checkin directive specifying whether versionable nodes should be checked instatic java.lang.StringCONTENT_HEADERThe manifest header to specify initial content to be loaded.static java.lang.StringIGNORE_CONTENT_READERS_DIRECTIVEThe ignore content readers directive specifying whether the availableContentReaders should be used during content loading.static java.lang.StringMERGE_NODES_DIRECTIVEThe overwriteProperties directive specifying if content properties should be overwritten or just initially added.static java.lang.StringMERGE_PROPERTIES_DIRECTIVEThe overwriteProperties directive specifying if content properties should be overwritten or just initially added.static java.lang.StringOVERWRITE_DIRECTIVEThe overwrite directive specifying if content should be overwritten or just initially added.static java.lang.StringOVERWRITE_PROPERTIES_DIRECTIVEThe overwriteProperties directive specifying if content properties should be overwritten or just initially added.static java.lang.StringPATH_DIRECTIVEThe path directive specifying the target node where initial content will be loaded.static java.lang.StringUNINSTALL_DIRECTIVEThe uninstall directive specifying if content should be uninstalled.java.util.Set<java.lang.String>VALID_DIRECTIVESAll directive names which are valid for header Sling-Initial-Contentstatic java.lang.StringWORKSPACE_DIRECTIVEThe workspace into which the content will be loaded.
-
Constructor Summary
Constructors Constructor Description PathEntry(ManifestHeader.Entry entry, long bundleLastModified)PathEntry(ManifestHeader.Entry entry, long bundleLastModified, @Nullable java.lang.String bundleSymbolicName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @Nullable java.util.Iterator<PathEntry>getContentPaths(@NotNull java.util.jar.Manifest manifest, long bundleLastModified)Parses the "Sling-Initial-Content" header from the given manifest and returns the resolved PathEntriesstatic @Nullable java.util.Iterator<PathEntry>getContentPaths(java.util.Map<java.lang.String,java.lang.String> headers, long bundleLastModified)Parses the "Sling-Initial-Content" header from the given headers and returns the resolved PathEntriesstatic @Nullable java.util.Iterator<PathEntry>getContentPaths(Bundle bundle)Parses the "Sling-Initial-Content" header from the given bundle and returns the resolved PathEntriesjava.util.Set<java.lang.String>getIgnoredContentReaders()longgetLastModified()java.lang.StringgetPath()java.lang.StringgetTarget()java.lang.StringgetWorkspace()booleanisAutoCheckout()Specifies whether versionable nodes is automatically checked out when necessary.booleanisCheckin()Specifies whether versionable nodes is automatically checked in at the end of the import operation.booleanisIgnoredImportProvider(java.lang.String extension)Check if the content reader for the given file extension should be ignored.booleanisMerge()Specifies whether imported nodes should merge with existing nodes.booleanisOverwrite()Specifies whether imported nodes should overwrite existing nodes.booleanisPropertyMerge()Specifies whether imported properties should merge with existing properties.booleanisPropertyOverwrite()Specifies whether imported properties should overwrite existing properties.booleanisUninstall()
-
-
-
Field Detail
-
CONTENT_HEADER
public static final java.lang.String CONTENT_HEADER
The manifest header to specify initial content to be loaded.- See Also:
- Constant Field Values
-
OVERWRITE_DIRECTIVE
public static final java.lang.String OVERWRITE_DIRECTIVE
The overwrite directive specifying if content should be overwritten or just initially added.- See Also:
- Constant Field Values
-
OVERWRITE_PROPERTIES_DIRECTIVE
public static final java.lang.String OVERWRITE_PROPERTIES_DIRECTIVE
The overwriteProperties directive specifying if content properties should be overwritten or just initially added.- See Also:
- Constant Field Values
-
MERGE_PROPERTIES_DIRECTIVE
public static final java.lang.String MERGE_PROPERTIES_DIRECTIVE
The overwriteProperties directive specifying if content properties should be overwritten or just initially added.- See Also:
- Constant Field Values
-
MERGE_NODES_DIRECTIVE
public static final java.lang.String MERGE_NODES_DIRECTIVE
The overwriteProperties directive specifying if content properties should be overwritten or just initially added.- See Also:
- Constant Field Values
-
UNINSTALL_DIRECTIVE
public static final java.lang.String UNINSTALL_DIRECTIVE
The uninstall directive specifying if content should be uninstalled.- See Also:
- Constant Field Values
-
PATH_DIRECTIVE
public static final java.lang.String PATH_DIRECTIVE
The path directive specifying the target node where initial content will be loaded.- See Also:
- Constant Field Values
-
WORKSPACE_DIRECTIVE
public static final java.lang.String WORKSPACE_DIRECTIVE
The workspace into which the content will be loaded.- See Also:
- Constant Field Values
-
CHECKIN_DIRECTIVE
public static final java.lang.String CHECKIN_DIRECTIVE
The checkin directive specifying whether versionable nodes should be checked in- See Also:
- Constant Field Values
-
AUTOCHECKOUT_DIRECTIVE
public static final java.lang.String AUTOCHECKOUT_DIRECTIVE
The autoCheckout directive specifying whether versionable nodes should be checked out when necessary- See Also:
- Constant Field Values
-
IGNORE_CONTENT_READERS_DIRECTIVE
public static final java.lang.String IGNORE_CONTENT_READERS_DIRECTIVE
The ignore content readers directive specifying whether the availableContentReaders should be used during content loading. This is a string value that defaults to the emptystring.- Since:
- 2.0.4
- See Also:
- Constant Field Values
-
VALID_DIRECTIVES
public java.util.Set<java.lang.String> VALID_DIRECTIVES
All directive names which are valid for header Sling-Initial-Content
-
-
Constructor Detail
-
PathEntry
public PathEntry(ManifestHeader.Entry entry, long bundleLastModified)
-
PathEntry
public PathEntry(ManifestHeader.Entry entry, long bundleLastModified, @Nullable @Nullable java.lang.String bundleSymbolicName)
-
-
Method Detail
-
getContentPaths
@Nullable public static @Nullable java.util.Iterator<PathEntry> getContentPaths(@NotNull @NotNull java.util.jar.Manifest manifest, long bundleLastModified)
Parses the "Sling-Initial-Content" header from the given manifest and returns the resolved PathEntries- Parameters:
manifest- the manifestbundleLastModified- the timestamp when the bundle has been last modified or -1 if not known- Returns:
- an iterator over the parsed
PathEntryitems ornullin case no "Sling-Initial-Content" header was found in the manifest
-
getContentPaths
@Nullable public static @Nullable java.util.Iterator<PathEntry> getContentPaths(Bundle bundle)
Parses the "Sling-Initial-Content" header from the given bundle and returns the resolved PathEntries- Parameters:
bundle- the bundle- Returns:
- an iterator over the parsed
PathEntryitems ornullin case no "Sling-Initial-Content" header was found in the bundle's manifest
-
getContentPaths
@Nullable public static @Nullable java.util.Iterator<PathEntry> getContentPaths(java.util.Map<java.lang.String,java.lang.String> headers, long bundleLastModified)
Parses the "Sling-Initial-Content" header from the given headers and returns the resolved PathEntries- Parameters:
headers- the manifest headersbundleLastModified- the timestamp when the bundle has been last modified or -1 if not known- Returns:
- an iterator over the parsed
PathEntryitems ornullin case no "Sling-Initial-Content" header was found
-
getLastModified
public long getLastModified()
-
getPath
public java.lang.String getPath()
-
isOverwrite
public boolean isOverwrite()
Description copied from class:ImportOptionsSpecifies whether imported nodes should overwrite existing nodes. NOTE: this means the existing node will be deleted and a new node will be created in the same location.- Specified by:
isOverwritein classImportOptions- Returns:
- true to overwrite nodes, false otherwise
-
isPropertyOverwrite
public boolean isPropertyOverwrite()
Description copied from class:ImportOptionsSpecifies whether imported properties should overwrite existing properties.- Specified by:
isPropertyOverwritein classImportOptions- Returns:
- true to overwrite node properties, false otherwise
-
isUninstall
public boolean isUninstall()
-
isCheckin
public boolean isCheckin()
Description copied from class:ImportOptionsSpecifies whether versionable nodes is automatically checked in at the end of the import operation.- Specified by:
isCheckinin classImportOptions- Returns:
- true to checkin the versionable nodes, false otherwise
-
isAutoCheckout
public boolean isAutoCheckout()
Description copied from class:ImportOptionsSpecifies whether versionable nodes is automatically checked out when necessary.- Overrides:
isAutoCheckoutin classImportOptions- Returns:
- true to checkout the versionable nodes, false otherwise
-
isIgnoredImportProvider
public boolean isIgnoredImportProvider(java.lang.String extension)
Description copied from class:ImportOptionsCheck if the content reader for the given file extension should be ignored.- Specified by:
isIgnoredImportProviderin classImportOptions- Parameters:
extension- the extension to check- Returns:
- true to ignore the reader, false otherwise
-
getIgnoredContentReaders
public java.util.Set<java.lang.String> getIgnoredContentReaders()
-
getTarget
public java.lang.String getTarget()
-
getWorkspace
public java.lang.String getWorkspace()
-
isPropertyMerge
public boolean isPropertyMerge()
Description copied from class:ImportOptionsSpecifies whether imported properties should merge with existing properties. NOTE: this means that properties that are not imported will be removed- Overrides:
isPropertyMergein classImportOptions- Returns:
- true to overwrite nodes, false otherwise
-
isMerge
public boolean isMerge()
Description copied from class:ImportOptionsSpecifies whether imported nodes should merge with existing nodes. NOTE: this means the existing nodes that are not imported will be deleted.- Overrides:
isMergein classImportOptions- Returns:
- true to overwrite nodes, false otherwise
-
-