com.scooterframework.admin
Class EnvConfig

java.lang.Object
  extended by com.scooterframework.admin.EnvConfig
All Implemented Interfaces:
java.util.Observer

public class EnvConfig
extends java.lang.Object
implements java.util.Observer

EnvConfig class configures the application during startup time.

You can add more mappings by using the additional.mimetypes property in the environment.properties file. Or you can create your own content handler plugin by extending the Plugin class and implementing the ContentHandler interface.


Field Summary
static java.lang.String DATA_PROPERTIES_FILE
           
static java.lang.String DEFAULT_VALUE_actionExtension
           
static java.lang.String DEFAULT_VALUE_additionalMimeTypes
           
static java.lang.String DEFAULT_VALUE_additionalSinglePlural
           
static java.lang.String DEFAULT_VALUE_allowCacheAssociatedObjects
           
static java.lang.String DEFAULT_VALUE_allowDataBrowser
           
static java.lang.String DEFAULT_VALUE_allowDefaultActionMethod
           
static java.lang.String DEFAULT_VALUE_allowDefaultControllerClass
           
static java.lang.String DEFAULT_VALUE_allowDisplayingErrorDetails
           
static java.lang.String DEFAULT_VALUE_allowForwardToActionNameViewWhenActionNotExist
           
static java.lang.String DEFAULT_VALUE_allowForwardToControllerNameViewWhenControllerNotExist
           
static java.lang.String DEFAULT_VALUE_benchmark
           
static java.lang.String DEFAULT_VALUE_benchmarkInHeader
           
static java.lang.String DEFAULT_VALUE_compileErrorPageURI
           
static java.lang.String DEFAULT_VALUE_controllerClassPrefix
           
static java.lang.String DEFAULT_VALUE_controllerClassSuffix
           
static java.lang.String DEFAULT_VALUE_defaultActionMethod
           
static java.lang.String DEFAULT_VALUE_defaultCacheName
           
static java.lang.String DEFAULT_VALUE_defaultCacheProvider
           
static java.lang.String DEFAULT_VALUE_defaultViewFilesDirectory
           
static java.lang.String DEFAULT_VALUE_errorPageURI
           
static java.lang.String DEFAULT_VALUE_flushCacheOnChange
           
static java.util.Locale DEFAULT_VALUE_gloabalLocale
           
static java.lang.String DEFAULT_VALUE_locale_country
           
static java.lang.String DEFAULT_VALUE_locale_language
           
static java.lang.String DEFAULT_VALUE_locale_variant
           
static java.lang.String DEFAULT_VALUE_localFlushCacheExceptions
           
static java.lang.String DEFAULT_VALUE_localUseCacheExceptions
           
static java.lang.String DEFAULT_VALUE_maximum_bytes_per_uploaded_file
           
static java.lang.String DEFAULT_VALUE_maximum_bytes_per_uploaded_file_in_memory
           
static java.lang.String DEFAULT_VALUE_maximum_total_bytes_per_upload_request
           
static java.lang.String DEFAULT_VALUE_messageResourcesFileBase
           
static java.lang.String DEFAULT_VALUE_modelClassPrefix
           
static java.lang.String DEFAULT_VALUE_modelClassSuffix
           
static java.lang.String DEFAULT_VALUE_passwordScheme
           
static java.lang.String DEFAULT_VALUE_rootURL
           
static java.lang.String DEFAULT_VALUE_runningEnvironment
           
static java.lang.String DEFAULT_VALUE_siteAdminPassword
           
static java.lang.String DEFAULT_VALUE_siteAdminUsername
           
static java.lang.String DEFAULT_VALUE_upload_file_repository
           
static java.lang.String DEFAULT_VALUE_useRequestCache
           
static java.lang.String DEFAULT_VALUE_useSecondLevelCache
           
static java.lang.String DEFAULT_VALUE_viewExtension
           
static java.lang.String DEFAULT_VALUE_webPageDirectoryName
           
