Class Archive


  • public class Archive
    extends Object
    Defines an archive with all its properties
    Version:
    $Id$
    Author:
    Nicolas Filotto
    • Field Detail

      • PROTOCOL

        public static final String PROTOCOL
        The protocol used to define an URL that defines a resource into an archive
        See Also:
        Constant Field Values
      • WAR

        public static final Archive WAR
        The most common description of a Web Application ARchive
      • EAR

        public static final Archive EAR
        The most common description of a Enterprise Application ARchive
    • Constructor Detail

      • Archive

        public Archive​(String type,
                       boolean useDirWoExt,
                       boolean allowsDir,
                       Set<Archive> subArchives)
        The default constructor
    • Method Detail

      • getType

        public String getType()
        Returns:
        the type of the archive
      • isUseDirWoExt

        public boolean isUseDirWoExt()
        Indicates whether the archive is replaceable with a directory without extension
      • isAllowsDir

        public boolean isAllowsDir()
        Indicates whether the archive can be a directory
      • getSubArchives

        public Set<Archive> getSubArchives()
        Returns:
        the archives that can be included in the current archive
      • getConfigurationURL

        public static Collection<URL> getConfigurationURL​(List<String> appDeployDirectories,
                                                          Set<Archive> appDeployArchives,
                                                          String configuration)
                                                   throws IOException
        Gives a Collection of URL corresponding to the configuration files that could be found under the given directories inside archives with the given suffixes
        Parameters:
        appDeployDirectories - the list of directory to scan
        appDeployArchives - the list of archives to scan
        configuration - the relative path to the configuration file
        Returns:
        the URL of the configuration files that could be found
        Throws:
        IOException - If we cannot access to the content of the archives for some reasons
      • createArchiveURL

        public static URL createArchiveURL​(String url)
                                    throws MalformedURLException
        Creates an archive URL from a String representation of that URL
        Parameters:
        url - the String representation
        Returns:
        the corresponding URL
        Throws:
        MalformedURLException - If the URL is incorrect
      • isArchiveURL

        public static boolean isArchiveURL​(String url)
        Indicates whether or not the provided URL is an archive URL
        Parameters:
        url - the String representation of the URL to check
        Returns:
        true if it is an archive URL, false otherwise