@Override protected Properties getPropertiesMap() { try { return pkg.getPackage().getMetaInf().getProperties(); } catch (RepositoryException|IOException e) { throw new IllegalStateException(e); } }
protected static ValidationResult checkForbiddenFilterRootPrefix(ValidationOptions options, VaultPackage pack) { List<String> forbiddenFilterRootPrefixes = options.getForbiddenFilterRootPrefixes(); if (forbiddenFilterRootPrefixes != null) { for (String rootPrefix : forbiddenFilterRootPrefixes) { String trimmed = rootPrefix.trim(); if (trimmed.isEmpty()) { continue; } final String noTrailingSlash = trimmed.replaceAll("/*$", "").replaceAll("^/*", "/"); final String withTrailingSlash = noTrailingSlash.replaceAll("/*$", "/"); for (PathFilterSet filterSet : pack.getMetaInf().getFilter().getFilterSets()) { if (filterSet.getRoot().equals(noTrailingSlash) || filterSet.getRoot().startsWith(withTrailingSlash)) { WspFilter.Root invalidRoot = WspFilter.adaptFilterSet(filterSet); return ValidationResult.forbiddenRootPrefix(rootPrefix, invalidRoot); } } } } return ValidationResult.success(); }
protected static ValidationResult checkDeniedPathInclusion(ValidationOptions options, VaultPackage pack) { List<String> pathsDeniedForInclusion = options.getPathsDeniedForInclusion(); if (pathsDeniedForInclusion != null) { for (String path : pathsDeniedForInclusion) { if (pack.getMetaInf().getFilter().contains(path)) { WspFilter.Root invalidRoot = null; PathFilterSet filter = pack.getMetaInf().getFilter().getCoveringFilterSet(path); if (filter != null) { invalidRoot = WspFilter.adaptFilterSet(filter); } return ValidationResult.deniedPathInclusion(path, invalidRoot); } } } return ValidationResult.success(); }
try { handler.beforeExtract(packageId, inspectSession, vaultPackage.getProperties(), vaultPackage.getMetaInf(), subpacks); } catch (final RepositoryException e) { getErrorListener().onListenerException(e, handler, packageId);
pack.getMetaInf().getFilter());