Class CustomizationInfo


  • public class CustomizationInfo
    extends java.lang.Object

    This class represents the customization information within a Customization folder. It provides methods to identify if a file is customized, if a resource (i.e. a file within the classpath) is customized, and a ClassLoader that loads only those classes/resources inside its folder.

    Since:
    MicroStrategy Web 9.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      CustomizationInfo​(java.lang.String name, java.lang.String rootFolderPath)
      Base Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.URL findResource​(java.lang.String resourceName)
      Returns the URL for a given resource.
      java.lang.ClassLoader getClassLoader()
      Returns a ClassLoader that loads classes/resources only within this customization WEB-INF/classes subfolder, and jar files inside WEB-INF/lib subfolder.
      java.lang.String getCustomPath​(java.lang.String appRelativePath)
      Returns the path that the given file would have within this customization folder.
      protected java.lang.String[] getJarFiles()
      Returns an array with the names of all jar files inside the WEB-INF/lib subfolder.
      java.lang.String getName()
      The name of this customization instance.
      java.lang.String getPath()
      The absolute path to the root folder of this customization.
      boolean isFileCustomized​(java.lang.String appRelativePath)
      Returns true if a file with the given relative path exists inside this customization.
      boolean isResourceCustomized​(java.lang.String resourceName)
      Returns true if a file with the given name exists inside this customization's WEB-INF/classes folder or within one of the jar files inside its WEB-INF/lib folder.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CustomizationInfo

        public CustomizationInfo​(java.lang.String name,
                                 java.lang.String rootFolderPath)
        Base Constructor. Creates a new instance.
        Parameters:
        name - The name to assign to the new instance. Mainly for information purpose.
        rootFolderPath - The root folder where the files of the customization are to be found.
    • Method Detail

      • getName

        public java.lang.String getName()
        The name of this customization instance. Mainly for information purpose.
      • getPath

        public java.lang.String getPath()
        The absolute path to the root folder of this customization.
      • isFileCustomized

        public boolean isFileCustomized​(java.lang.String appRelativePath)
        Returns true if a file with the given relative path exists inside this customization. appRelativePath is always assumed to be relative to the application's root folder, for example: "/jsp/mstrWeb.jsp"
      • getCustomPath

        public java.lang.String getCustomPath​(java.lang.String appRelativePath)
        Returns the path that the given file would have within this customization folder. This method will return the path relative to the application's root folder, without checking if the specified path exists or is valid. appRelativePath is always assumed to be relative to the application's root folder, for example: "/jsp/mstrWeb.jsp"
      • isResourceCustomized

        public boolean isResourceCustomized​(java.lang.String resourceName)
        Returns true if a file with the given name exists inside this customization's WEB-INF/classes folder or within one of the jar files inside its WEB-INF/lib folder.
      • findResource

        public java.net.URL findResource​(java.lang.String resourceName)
        Returns the URL for a given resource. If the resource is not found, it returns null.
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Returns a ClassLoader that loads classes/resources only within this customization WEB-INF/classes subfolder, and jar files inside WEB-INF/lib subfolder.
      • getJarFiles

        protected java.lang.String[] getJarFiles()
        Returns an array with the names of all jar files inside the WEB-INF/lib subfolder.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object