Package org.glassfish.deployment.common
Class DeploymentUtils
java.lang.Object
org.glassfish.deployment.common.DeploymentUtils
Utility methods for deployment.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longComputes the checksum of the URIs of files contained in a directory.static ArtifactsdownloadableArtifacts(com.sun.enterprise.config.serverbeans.Application app) Returns the downloadable artifacts object derived from the properties saved with the specified Applicationstatic ArtifactsdownloadableArtifacts(org.glassfish.api.deployment.DeploymentContext deploymentContext) Returns the downloadable artifacts object from the specified deployment context, creating it there if it does not already exist.static voidexpand(org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.archive.WritableArchive target) Expand an archive to a directorystatic ArtifactsgeneratedArtifacts(com.sun.enterprise.config.serverbeans.Application app) Returns the generated artifacts object derived from the properties saved with the specified Applicationstatic ArtifactsgeneratedArtifacts(org.glassfish.api.deployment.DeploymentContext deploymentContext) Returns the generated artifacts object from the specified deployment context, creating it there if it does not already exist.static StringgetDefaultEEName(String pathName) static StringgetEmbeddedModulePath(String appRootPath, String moduleUri) This method returns the file path of an embedded module.getExternalLibraries(org.glassfish.api.deployment.archive.ReadableArchive archive) static StringgetInternalNameForTenant(String appname, String tenantname) getManifestLibraries(org.glassfish.api.deployment.archive.ReadableArchive archive) getManifestLibraries(org.glassfish.api.deployment.DeploymentContext context) getManifestLibraries(org.glassfish.api.deployment.DeploymentContext context, Manifest manifest) static StringgetRelativeEmbeddedModulePath(String appRootPath, String moduleUri) This method returns the relative file path of an embedded module to the application root.static StringgetVirtualServers(String target, org.glassfish.api.admin.ServerEnvironment env, com.sun.enterprise.config.serverbeans.Domain domain) static booleanisArchiveOfType(org.glassfish.api.deployment.archive.ReadableArchive archive, org.glassfish.api.deployment.archive.ArchiveType archiveType, org.glassfish.api.deployment.DeploymentContext context, org.glassfish.hk2.api.ServiceLocator locator) static booleanisArchiveOfType(org.glassfish.api.deployment.archive.ReadableArchive archive, org.glassfish.api.deployment.archive.ArchiveType archiveType, org.glassfish.hk2.api.ServiceLocator locator) static booleanisDASTarget(String targetName) static booleanisDomainTarget(String targetName) static FileArchiveopenAsFileArchive(File dir, ArchiveFactory archiveFactory) Opens the specified file as an archive, using the provided archive factory.static StringpropertiesValue(Properties props, char sep) static StringrelativizeWithinDomainIfPossible(URI absURI) static booleanuseV2Compatibility(org.glassfish.api.deployment.DeploymentContext context) static void
-
Field Details
-
DEPLOYMENT_PROPERTY_JAVA_WEB_START_ENABLED
- See Also:
-
DAS_TARGET_NAME
- See Also:
-
DOMAIN_TARGET_NAME
- See Also:
-
-
Constructor Details
-
DeploymentUtils
public DeploymentUtils()
-
-
Method Details
-
isDASTarget
-
isDomainTarget
-
checksum
Computes the checksum of the URIs of files contained in a directory.- Parameters:
directory- the directory for which to compute a checksum- Returns:
- checksum calculated from URIs of files in the directory
-
downloadableArtifacts
public static Artifacts downloadableArtifacts(org.glassfish.api.deployment.DeploymentContext deploymentContext) Returns the downloadable artifacts object from the specified deployment context, creating it there if it does not already exist.- Parameters:
deploymentContext- the deployment context from which to fetch the downloadable Artifacts object- Returns:
-
downloadableArtifacts
public static Artifacts downloadableArtifacts(com.sun.enterprise.config.serverbeans.Application app) Returns the downloadable artifacts object derived from the properties saved with the specified Application- Parameters:
app- the Application config object with (possibly) properties describing downloadable artifacts- Returns:
-
generatedArtifacts
public static Artifacts generatedArtifacts(org.glassfish.api.deployment.DeploymentContext deploymentContext) Returns the generated artifacts object from the specified deployment context, creating it there if it does not already exist.- Parameters:
app-- Returns:
-
generatedArtifacts
Returns the generated artifacts object derived from the properties saved with the specified Application- Parameters:
app- the Application config object with (possibly) properties describing generated artifacts- Returns:
-
isArchiveOfType
public static boolean isArchiveOfType(org.glassfish.api.deployment.archive.ReadableArchive archive, org.glassfish.api.deployment.archive.ArchiveType archiveType, org.glassfish.api.deployment.DeploymentContext context, org.glassfish.hk2.api.ServiceLocator locator) -
isArchiveOfType
public static boolean isArchiveOfType(org.glassfish.api.deployment.archive.ReadableArchive archive, org.glassfish.api.deployment.archive.ArchiveType archiveType, org.glassfish.hk2.api.ServiceLocator locator) -
getDefaultEEName
- Parameters:
pathName-- Returns:
- the default value of the EE name. The default name is the pathname with any filename extension (.jar, .war, .rar) removed, but with any directory names included.
-
getRelativeEmbeddedModulePath
This method returns the relative file path of an embedded module to the application root. For example, if the module is expanded/located at $domain_dir/applications/ee-apps/foo/fooEJB_jar, this method will return fooEJB_jar- Parameters:
appRootPath- The path of the application root which contains the module e.g. $domain_dir/applications/ee-apps/foomoduleUri- The module uri e.g. fooEJB.jar- Returns:
- The relative file path of the module to the application root
-
getEmbeddedModulePath
This method returns the file path of an embedded module. For example, if the module is expanded/located at $domain_dir/applications/ee-apps/foo/fooEJB_jar, this method will return $domain_dir/applications/ee-apps/foo/fooEJB_jar- Parameters:
appRootPath- The path of the application root which contains the module e.g. $domain_dir/applications/ee-apps/foomoduleUri- The module uri e.g. fooEJB.jar- Returns:
- The file path of the module
-
useV2Compatibility
public static boolean useV2Compatibility(org.glassfish.api.deployment.DeploymentContext context) -
relativizeWithinDomainIfPossible
- Throws:
URISyntaxException
-
validateApplicationName
-
expand
public static void expand(org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.archive.WritableArchive target) throws IOException Expand an archive to a directory- Parameters:
source- of the expandingtarget- of the expanding- Throws:
IOException- when the archive is corrupted
-
getInternalNameForTenant
-
propertiesValue
-
getManifestLibraries
public static List<URL> getManifestLibraries(org.glassfish.api.deployment.DeploymentContext context) throws IOException - Throws:
IOException
-
getManifestLibraries
public static List<URL> getManifestLibraries(org.glassfish.api.deployment.DeploymentContext context, Manifest manifest) throws IOException - Throws:
IOException
-
getManifestLibraries
public static List<URL> getManifestLibraries(org.glassfish.api.deployment.archive.ReadableArchive archive) throws IOException - Throws:
IOException
-
getExternalLibraries
-
getVirtualServers
-