static java.lang.String EXTENSION_MIMETYPES_RESOURCE
           
 
Method Summary
 boolean allowAutoCRUD()
          Alias of allowDefaultControllerClass method.
 boolean allowCacheAssociatedObjects(java.lang.String modelClassName)
          Checks if using second-level cache.
 boolean allowDataBrowser()
          Checks if DataBroser is allowed.
 boolean allowDefaultActionMethod()
          Checks if a default action name is used when an action method is not obtained from parsing a url.
 boolean allowDefaultControllerClass()
          Checks if a built-in default controller class is allowed to use.
 boolean allowDisplayingErrorDetails()
          Checks if displaying error details is allowed.
 boolean allowForwardToActionNameViewWhenActionNotExist()
          Checks if action name is used as a view when the action does not exist.
 boolean allowForwardToControllerNameViewWhenControllerNotExist()
          Checks if controller name is used as a view when the controller does not exist.
 boolean allowRecordBenchmark()
          Checks if bench mark info is allowed to record.
 boolean allowRecordBenchmarkInHeader()
          Checks if bench mark info is allowed to record in header.
 java.lang.String applyPasswordScheme(java.lang.String password)
           
 java.lang.String getActionExtension()
          Returns action extension
static java.lang.String getActionUriFor(java.lang.String action)
          Returns action URI for a specific action method.
static java.lang.String getActionUriFor(java.lang.String controllerPath, java.lang.String action)
          Returns action URI for a controller path with a specific action method.
 java.lang.String getCompileErrorPageURI()
          Returns compile error page URI.
 java.lang.String getControllerClassName(java.lang.String controllerPath)
          Returns full controller class name.
 java.lang.String getControllerClassPrefix()
          Returns controller class name prefix.
 java.lang.String getControllerClassSuffix()
          Returns controller class name suffix.
 java.lang.String getControllerName(java.lang.String fullClassName)
          Returns controller name in lower case.
 java.lang.String getDefaultActionMethod()
          Returns default method name of a controller class.
 java.lang.String getDefaultCacheName()
          Returns default cache name
 java.lang.String getDefaultCacheProviderName()
          Returns default cache provider name
 java.util.Properties getDefaultCacheProviderProperties()
          Returns default cache provider properties
 java.lang.String getDefaultViewFilesDirectory()
          Returns directory name which contains default view files.
 java.lang.String getDefaultViewFilesDirectoryForREST()
          Returns directory name which contains default view files for builtin RestfulCRUDController or RestfulRequestProcessor.
 org.apache.commons.fileupload.disk.DiskFileItemFactory getDiskFileItemFactory()
          Returns DiskFileItemFactory instance for file upload.
 java.lang.String getErrorPageURI()
          Returns error page URI.
 boolean getFlushCacheOnChange()
          Checks if using second-level cache for all model classes.
 java.lang.String getGlobalCountry()
          Returns the country for the configured locale.
 java.lang.String getGlobalLanguage()
          Returns the language for the configured locale.
 java.util.Locale getGlobalLocale()
          Returns configured locale.
 java.lang.String getGlobalVariant()
          Returns the variant for the configured locale.
 ActiveRecord getHomeInstance(java.lang.String model)
          Returns home instance of a model.
static EnvConfig getInstance()
           
 java.util.Collection<java.lang.String> getLocalFlushCacheExceptions(java.lang.String modelClassName)
          Returns a collection methods that are exceptional to the setting of useRequestCache and useSecondLevelCache.
 java.util.Collection<java.lang.String> getLocalUseCacheExceptions(java.lang.String modelClassName)
          Returns a collection methods that are exceptional to the setting of useRequestCache and useSecondLevelCache.
 long getMaximumBytesPerUploadedFile()
          Returns the maximum allowed bytes of an upload file.
 int getMaximumBytesPerUploadedFileInMemory()
          Returns the threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.
 long getMaximumTotalBytesPerUploadRequest()
          Returns the maximum allowed bytes of an upload request.
 java.lang.String getMessageResourcesFileBase()
          Returns the base name of message files.
 java.lang.String getMimeType(java.lang.String extension)
          Returns MIME type corresponding the specific extension.
 java.util.Map<java.lang.String,java.lang.String> getMimeTypeMap()
          Returns the extension/mimetype mapping.
 java.lang.String getModelClassName(java.lang.String model)
          Returns full model class name.
 java.lang.String getModelClassNameFromControllerClassName(java.lang.String controllerClassName)
          Returns model class name based on controller class name.
 java.lang.String getModelClassPrefix()
          Returns model class name prefix.
 java.lang.String getModelClassSuffix()
          Returns model class name suffix.
 java.lang.String getPasswordScheme()
          Returns password scheme
 java.util.Properties getPluginProperties(java.lang.String pluginName)
          Returns plugin properties
 java.util.Iterator<java.lang.String> getPredefinedCacheProviderNames()
          Returns cache provider names
 java.util.Properties getPredefinedCacheProviderProperties(java.lang.String providerName)
          Returns cache provider properties
 java.util.Properties getProperties()
          Returns all properties.
 java.lang.String getProperty(java.lang.String key)
          Returns a String property corresponding to a key.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns a String property corresponding to a key.
