Interface RegistryUtil
-
public interface RegistryUtil
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RegistryUtil.PropertyMap
-
Field Summary
Fields Modifier and Type Field Description static List<String>
BOOL_TRUE
static Pattern
BROKEN_DATEFMT_PATTERN
Not for public use, onlyreadPackagePropertyDate(Calendar, String)
.static String
NO_GROUP
static String
NO_REGISTRY
static String
NO_VERSION
static Pattern
REGISTRY_CLASS_NS
-
Method Summary
Static Methods Modifier and Type Method Description static boolean
booleanProperty(org.apache.jackrabbit.vault.packaging.PackageProperties properties, String propertyKey, boolean defaultValue)
static String
date(Calendar calendar)
Formats a date in ISO8601 format without timezone.static org.apache.jackrabbit.vault.packaging.PackageId
fromPath(String path)
static String
getDownloadURI(String namespace, org.apache.jackrabbit.vault.packaging.PackageId id)
static String
getFilename(org.apache.jackrabbit.vault.packaging.PackageId id)
static boolean
isRegistryBasedPath(String path)
Returns true if this is a path going to a registry - that is /@{registryname}>/pathstatic String
namespace(String namespacedPathOrPath)
static String
namespace(org.apache.jackrabbit.vault.packaging.registry.PackageRegistry registry)
static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage>
open(BeanContext context, String path)
static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage>
open(BeanContext context, String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage>
open(PackageRegistries.Registries registries, String path)
static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage>
open(PackageRegistries.Registries registries, String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
static String
pathWithNamespace(String namespace, String path)
Adds the namespace to the path if it isn't already in there.static String
pathWithoutNamespace(String fullPath)
static Map<String,Object>
properties(org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage pckg)
static Calendar
readPackagePropertyDate(Calendar rawDate, String dateRep)
static void
toJson(com.google.gson.stream.JsonWriter writer, String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
static String
toPackagePath(String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
Path for the package, without the version.static String
toPath(String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
static String
toPath(org.apache.jackrabbit.vault.packaging.registry.PackageRegistry registry, org.apache.jackrabbit.vault.packaging.PackageId packageId)
-
-
-
Field Detail
-
NO_REGISTRY
static final String NO_REGISTRY
- See Also:
- Constant Field Values
-
NO_GROUP
static final String NO_GROUP
- See Also:
- Constant Field Values
-
NO_VERSION
static final String NO_VERSION
- See Also:
- Constant Field Values
-
REGISTRY_CLASS_NS
static final Pattern REGISTRY_CLASS_NS
-
BROKEN_DATEFMT_PATTERN
static final Pattern BROKEN_DATEFMT_PATTERN
Not for public use, onlyreadPackagePropertyDate(Calendar, String)
. Parses a weird format com.day.jcr.vault:content-package-maven-plugin produces but that cannot be parsed byISO8601.parse(String)
, for example 2021-05-26T15:12:21.673+0200 instead of 2021-05-26T15:12:21.673+02:00 , see#format(Calendar, String)
.
-
-
Method Detail
-
namespace
@Nonnull static String namespace(@Nonnull org.apache.jackrabbit.vault.packaging.registry.PackageRegistry registry)
-
isRegistryBasedPath
static boolean isRegistryBasedPath(String path)
Returns true if this is a path going to a registry - that is /@{registryname}>/path
-
pathWithNamespace
@Nullable static String pathWithNamespace(@Nullable String namespace, @Nullable String path)
Adds the namespace to the path if it isn't already in there.
-
fromPath
@Nonnull static org.apache.jackrabbit.vault.packaging.PackageId fromPath(@Nonnull String path)
-
toPath
@Nonnull static String toPath(@Nullable org.apache.jackrabbit.vault.packaging.registry.PackageRegistry registry, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId packageId)
-
toPath
@Nonnull static String toPath(@Nullable String namespace, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId packageId)
-
toPackagePath
@Nonnull static String toPackagePath(@Nullable String namespace, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId packageId)
Path for the package, without the version.
-
open
@Nullable static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage> open(@Nonnull BeanContext context, @Nullable String namespace, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId packageId) throws IOException
- Throws:
IOException
-
open
@Nullable static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage> open(@Nonnull BeanContext context, @Nonnull String path) throws IOException
- Throws:
IOException
-
open
@Nullable static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage> open(@Nonnull PackageRegistries.Registries registries, @Nonnull String path) throws IOException
- Throws:
IOException
-
open
@Nullable static org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage> open(@Nonnull PackageRegistries.Registries registries, @Nullable String namespace, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId packageId) throws IOException
- Throws:
IOException
-
requestPath
@Nonnull static String requestPath(@Nonnull org.apache.sling.api.SlingHttpServletRequest request)
-
getFilename
@Nonnull static String getFilename(@Nonnull org.apache.jackrabbit.vault.packaging.PackageId id)
-
getDownloadURI
@Nonnull static String getDownloadURI(@Nullable String namespace, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId id)
-
booleanProperty
static boolean booleanProperty(@Nonnull org.apache.jackrabbit.vault.packaging.PackageProperties properties, @Nonnull String propertyKey, boolean defaultValue)
-
date
@Nullable static String date(@Nullable Calendar calendar)
Formats a date in ISO8601 format without timezone.
-
toJson
static void toJson(com.google.gson.stream.JsonWriter writer, String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId) throws IOException
- Throws:
IOException
-
readPackagePropertyDate
static Calendar readPackagePropertyDate(Calendar rawDate, String dateRep)
Workaround for-
properties
@Nonnull static Map<String,Object> properties(@Nonnull org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage pckg) throws IOException
- Throws:
IOException
-
-
-