public class LaunchUtils
extends java.lang.Object
| Constructor and Description |
|---|
LaunchUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
buildLaunchResourcePath(java.lang.String path,
java.lang.String launchName)
Deprecated.
since 6.0.0
|
static java.lang.String |
getLaunchPath(java.lang.String path)
Deprecated.
since 6.0.0 - use
getLaunchResource(Resource) instead. |
static java.lang.String |
getLaunchPathFromName(java.lang.String launchName)
Deprecated.
since 6.0.0
|
static Resource |
getLaunchResource(Launch launch,
Resource resource)
Given a resource, which can be production or launch-based, returns the corresponding resource in
the specified (and possibly nested) launch.
|
static Resource |
getLaunchResource(Resource resource)
Returns the resource of the launch the provided resource belongs to
|
static java.lang.String |
getLaunchResourcePath(Launch launch,
Resource resource)
Constructs the path of a resource in the specified launch according to
getLaunchResource(Launch,Resource). |
static Resource |
getProductionResource(Resource resource)
Deprecated.
|
static java.lang.String |
getProductionResourcePath(java.lang.String path)
Deprecated.
since 6.0.0
|
static Resource |
getTargetResource(Resource resource,
Launch target)
Given a launch-based resource, this method returns the corresponding resource in the specified target launch.
|
static java.lang.String |
getTargetResourcePath(Resource resource,
Launch target)
Constructs the target path of a launch-based resource according to
getTargetResource(Resource, Launch). |
static boolean |
isApprovedLaunchResource(Resource resource)
returns true if the given launch resource is approved
|
static boolean |
isLaunchBasedPath(java.lang.String path)
Returns
true if the provided path is a launch-based path |
static boolean |
isLaunchResourcePath(java.lang.String path)
Returns
true if the provided path is a launch resource path |
public static Resource getLaunchResource(Resource resource)
resource - Resource to checkpublic static Resource getProductionResource(Resource resource)
getTargetResource(org.apache.sling.api.resource.Resource, com.adobe.cq.launches.api.Launch) insteadresource - A launch-based resourcepublic static Resource getTargetResource(Resource resource, Launch target) throws LaunchException
resource is part of. If
target is null, the production version of the resource is returned.resource - a launch-based resourcetarget - a parent launch or null to get the production versionLaunchException - if the specified target is not a parent launchpublic static java.lang.String getTargetResourcePath(Resource resource, Launch target) throws LaunchException
getTargetResource(Resource, Launch).
The returned path might not resolve (if the target resource does not exist).resource - a launch-based resourcetarget - a parent launch or null to get the production versionLaunchException - if the specified target is not a parent launchpublic static Resource getLaunchResource(Launch launch, Resource resource) throws LaunchException
launch - a (possibly nested) launchresource - a (source) resourceLaunchException - if the resource is launch-based and the specified launch is not a child launchpublic static java.lang.String getLaunchResourcePath(Launch launch, Resource resource) throws LaunchException
getLaunchResource(Launch,Resource).
The returned path might not resolve (if the resource does not exist in the launch).launch - a (possibly nested) launchresource - a (source) resourceLaunchException - if the resource is launch-based and the specified launch is not a child launch, or if the
specified launch has an invalid parent launch in the launch hierarchypublic static boolean isLaunchBasedPath(java.lang.String path)
true if the provided path is a launch-based pathpath - The path to checktrue if the provided path is a launch-based pathpublic static boolean isLaunchResourcePath(java.lang.String path)
true if the provided path is a launch resource pathpath - Path to checktrue if the provided path is a launch resource pathpublic static java.lang.String getLaunchPath(java.lang.String path)
getLaunchResource(Resource) instead.path - The launch-based pathnull if provided path does not belong to a launchpublic static java.lang.String getLaunchPathFromName(java.lang.String launchName)
launchName - The launch namepublic static java.lang.String getProductionResourcePath(java.lang.String path)
path - The launch-based resource pathpublic static java.lang.String buildLaunchResourcePath(java.lang.String path,
java.lang.String launchName)
path - The path to build the launch resource path fromlaunchName - Launch namenull if the provided path is already
a launch-based resource path from a different launch than the provided onepublic static boolean isApprovedLaunchResource(Resource resource)
resource - launch based resourceCopyright © 2010 - 2023 Adobe. All Rights Reserved