static java.lang.String getRealPath()
          Returns real path of the application.
 java.lang.String getRootURL()
          Returns root url.
 java.lang.String getServerType()
          Returns server type
 org.apache.commons.fileupload.servlet.ServletFileUpload getServletFileUpload()
          Returns ServletFileUpload instance for file upload.
 java.lang.String getSiteAdminPassword()
          Returns site admin password.
 java.lang.String getSiteAdminUsername()
          Returns site admin username.
 java.lang.String getUploadFileRepository()
          Returns file directory for storing uploaded files.
 boolean getUseSecondLevelCache()
          Checks if using second-level cache for all model classes.
 boolean getUseThreadCache()
          Checks if using thread cache for all model classes.
 java.lang.String getViewExtension()
          Returns view extension
static java.lang.String getViewURI(java.lang.String controller, java.lang.String actionOrView)
           Returns view URI for a controller with a specific action.
static java.lang.String getViewURI(java.lang.String controller, java.lang.String actionOrView, java.lang.String defaultViewDir)
          Returns a view URI.
 java.lang.String getWebPageDirectoryName()
          Returns directory name which contains all web pages.
 boolean hasMimeTypeFor(java.lang.String extension)
          Checks if the specific extension has a registered MIME type.
 boolean isHighlightable(java.lang.String fileExtension)
          Checks if the content of the file can be highlighted.
 boolean isTextFile(java.io.File file)
          Checks whether a file is a text file.
 boolean isTextFile(java.lang.String extension)
          Checks whether a file extension indicates that it is a text file.
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTENSION_MIMETYPES_RESOURCE

public static final java.lang.String EXTENSION_MIMETYPES_RESOURCE
See Also:
Constant Field Values

DATA_PROPERTIES_FILE

public static final java.lang.String DATA_PROPERTIES_FILE
See Also:
Constant Field Values

DEFAULT_VALUE_defaultViewFilesDirectory

public static final java.lang.String DEFAULT_VALUE_defaultViewFilesDirectory
See Also:
Constant Field Values

DEFAULT_VALUE_siteAdminUsername

public static final java.lang.String DEFAULT_VALUE_siteAdminUsername

DEFAULT_VALUE_siteAdminPassword

public static final java.lang.String DEFAULT_VALUE_siteAdminPassword

DEFAULT_VALUE_modelClassPrefix

public static final java.lang.String DEFAULT_VALUE_modelClassPrefix
See Also:
Constant Field Values

DEFAULT_VALUE_modelClassSuffix

public static final java.lang.String DEFAULT_VALUE_modelClassSuffix
See Also:
Constant Field Values

DEFAULT_VALUE_controllerClassPrefix

public static final java.lang.String DEFAULT_VALUE_controllerClassPrefix
See Also:
Constant Field Values

DEFAULT_VALUE_controllerClassSuffix

public static final java.lang.String DEFAULT_VALUE_controllerClassSuffix
See Also:
Constant Field Values

DEFAULT_VALUE_allowDefaultControllerClass

public static final java.lang.String DEFAULT_VALUE_allowDefaultControllerClass
See Also:
Constant Field Values

DEFAULT_VALUE_actionExtension

public static final java.lang.String DEFAULT_VALUE_actionExtension
See Also:
Constant Field Values

DEFAULT_VALUE_defaultActionMethod

public static final java.lang.String DEFAULT_VALUE_defaultActionMethod
See Also:
Constant Field Values

