Package com.microstrategy.utils
Class CustomizationInfo
- java.lang.Object
-
- com.microstrategy.utils.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.CustomizationInfo(java.lang.String name, java.lang.String rootFolderPath, Customizations parent)
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.io.InputStream
findResourceAsStream(java.lang.String resourceName)
Returns theInputStream
for a given resource.java.lang.ClassLoader
getClassLoader()
Returns aClassLoader
that loads classes/resources only within this customizationWEB-INF/classes
subfolder, and jar files insideWEB-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 theWEB-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)
Returnstrue
if a file with the given relative path exists inside this customization.boolean
isResourceCustomized(java.lang.String resourceName)
Returnstrue
if a file with the given name exists inside this customization'sWEB-INF/classes
folder or within one of the jar files inside itsWEB-INF/lib
folder.java.lang.String
toString()
-
-
-
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.
-
CustomizationInfo
public CustomizationInfo(java.lang.String name, java.lang.String rootFolderPath, Customizations parent)
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.parent
- TODO
-
-
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)
Returnstrue
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)
Returnstrue
if a file with the given name exists inside this customization'sWEB-INF/classes
folder or within one of the jar files inside itsWEB-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.
-
findResourceAsStream
public java.io.InputStream findResourceAsStream(java.lang.String resourceName)
Returns theInputStream
for a given resource. If the resource is not found, it returns null.- Parameters:
resourceName
- The name of the resource to find.- Returns:
- The
InputStream
for the resource.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Returns aClassLoader
that loads classes/resources only within this customizationWEB-INF/classes
subfolder, and jar files insideWEB-INF/lib
subfolder.
-
getJarFiles
protected java.lang.String[] getJarFiles()
Returns an array with the names of all jar files inside theWEB-INF/lib
subfolder.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-