public class VFSLibSettings
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOG_PREFIX
Prefix used for the log messages created by this module.
|
static java.lang.String |
MSG_PREFIX
Prefix used for the log messages like "VFSLIB-0001".
|
protected static VFSLibSettings |
sharedInstance
Shared
VFSLibSettings instance. |
protected static VFSFileSystemManager |
vfsManagerNetwork
Shared
FileSystemManager instance holding the network connections. |
Constructor and Description |
---|
VFSLibSettings()
Constructor method.
|
Modifier and Type | Method and Description |
---|---|
void |
check()
Performs some simple tests for the caches and configurations and creates log messages.
|
static int |
extractLocalization(java.lang.Object target)
Searches for localization patterns and reads the object texts into the configuration.
|
protected void |
finalize()
Cares for proper cleanup when is not needed any longer (helps gc).
|
java.lang.String |
getBaseURL()
Provides the log prefix like "http://devel.al11.net/javinfo" used by Web Start applications.
|
java.lang.String |
getDeploymentDescriptor()
Provides the basename of the deloyment descriptor files for Web Start applications.
|
java.lang.String |
getDeploymentRoot()
Provides the absolute path to access the web applications (normally 'webapps').
|
com.lf.commons.lang.DeployProps |
getDeployProps()
Gets the global version information.
|
static java.lang.String |
getEnglishMessage(java.lang.String code)
Convenience method to get a localized official message for the user.
|
static java.lang.String |
getEnglishText(java.lang.Class clazz,
java.lang.String variable)
Convenience method to get the original (English) text.
|
static java.lang.String |
getEnglishText(java.lang.Class clazz,
java.lang.String variable,
java.lang.String[] regex,
java.lang.String[] replacement)
Convenience method to get the original (English) text.
|
com.lf.commons.i18n.I18NConfiguration |
getEnglishTexts()
Provides the English texts for the GUI (labels, tooltips etc.).
|
java.lang.String |
getI18NBase()
Provides the global resource path for internationalization resources.
|
com.lf.commons.i18n.I18NConfiguration |
getI18NTexts()
Provides the global localized texts for the user.
|
java.lang.String |
getLogDateFormat()
Provides the log date format like "yyyy-MM-dd HH:mm:ss.SSS" used by Web Start applications.
|
java.util.logging.Logger |
getLogger()
Gets the global logging instance.
|
com.lf.commons.i18n.Locale |
getLogLocale()
Gets the global locale used for logging.
|
java.lang.String |
getLogPrefix()
Provides the log prefix like "[javinfo]" used by Web Start applications.
|
static VFSFileSystemManager |
getManagerNetwork()
Get a shared instance of the Commons
FileSystemManager holding the network connections. |
com.lf.commons.msg.MessageCodes |
getMessageCodes()
Provides the global message codes handlers.
|
com.lf.commons.dialog.ReleaseNotes |
getReleaseNotes()
Provides the locale specific release notes (
core package). |
org.apache.commons.vfs2.FileObject |
getReleaseNotesURL()
Provides the locale specific release notes (
core package). |
static VFSLibSettings |
getSharedInstance()
Convenience method to get a shared instance.
|
java.util.Date |
getStartDate()
Provides the info when the service was started.
|
java.util.Vector<com.lf.commons.i18n.Locale> |
getSupportedLocales(boolean synonyms)
Returns the locales currently supported by the package.
|
com.lf.commons.i18n.Locale |
getUserLocale()
Gets the global user locale.
|
static java.lang.String |
getUserMessage(java.lang.String code)
Convenience method to get a localized official message for the user.
|
static java.lang.String |
getUserMessage(java.lang.String code,
boolean prefix)
Convenience method to get a localized official message for the user.
|
static java.lang.String |
getUserMessage(java.lang.String code,
java.lang.String[] regex,
java.lang.String[] replacement,
boolean prefix)
Convenience method to log a localized official message.
|
static java.lang.String |
getUserText(java.lang.Class clazz,
java.lang.String variable)
Convenience method to get a localized text for the user.
|
static java.lang.String |
getUserText(java.lang.Class clazz,
java.lang.String variable,
java.lang.String[] regex,
java.lang.String[] replacement)
Convenience method to get a localized text for the user.
|
java.lang.String |
getXMLEncoding()
Provides the XML encoding like "UTF-8" used by Web Start applications.
|
static void |
localize(java.lang.Object target,
java.lang.Class targetclazz)
Provides the info whether to enable object localization or not.
|
static void |
log(java.util.logging.Level level,
java.lang.String message)
Convenience method to log a message.
|
static void |
logMessage(java.util.logging.Level level,
java.lang.String message)
Convenience method to log a message.
|
static void |
logMessage(java.lang.String code,
java.util.logging.Level level)
Convenience method to log a localized official message.
|
static void |
logMessage(java.lang.String code,
java.util.logging.Level level,
java.lang.String[] regex,
java.lang.String[] replacement)
Convenience method to log a localized official message.
|
static void |
logMessage(java.lang.String code,
java.util.logging.Level level,
java.lang.String regex,
java.lang.String replacement)
Convenience method to log a localized official message.
|
void |
setLogger(java.util.logging.Logger logger)
Sets the global logging instance.
|
void |
setUserLocale(com.lf.commons.i18n.Locale locale)
Sets the global user locale.
|
protected static VFSLibSettings sharedInstance
VFSLibSettings
instance.protected static VFSFileSystemManager vfsManagerNetwork
FileSystemManager
instance holding the network connections.public static final java.lang.String MSG_PREFIX
public static final java.lang.String LOG_PREFIX
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public static VFSFileSystemManager getManagerNetwork()
FileSystemManager
holding the network connections.
Here, the connections are managed while the global VFSFileSystemManager
(which can
be accessed using VFSUtils.getManager()
) does not.
public void check()
public java.lang.String getI18NBase()
public com.lf.commons.i18n.I18NConfiguration getI18NTexts()
public com.lf.commons.i18n.I18NConfiguration getEnglishTexts()
public static void localize(java.lang.Object target, java.lang.Class targetclazz)
target
- The target object to be localizedtargetclazz
- The target clazz, maybe a superclasspublic static int extractLocalization(java.lang.Object target)
target
- The target object to be localizedpublic com.lf.commons.msg.MessageCodes getMessageCodes()
public java.util.logging.Logger getLogger()
public void setLogger(java.util.logging.Logger logger)
logger
- Logging instancejava.lang.NullPointerException
- Error indicationpublic com.lf.commons.i18n.Locale getUserLocale()
public void setUserLocale(com.lf.commons.i18n.Locale locale) throws java.lang.IllegalArgumentException
locale
- Locale instancejava.lang.IllegalArgumentException
- Error indicationpublic java.util.Vector<com.lf.commons.i18n.Locale> getSupportedLocales(boolean synonyms)
synonyms
- Also add the ISO 639-1/2 synonyms like "deu_DE" for "ger_DE"?public com.lf.commons.i18n.Locale getLogLocale()
public com.lf.commons.lang.DeployProps getDeployProps()
public static VFSLibSettings getSharedInstance()
public static void log(java.util.logging.Level level, java.lang.String message)
level
- The log levelmessage
- The log messagepublic static void logMessage(java.util.logging.Level level, java.lang.String message)
level
- The log levelmessage
- The log messagepublic static void logMessage(java.lang.String code, java.util.logging.Level level)
code
- The log message id like "VFSLIB-0006"level
- The log levelpublic static void logMessage(java.lang.String code, java.util.logging.Level level, java.lang.String regex, java.lang.String replacement)
code
- The log message id like "VFSLIB-0006"level
- The log levelregex
- The regular expressionreplacement
- The replacement stringpublic static void logMessage(java.lang.String code, java.util.logging.Level level, java.lang.String[] regex, java.lang.String[] replacement)
code
- The log message id like "VFSLIB-0006"level
- The log levelregex
- The regular expressionsreplacement
- The replacement stringspublic static java.lang.String getUserMessage(java.lang.String code)
code
- The message code of interest, don't pass null
valuesnull
if code does not existpublic static java.lang.String getEnglishMessage(java.lang.String code)
code
- The message code of interest, don't pass null
valuesnull
if code does not existpublic static java.lang.String getUserMessage(java.lang.String code, boolean prefix)
code
- The message code of interest, don't pass null
valuesprefix
- Prepend the prefix?null
if code does not existpublic static java.lang.String getUserMessage(java.lang.String code, java.lang.String[] regex, java.lang.String[] replacement, boolean prefix)
code
- The log message id like "VFSLIB-0006"regex
- The regular expressionreplacement
- The replacement stringprefix
- Prepend the prefix?null
if code does not existpublic static java.lang.String getUserText(java.lang.Class clazz, java.lang.String variable)
clazz
- The class for getting the class prefixvariable
- The variable without class prefix, don't pass null
valuespublic static java.lang.String getEnglishText(java.lang.Class clazz, java.lang.String variable)
clazz
- The class for getting the class prefixvariable
- The variable without class prefix, don't pass null
valuesnull
if variable does not existpublic static java.lang.String getEnglishText(java.lang.Class clazz, java.lang.String variable, java.lang.String[] regex, java.lang.String[] replacement)
clazz
- The class for getting the class prefixvariable
- The variable without class prefix, don't pass null
valuesregex
- The regular expressionreplacement
- The replacement stringpublic static java.lang.String getUserText(java.lang.Class clazz, java.lang.String variable, java.lang.String[] regex, java.lang.String[] replacement)
clazz
- The class for getting the class prefixvariable
- The variable without class prefix, don't pass null
valuesregex
- The regular expressionreplacement
- The replacement stringpublic java.util.Date getStartDate()
public org.apache.commons.vfs2.FileObject getReleaseNotesURL()
core
package).
public com.lf.commons.dialog.ReleaseNotes getReleaseNotes()
core
package).
public java.lang.String getDeploymentRoot()
public java.lang.String getDeploymentDescriptor()
public java.lang.String getXMLEncoding()
public java.lang.String getLogDateFormat()
public java.lang.String getLogPrefix()
public java.lang.String getBaseURL()
Copyright © 2005-2023 Leisenfels GmbH. All rights reserved.