DEFAULT_VALUE_allowDefaultActionMethod

public static final java.lang.String DEFAULT_VALUE_allowDefaultActionMethod
See Also:
Constant Field Values

DEFAULT_VALUE_webPageDirectoryName

public static final java.lang.String DEFAULT_VALUE_webPageDirectoryName
See Also:
Constant Field Values

DEFAULT_VALUE_allowForwardToControllerNameViewWhenControllerNotExist

public static final java.lang.String DEFAULT_VALUE_allowForwardToControllerNameViewWhenControllerNotExist
See Also:
Constant Field Values

DEFAULT_VALUE_allowForwardToActionNameViewWhenActionNotExist

public static final java.lang.String DEFAULT_VALUE_allowForwardToActionNameViewWhenActionNotExist
See Also:
Constant Field Values

DEFAULT_VALUE_runningEnvironment

public static final java.lang.String DEFAULT_VALUE_runningEnvironment
See Also:
Constant Field Values

DEFAULT_VALUE_passwordScheme

public static final java.lang.String DEFAULT_VALUE_passwordScheme
See Also:
Constant Field Values

DEFAULT_VALUE_benchmark

public static final java.lang.String DEFAULT_VALUE_benchmark
See Also:
Constant Field Values

DEFAULT_VALUE_benchmarkInHeader

public static final java.lang.String DEFAULT_VALUE_benchmarkInHeader
See Also:
Constant Field Values

DEFAULT_VALUE_locale_language

public static final java.lang.String DEFAULT_VALUE_locale_language

DEFAULT_VALUE_locale_country

public static final java.lang.String DEFAULT_VALUE_locale_country

DEFAULT_VALUE_locale_variant

public static final java.lang.String DEFAULT_VALUE_locale_variant

DEFAULT_VALUE_gloabalLocale

public static final java.util.Locale DEFAULT_VALUE_gloabalLocale

DEFAULT_VALUE_messageResourcesFileBase

public static final java.lang.String DEFAULT_VALUE_messageResourcesFileBase
See Also:
Constant Field Values

DEFAULT_VALUE_viewExtension

public static final java.lang.String DEFAULT_VALUE_viewExtension
See Also:
Constant Field Values

DEFAULT_VALUE_rootURL

public static final java.lang.String DEFAULT_VALUE_rootURL
See Also:
Constant Field Values

DEFAULT_VALUE_errorPageURI

public static final java.lang.String DEFAULT_VALUE_errorPageURI
See Also:
Constant Field Values

DEFAULT_VALUE_compileErrorPageURI

public static final java.lang.String DEFAULT_VALUE_compileErrorPageURI
See Also:
Constant Field Values

DEFAULT_VALUE_allowDisplayingErrorDetails

public static final java.lang.String DEFAULT_VALUE_allowDisplayingErrorDetails
See Also:
Constant Field Values

DEFAULT_VALUE_allowDataBrowser

public static final java.lang.String DEFAULT_VALUE_allowDataBrowser
See Also:
Constant Field Values

DEFAULT_VALUE_additionalMimeTypes

public static final java.lang.String DEFAULT_VALUE_additionalMimeTypes
See Also:
Constant Field Values

DEFAULT_VALUE_additionalSinglePlural

public static final java.lang.String DEFAULT_VALUE_additionalSinglePlural
See Also:
Constant Field Values

DEFAULT_VALUE_defaultCacheProvider

public static final java.lang.String DEFAULT_VALUE_defaultCacheProvider

DEFAULT_VALUE_defaultCacheName

public static final java.lang.String DEFAULT_VALUE_defaultCacheName

DEFAULT_VALUE_useRequestCache

public static final java.lang.String DEFAULT_VALUE_useRequestCache
See Also:
Constant Field Values

DEFAULT_VALUE_useSecondLevelCache

public static final java.lang.String DEFAULT_VALUE_useSecondLevelCache
See Also:
Constant Field Values

DEFAULT_VALUE_flushCacheOnChange

public static final java.lang.String DEFAULT_VALUE_flushCacheOnChange
See Also:
Constant Field Values

DEFAULT_VALUE_localUseCacheExceptions

public static final java.lang.String DEFAULT_VALUE_localUseCacheExceptions

