in src/main/java/org/apache/sling/jcr/contentloader/PathEntry.java [246:359]
public PathEntry(ManifestHeader.Entry entry, long bundleLastModified, @Nullable String bundleSymbolicName) {
this.path = entry.getValue();
this.lastModified = bundleLastModified;
final String logPrefix;
if (bundleSymbolicName != null && !bundleSymbolicName.isEmpty()) {
logPrefix = "Bundle '" + bundleSymbolicName + "': ";
} else {
logPrefix = "";
}
// check for attributes
if (entry.getAttributes().length > 0 && log.isWarnEnabled()) {
log.warn("{}Attributes are not supported in header {} but this header used attributes '{}'. Maybe a directive (with key/value separator ':=') was meant instead?", logPrefix, CONTENT_HEADER,
Arrays.stream(entry.getAttributes()).map(attr -> attr.getName() + "=" + attr.getValue()).collect(Collectors.joining(", ")));
}
// check for invalid directives
for (NameValuePair directive : entry.getDirectives()) {
if (!VALID_DIRECTIVES.contains(directive.getName())) {
log.warn("{}Directive '{}' not supported in header {} but it is used with value '{}'", logPrefix, directive.getName(), CONTENT_HEADER, directive.getValue());
}
}
// merge directive
final String mergeProperties = entry.getDirectiveValue(MERGE_PROPERTIES_DIRECTIVE);
if (mergeProperties != null) {
this.propertyMerge = Boolean.valueOf(mergeProperties);
} else {
this.propertyMerge = false;
}
// merge directive
final String mergeNodes = entry.getDirectiveValue(MERGE_NODES_DIRECTIVE);
if (mergeNodes != null) {
this.nodeMerge = Boolean.valueOf(mergeProperties);
} else {
this.nodeMerge = false;
}
// overwrite directive
final String overwriteValue = entry.getDirectiveValue(OVERWRITE_DIRECTIVE);
if (overwriteValue != null) {
this.overwrite = Boolean.valueOf(overwriteValue);
} else {
this.overwrite = false;
}
// overwriteProperties directive
final String overwritePropertiesValue = entry.getDirectiveValue(OVERWRITE_PROPERTIES_DIRECTIVE);
if (overwritePropertiesValue != null) {
this.overwriteProperties = Boolean.valueOf(overwritePropertiesValue);
} else {
this.overwriteProperties = false;
}
// uninstall directive
final String uninstallValue = entry.getDirectiveValue(UNINSTALL_DIRECTIVE);
if (uninstallValue != null) {
this.uninstall = Boolean.valueOf(uninstallValue);
} else {
this.uninstall = this.overwrite;
}
// path directive
final String pathValue = entry.getDirectiveValue(PATH_DIRECTIVE);
if (pathValue != null) {
this.target = pathValue;
} else {
this.target = null;
}
// checkin directive
final String checkinValue = entry.getDirectiveValue(CHECKIN_DIRECTIVE);
if (checkinValue != null) {
this.checkin = Boolean.valueOf(checkinValue);
} else {
this.checkin = false;
}
// autoCheckout directive
final String autoCheckoutValue = entry.getDirectiveValue(AUTOCHECKOUT_DIRECTIVE);
if (autoCheckoutValue != null) {
this.autoCheckout = Boolean.valueOf(autoCheckoutValue);
} else {
this.autoCheckout = true;
}
// expand directive
this.ignoreContentReaders = new ArrayList<>();
final String expandValue = entry.getDirectiveValue(IGNORE_CONTENT_READERS_DIRECTIVE);
if ( expandValue != null && expandValue.length() > 0 ) {
final StringTokenizer st = new StringTokenizer(expandValue, ",");
while ( st.hasMoreTokens() ) {
this.ignoreContentReaders.add(st.nextToken());
}
}
// expand directive
this.requireContentReaders = new ArrayList<>();
final String requireContentReadersValue = entry.getDirectiveValue(REQUIRE_CONTENT_READERS_DIRECTIVE);
if ( requireContentReadersValue != null && requireContentReadersValue.length() > 0 ) {
final StringTokenizer st = new StringTokenizer(requireContentReadersValue, ",");
while ( st.hasMoreTokens() ) {
this.requireContentReaders.add(st.nextToken());
}
}
// workspace directive
final String workspaceValue = entry.getDirectiveValue(WORKSPACE_DIRECTIVE);
if (pathValue != null) {
this.workspace = workspaceValue;
} else {
this.workspace = null;
}
}