|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.fuin.kickstart4j.Config
public final class Config
Configuration for the application. The cmdLineOptions map
contains all arguments from the command line that are not known standard
arguments. This way it's possible to add application specific parameters for
the installation process. The entries userHome and
destDir are predefined values.
| Constructor Summary | |
|---|---|
Config()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
check()
Checks if the configuration is valid. |
SrcDir |
findSrcDir(java.lang.String path)
Find a source directory by it's path. |
SrcFile |
findSrcFile(java.lang.String path,
java.lang.String filename)
Find a source file by it's path and filename. |
java.util.Map |
getCmdLineOptions()
Returns the options form the command line. |
java.lang.String |
getConfigFileUrl()
Returns the URL of the configuration file (only used when lazyLoading=true). |
java.net.URL |
getConfigFileURL()
Returns the URL of the configuration file (only used when lazyLoading=true). |
java.lang.String |
getDescription()
Returns a short description of the application. |
java.io.File |
getDestDir()
Returns the local destination path where the files should be copied to. |
java.lang.String |
getDestPath()
Returns the local destination path where the files should be copied to. |
java.lang.String |
getIdFilename()
Returns the unique id filename for the application. |
java.lang.String |
getJavaArgs()
Returns the command line arguments. |
java.lang.String |
getJavaExe()
Returns the Java executable. |
java.util.Locale |
getLocale()
Returns the locale to use. |
java.lang.String |
getLogFilename()
Returns the name and path of the log file. |
java.lang.String |
getLookAndFeelClassName()
Returns the name of the LookAndFeel class. |
MessagesWrapper |
getMessages()
Returns the message properties needed for the installer. |
java.util.List |
getMkDirs()
Returns the list of directories to create. |
java.lang.String |
getMsgFileUrl()
Returns the file containing the localized installation messages. |
java.net.URL |
getMsgFileURL()
Returns the file containing the localized installation messages. |
java.util.List |
getSrcDirs()
Returns the list of known source directories. |
java.util.List |
getSrcFiles()
Returns the list of known source files. |
int |
getStartFrameDelaySeconds()
Show the start frame for N seconds after application has started. |
java.lang.String |
getTitle()
Returns the title of the application. |
java.lang.String |
getVendor()
Returns the vendor information. |
java.lang.String |
getVersion()
Returns the target application version. |
java.lang.String |
getXmlEncoding()
Returns the encoding to use for XML out. |
boolean |
isExitAfterExecute()
Returns whether the program should terminate after executing. |
boolean |
isFirstInstallation()
Determines if this is the first installation. |
boolean |
isLazyLoading()
Returns if lazy loading is active. |
boolean |
isShowStartFrame()
Show a "starting application" frame? |
boolean |
isSilentInstall()
Determines if the user should be prompted for the destination directory. |
boolean |
isSilentUpdate()
Determines if the user should be asked if an update is available. |
void |
replace(SrcFile oldSrcFile,
SrcFile newSrcFile)
Replaces a source file with another one. |
void |
setConfigFileUrl(java.lang.String configFileUrl)
Sets the URL of the configuration file (only used when lazyLoading=true). |
void |
setDescription(java.lang.String description)
Sets the short description of the application. |
void |
setDestPath(java.lang.String destPath)
Sets the local destination path where the files should be copied to. |
void |
setExitAfterExecute(boolean exitAfterExecute)
Sets whether the program should terminate after executing. |
void |
setFirstInstallation(boolean firstInstallation)
Determines if this is the first installation. |
void |
setIdFilename(java.lang.String id)
Sets the unique id filename for the application. |
void |
setJavaArgs(java.lang.String javaArgs)
Sets the command line arguments. |
void |
setJavaExe(java.lang.String javaExe)
Sets the Java executable. |
void |
setLazyLoading(boolean lazyLoading)
Sets the information if lazy loading is active. |
void |
setLocale(java.util.Locale locale)
Sets the locale to use. |
void |
setLocale(java.lang.String locale)
Sets the locale to use as a String. |
void |
setLogFilename(java.lang.String logFilename)
Sets the name and path of the log file. |
void |
setLookAndFeelClassName(java.lang.String lnfClassName)
Sets the name of the Look and Feel class. |
void |
setMsgFileUrl(java.lang.String msgFileUrl)
Sets the file containing the localized installation messages. |
void |
setShowStartFrame(boolean b)
Show a "starting application" frame? |
void |
setSilentInstall(boolean silentInstall)
Determines if the user should be prompted for the destination directory. |
void |
setSilentUpdate(boolean silentUpdate)
Determines if the user should be asked if an update is available. |
void |
setStartFrameDelaySeconds(int seconds)
Show the start frame for N seconds after application has started. |
void |
setTitle(java.lang.String title)
Sets the title of the application. |
void |
setVendor(java.lang.String vendor)
Sets the vendor information. |
void |
setVersion(java.lang.String version)
Sets the target application version. |
void |
setXmlEncoding(java.lang.String encoding)
Sets the encoding to use for XML out. |
boolean |
simpleAttributesEquals(java.lang.Object obj)
Determines if all simple attributes ( boolean, byte,
short, int, long, float, double,
char Boolean, Byte, Short,
Integer, Long, Float, Double,
Character and String ) of the object are equal to the
fields of the other object (using the Object.equals(Object)
method). |
java.lang.String |
toDebugString()
|
java.lang.String |
toStaticXML()
Returns the configuration as XML with all variables replaced with their values. |
java.lang.String |
toString()
|
java.lang.String |
toVarXML()
Returns the configuration as XML with no variables replaced. |
void |
writeToStaticXML(java.io.File configFile,
boolean backup)
Writes this configuration to an XML file with all variables replaced with their values. |
void |
writeToVarXML(java.io.File configFile,
boolean backup)
Writes this configuration to an XML file with no variables replaced. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Config()
| Method Detail |
|---|
public final java.lang.String getLookAndFeelClassName()
public final void setLookAndFeelClassName(java.lang.String lnfClassName)
lnfClassName - Full qualified Java LookAndFeel class name - System
LookAndFeel is used when null.public final boolean isExitAfterExecute()
System.exit(..)
true (DEFAULT) else false.public final void setExitAfterExecute(boolean exitAfterExecute)
exitAfterExecute - If the program should terminate with
System.exit(..) true (DEFAULT) else
false.public final java.io.File getDestDir()
null if check()
throws no exceptions.public final java.lang.String getDestPath()
public final void setDestPath(java.lang.String destPath)
destPath - Path - Cannot be nullpublic final java.lang.String getIdFilename()
null if
check() throws no exceptions.public final void setIdFilename(java.lang.String id)
id - Unique ID - Must be a valid filename on the target system - A
null value is not allowed!public final boolean isSilentInstall()
true else false.public final void setSilentInstall(boolean silentInstall)
silentInstall - If "destDir" should be used without asking the user
true else false.public final boolean isSilentUpdate()
true else false.public final void setSilentUpdate(boolean silentUpdate)
silentUpdate - If updates should be executed without asking the user
true else false.public final boolean isFirstInstallation()
true else
false.public final void setFirstInstallation(boolean firstInstallation)
firstInstallation - If this is the first installation true else
false.public final java.util.Locale getLocale()
null.public final void setLocale(java.util.Locale locale)
locale - Locale to set - A null value resets the property
to Locale.getDefault().public final void setLocale(java.lang.String locale)
locale - Locale "lang" or "lang,country" or "lang,country,variant" - A
null value resets the property to
Locale.getDefault().public final java.lang.String getMsgFileUrl()
null the internal default
messages will be used.public final java.net.URL getMsgFileURL()
MalformedURLException is wrapped into a
RuntimeException.
null the internal default
messages will be used.public final void setMsgFileUrl(java.lang.String msgFileUrl)
msgFileUrl - Message file URL - A null value will result in
usage of the internal default messages.
public final void check()
throws InvalidConfigException
InvalidConfigException - The configuration is not valid.public final MessagesWrapper getMessages()
public final boolean isLazyLoading()
true else
false.public final void setLazyLoading(boolean lazyLoading)
lazyLoading - To enable lazy loading true else
false (disable lazy loading)).public final java.util.Map getCmdLineOptions()
String pairs.public final java.lang.String getJavaArgs()
public final void setJavaArgs(java.lang.String javaArgs)
javaArgs - Arguments for the Java executable.public final java.lang.String getJavaExe()
public final void setJavaExe(java.lang.String javaExe)
javaExe - Java executable.public final java.lang.String getDescription()
public final void setDescription(java.lang.String description)
description - Description.public final java.lang.String getTitle()
public final void setTitle(java.lang.String title)
title - Title.public final java.lang.String getVendor()
public final void setVendor(java.lang.String vendor)
vendor - Vendor.public final java.util.List getSrcFiles()
SrcFile objects.public final java.util.List getMkDirs()
MkDir objects.public final java.util.List getSrcDirs()
SrcDir objects.public final java.lang.String getConfigFileUrl()
null.public final java.net.URL getConfigFileURL()
null.public final void setConfigFileUrl(java.lang.String configFileUrl)
configFileUrl - URL or null.public final java.lang.String getVersion()
null if not set.public final void setVersion(java.lang.String version)
version - Version or null.public final java.lang.String getXmlEncoding()
public final void setXmlEncoding(java.lang.String encoding)
encoding - Encoding like "ISO-8859-1" (default) or "UTF-8".public final boolean isShowStartFrame()
true (default) else
false.public final void setShowStartFrame(boolean b)
b - If a frame should be displayed true else
false.public final int getStartFrameDelaySeconds()
public final void setStartFrameDelaySeconds(int seconds)
seconds - Number of seconds.public final java.lang.String getLogFilename()
null.public final void setLogFilename(java.lang.String logFilename)
logFilename - Log filename - A null value will set the name to
"kickstart4j.log".
public final SrcFile findSrcFile(java.lang.String path,
java.lang.String filename)
throws SrcFileNotFoundException
path - Path - Cannot be null but empty.filename - Filename to find - Cannot be null.
null.
SrcFileNotFoundException - The file was not found.
public final SrcDir findSrcDir(java.lang.String path)
throws SrcDirNotFoundException
path - Path - Cannot be null but empty.
null.
SrcDirNotFoundException - The directory was not found.
public final void replace(SrcFile oldSrcFile,
SrcFile newSrcFile)
oldSrcFile - Source file to replace.newSrcFile - File to insert.public final java.lang.String toStaticXML()
public final java.lang.String toVarXML()
public final java.lang.String toString()
toString in class java.lang.Objectpublic final java.lang.String toDebugString()
toDebugString in interface org.fuin.utils4j.ToDebugStringCapable
public final void writeToVarXML(java.io.File configFile,
boolean backup)
throws java.io.IOException
configFile - Target file.backup - Create a backup if this file already exists (same filename but
with ".bak" extension).
java.io.IOException - Error writing the file.
public final void writeToStaticXML(java.io.File configFile,
boolean backup)
throws java.io.IOException
configFile - Target file.backup - Create a backup if this file already exists (same filename but
with ".bak" extension).
java.io.IOException - Error writing the file.public final boolean simpleAttributesEquals(java.lang.Object obj)
boolean, byte,
short, int, long, float, double,
char Boolean, Byte, Short,
Integer, Long, Float, Double,
Character and String ) of the object are equal to the
fields of the other object (using the Object.equals(Object)
method). No complex types like lists, maps or sub-objects will be
compared.
simpleAttributesEquals in interface SimpleAttributesEqualsCapableobj - Object to compare with. If null or not an
instance of this class then false will be
returned.
true else
false.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||