DEFAULT_VALUE_localFlushCacheExceptions

public static final java.lang.String DEFAULT_VALUE_localFlushCacheExceptions

DEFAULT_VALUE_allowCacheAssociatedObjects

public static final java.lang.String DEFAULT_VALUE_allowCacheAssociatedObjects
See Also:
Constant Field Values

DEFAULT_VALUE_upload_file_repository

public static final java.lang.String DEFAULT_VALUE_upload_file_repository

DEFAULT_VALUE_maximum_bytes_per_uploaded_file_in_memory

public static final java.lang.String DEFAULT_VALUE_maximum_bytes_per_uploaded_file_in_memory
See Also:
Constant Field Values

DEFAULT_VALUE_maximum_total_bytes_per_upload_request

public static final java.lang.String DEFAULT_VALUE_maximum_total_bytes_per_upload_request
See Also:
Constant Field Values

DEFAULT_VALUE_maximum_bytes_per_uploaded_file

public static final java.lang.String DEFAULT_VALUE_maximum_bytes_per_uploaded_file
See Also:
Constant Field Values
Method Detail

getInstance

public static EnvConfig getInstance()

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

getProperties

public java.util.Properties getProperties()
Returns all properties.


getProperty

public java.lang.String getProperty(java.lang.String key)
Returns a String property corresponding to a key.


getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Returns a String property corresponding to a key. The method returns the default value argument if the property is not found.


getSiteAdminUsername

public java.lang.String getSiteAdminUsername()
Returns site admin username.


getSiteAdminPassword

public java.lang.String getSiteAdminPassword()
Returns site admin password.


getActionExtension

public java.lang.String getActionExtension()
Returns action extension

Returns:
action extension

getViewExtension

public java.lang.String getViewExtension()
Returns view extension

Returns:
view extension

getRootURL

public java.lang.String getRootURL()
Returns root url.

Returns:
root url

getControllerClassPrefix

public java.lang.String getControllerClassPrefix()
Returns controller class name prefix.


getControllerClassSuffix

public java.lang.String getControllerClassSuffix()
Returns controller class name suffix.


allowDefaultControllerClass

public boolean allowDefaultControllerClass()
Checks if a built-in default controller class is allowed to use.


allowAutoCRUD

public boolean allowAutoCRUD()
Alias of allowDefaultControllerClass method.


getDefaultActionMethod

public java.lang.String getDefaultActionMethod()
Returns default method name of a controller class.


allowDefaultActionMethod

public boolean allowDefaultActionMethod()
Checks if a default action name is used when an action method is not obtained from parsing a url.


getModelClassPrefix

public java.lang.String getModelClassPrefix()
Returns model class name prefix.


getModelClassSuffix

public java.lang.String getModelClassSuffix()
Returns model class name suffix.


getWebPageDirectoryName

public java.lang.String getWebPageDirectoryName()
Returns directory name which contains all web pages.


getActionUriFor

public static java.lang.String getActionUriFor(java.lang.String action)
Returns action URI for a specific action method. If there is no extension type in the action name, the action is treated as an extension type defined in config properties file. For example, if the action is "show", the action could be treated as "show.do" action if the actionExtension property is defined as ".do".
 Examples:
      getActionUriFor("list") => list.do (extension = .do)
 

Parameters:
action - the action method
Returns:
action URI string

getActionUriFor

public static java.lang.String getActionUriFor(java.lang.String controllerPath,
                                               java.lang.String action)
Returns action URI for a controller path with a specific action method. If there is no extension type in the action name, the action is treated as an extension type defined in config properties file. For example, if the action is "show", the action could be treated as "show.do" action if the actionExtension property is defined as ".do".
 Examples:
      getActionUriFor("/posts", "list") => /posts/list.do
 

Parameters:
controllerPath - path to the action
action - the action method
Returns:
action URI string

getViewURI

public static java.lang.String getViewURI(java.lang.String controller,
                                          java.lang.String actionOrView)

Returns view URI for a controller with a specific action.

If there is no extension type in the view name, the view is treated as an extension type defined in config properties file. For example, if the view is "show", the view could be treated as "show.jsp" action if the view.extension property is defined as ".jsp". The directory path for view files is set by the webpage.directory.name property in properties file.

 Examples:
      If your JSP web pages are under webapp:
      webpage.directory.name=""
      getViewURI("posts", "list") => /posts/list.jsp

      If your jsp web pages are under WEB-INF/views:
      webpage.directory.name="WEB-INF/views" (default)
      getViewURI("posts", "list") => /WEB-INF/views/posts/list.jsp
 

Parameters:
controller - controller name
actionOrView - the action method name or view name
Returns:
view URI.

getViewURI

public static java.lang.String getViewURI(java.lang.String controller,
                                          java.lang.String actionOrView,
                                          java.lang.String defaultViewDir)
Returns a view URI. This URI is a real view file associated with the controller and the action or view name.

Parameters:
controller - the name of the controller
actionOrView - the action method name or view name
Returns:
view URI.

getRealPath

public static java.lang.String getRealPath()
Returns real path of the application.

Returns:
real path of the application.

getDefaultViewFilesDirectory

public java.lang.String getDefaultViewFilesDirectory()
Returns directory name which contains default view files. Default view files directory specifies directory name for default view files. These view files are related to the non-restful way of actions. For restful way of requests, the default view files are in {DEFAULT_VALUE_defaultViewFilesDirectory}_restful directory.


getDefaultViewFilesDirectoryForREST

public java.lang.String getDefaultViewFilesDirectoryForREST()
Returns directory name which contains default view files for builtin RestfulCRUDController or RestfulRequestProcessor.


allowForwardToControllerNameViewWhenControllerNotExist

public boolean allowForwardToControllerNameViewWhenControllerNotExist()
Checks if controller name is used as a view when the controller does not exist.


allowForwardToActionNameViewWhenActionNotExist

public boolean allowForwardToActionNameViewWhenActionNotExist()
Checks if action name is used as a view when the action does not exist.


getServerType

public java.lang.String getServerType()
Returns server type


getPasswordScheme

public java.lang.String getPasswordScheme()
Returns password scheme


applyPasswordScheme

public java.lang.String applyPasswordScheme(java.lang.String password)

getControllerClassName

public java.lang.String getControllerClassName(java.lang.String controllerPath)
Returns full controller class name.

Parameters:
controllerPath - controller path
Returns:
full java class name

getControllerName

public java.lang.String getControllerName(java.lang.String fullClassName)
Returns controller name in lower case.

Parameters:
fullClassName - full class name of the controller
Returns:
short controller name (in lower case)

getModelClassName

public java.lang.String getModelClassName(java.lang.String model)
Returns full model class name.

Parameters:
model - model name
Returns:
full java class name

getModelClassNameFromControllerClassName

public java.lang.String getModelClassNameFromControllerClassName(java.lang.String controllerClassName)
Returns model class name based on controller class name.


getHomeInstance

public ActiveRecord getHomeInstance(java.lang.String model)

Returns home instance of a model.

A home instance of a record is a read-only instance for a model type. Its main function is to provide meta information of the model and some finder methods.

Parameters:
model - name corresponding to the model home instance
Returns:
a home instance of a model

allowRecordBenchmark

public boolean allowRecordBenchmark()
Checks if bench mark info is allowed to record.

Returns:
true if allowed

allowRecordBenchmarkInHeader

public boolean allowRecordBenchmarkInHeader()
Checks if bench mark info is allowed to record in header.

Returns:
true if allowed

getGlobalLocale

public java.util.Locale getGlobalLocale()
Returns configured locale.


getGlobalLanguage

public java.lang.String getGlobalLanguage()
Returns the language for the configured locale.


getGlobalCountry

public java.lang.String getGlobalCountry()
Returns the country for the configured locale.


getGlobalVariant

public java.lang.String getGlobalVariant()
Returns the variant for the configured locale.


getMessageResourcesFileBase

public java.lang.String getMessageResourcesFileBase()
Returns the base name of message files.


getErrorPageURI

public java.lang.String getErrorPageURI()
Returns error page URI.


getCompileErrorPageURI

public java.lang.String getCompileErrorPageURI()
Returns compile error page URI.


allowDisplayingErrorDetails

public boolean allowDisplayingErrorDetails()
Checks if displaying error details is allowed.

Returns:
true if allowed

allowDataBrowser

public boolean allowDataBrowser()
Checks if DataBroser is allowed.

Returns:
true if allowed

getPredefinedCacheProviderProperties

public java.util.Properties getPredefinedCacheProviderProperties(java.lang.String providerName)
Returns cache provider properties


getPredefinedCacheProviderNames

public java.util.Iterator<java.lang.String> getPredefinedCacheProviderNames()
Returns cache provider names


getDefaultCacheProviderName

public java.lang.String getDefaultCacheProviderName()
Returns default cache provider name


getDefaultCacheName

public java.lang.String getDefaultCacheName()
Returns default cache name


getDefaultCacheProviderProperties

public java.util.Properties getDefaultCacheProviderProperties()
Returns default cache provider properties


getUseThreadCache

public boolean getUseThreadCache()
Checks if using thread cache for all model classes.

Returns:
true if using thread cache

getUseSecondLevelCache

public boolean getUseSecondLevelCache()
Checks if using second-level cache for all model classes.

Returns:
true if using second-level cache

getFlushCacheOnChange

public boolean getFlushCacheOnChange()
Checks if using second-level cache for all model classes.

Returns:
true if using second-level cache

getLocalUseCacheExceptions

public java.util.Collection<java.lang.String> getLocalUseCacheExceptions(java.lang.String modelClassName)
Returns a collection methods that are exceptional to the setting of useRequestCache and useSecondLevelCache.

Returns:
true if using thread cache

getLocalFlushCacheExceptions

public java.util.Collection<java.lang.String> getLocalFlushCacheExceptions(java.lang.String modelClassName)
Returns a collection methods that are exceptional to the setting of useRequestCache and useSecondLevelCache.

Returns:
a collection of exceptional method names

allowCacheAssociatedObjects

public boolean allowCacheAssociatedObjects(java.lang.String modelClassName)
Checks if using second-level cache.

Returns:
true if using second-level cache

getPluginProperties

public java.util.Properties getPluginProperties(java.lang.String pluginName)
Returns plugin properties


getMimeTypeMap

public java.util.Map<java.lang.String,java.lang.String> getMimeTypeMap()
Returns the extension/mimetype mapping.


getMimeType

public java.lang.String getMimeType(java.lang.String extension)
Returns MIME type corresponding the specific extension.

Parameters:
extension - The extension string.
Returns:
the MIME type string for the extension.

hasMimeTypeFor

public boolean hasMimeTypeFor(java.lang.String extension)
Checks if the specific extension has a registered MIME type.

Parameters:
extension - The extension string.
Returns:
true if there is a MIME type for the extension.

getUploadFileRepository

public java.lang.String getUploadFileRepository()
Returns file directory for storing uploaded files.


getMaximumBytesPerUploadedFileInMemory

public int getMaximumBytesPerUploadedFileInMemory()
Returns the threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file. The default value is 10240 bytes.


getMaximumTotalBytesPerUploadRequest

public long getMaximumTotalBytesPerUploadRequest()
Returns the maximum allowed bytes of an upload request. The default value of -1 indicates, that there is no limit.


getMaximumBytesPerUploadedFile

public long getMaximumBytesPerUploadedFile()
Returns the maximum allowed bytes of an upload file. The default value of -1 indicates, that there is no limit.


getDiskFileItemFactory

public org.apache.commons.fileupload.disk.DiskFileItemFactory getDiskFileItemFactory()
Returns DiskFileItemFactory instance for file upload.


getServletFileUpload

public org.apache.commons.fileupload.servlet.ServletFileUpload getServletFileUpload()
Returns ServletFileUpload instance for file upload.


isTextFile

public boolean isTextFile(java.io.File file)
Checks whether a file is a text file.

Parameters:
file - the file to check
Returns:
true if it is a text file.

isTextFile

public boolean isTextFile(java.lang.String extension)
Checks whether a file extension indicates that it is a text file.

Parameters:
extension - the file extension to check
Returns:
true if it is a text file.

isHighlightable

public boolean isHighlightable(java.lang.String fileExtension)
Checks if the content of the file can be highlighted. Only a selected types of file extensions are highlightable.

Parameters:
fileExtension -
Returns:
true if highlightable