Modifier and Type | Field and Description |
---|---|
private HashMap |
alreadyWrittenFiles
Files which are always written into the container file
|
private File |
baseFile
Base file name of all jar files.
|
private PackCompressor |
compressor
The compression format to be used for pack compression
|
private List |
customDataList
The ordered custom actions informations.
|
private GUIPrefs |
guiPrefs
Gui preferences of instatller.
|
private Set |
includedJarURLs
Jar file URLs who's contents will be copied into the installer.
|
private Info |
info
Basic installer info.
|
private Map |
installerResourceURLMap
The langpack URLs keyed by ISO3 name.
|
private List |
langpackNameList
The ordered langpack ISO3 names.
|
private PackagerListener |
listener
The listeners.
|
private boolean |
packJarsSeparate
Each pack is created in a separte jar if webDirURL is non-null.
|
private List |
packsList
The ordered packs informations (as PackInfo objects).
|
private List |
panelList
The ordered panels informations.
|
private JarOutputStream |
primaryJarStream
Executable zipped output stream.
|
static String |
SKELETON_SUBPATH
Path to the skeleton installer.
|
private Properties |
variables
The variables used in the project
|
Constructor and Description |
---|
Packager()
The constructor.
|
Packager(String compr_format)
Extended constructor.
|
Packager(String compr_format,
int compr_level)
Extended constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomJar(CustomData ca,
URL url)
Add a custom data like custom actions, where order is important.
|
void |
addJarContent(URL jarURL)
Adds a jar file content to the installer.
|
void |
addJarContent(URL jarURL,
List files)
Adds a jar file content to the installer.
|
void |
addLangPack(String iso3,
URL xmlURL,
URL flagURL)
Adds a language pack.
|
void |
addNativeLibrary(String name,
URL url)
Adds a native library.
|
void |
addNativeUninstallerLibrary(CustomData data)
Marks a native library to be added to the uninstaller.
|
void |
addPack(PackInfo pack)
Adds a pack, order is mostly irrelevant.
|
void |
addPanelJar(Panel panel,
URL jarURL)
Add a panel, where order is important.
|
void |
addResource(String resId,
URL url)
Adds a resource.
|
private long |
copyStream(InputStream in,
OutputStream out)
Copies all the data from the specified input stream to the specified output stream.
|
private void |
copyZip(ZipInputStream zin,
org.apache.tools.zip.ZipOutputStream out)
Copies contents of one jar to another.
|
private void |
copyZip(ZipInputStream zin,
org.apache.tools.zip.ZipOutputStream out,
List files)
Copies specified contents of one jar to another.
|
void |
createInstaller(File primaryFile)
Create the installer, beginning with the specified jar.
|
PackCompressor |
getCompressor()
Returns the current pack compressor
|
private JarOutputStream |
getJarOutputStream(String name)
Return a stream for the next jar.
|
PackagerListener |
getPackagerListener()
Get the PackagerListener.
|
List |
getPacksList()
Gets the packages list
|
Properties |
getVariables()
Allows access to add, remove and update the variables for the project, which are maintained
in the packager.
|
private void |
sendMsg(String job)
Dispatches a message to the listeners.
|
private void |
sendMsg(String job,
int priority)
Dispatches a message to the listeners at specified priority.
|
private void |
sendStart()
Dispatches a start event to the listeners.
|
private void |
sendStop()
Dispatches a stop event to the listeners.
|
void |
setGUIPrefs(GUIPrefs prefs)
Sets the GUI preferences.
|
void |
setInfo(Info info)
Sets the informations related to this installation.
|
void |
setPackagerListener(PackagerListener listener)
Adds a listener.
|
private void |
writeIncludedJars()
Copy included jars to primary jar.
|
private void |
writeInstallerObject(String entryName,
Object object)
Write an arbitrary object to primary jar.
|
private void |
writeInstallerResources()
Write the data referenced by URL to primary jar.
|
private void |
writePacks()
Write Packs to primary jar or each to a separate jar.
|
private void |
writeSkeletonInstaller()
Write skeleton installer to primary jar.
|
public static final String SKELETON_SUBPATH
private JarOutputStream primaryJarStream
private Properties variables
private List langpackNameList
private List customDataList
private Map installerResourceURLMap
private Set includedJarURLs
private boolean packJarsSeparate
private PackagerListener listener
private PackCompressor compressor
private HashMap alreadyWrittenFiles
public Packager() throws CompilerException
CompilerException
public Packager(String compr_format) throws CompilerException
compr_format
- Compression format to be used for packs
compression format (if supported)CompilerException
public Packager(String compr_format, int compr_level) throws CompilerException
compr_format
- Compression format to be used for packscompr_level
- Compression level to be used with the chosen
compression format (if supported)CompilerException
public void createInstaller(File primaryFile) throws Exception
Exception
public PackagerListener getPackagerListener()
public void setPackagerListener(PackagerListener listener)
listener
- The listener.private void sendMsg(String job)
job
- The job description.private void sendMsg(String job, int priority)
job
- The job description.priority
- The message priority.private void sendStart()
private void sendStop()
public void setInfo(Info info) throws Exception
info
- The info section.Exception
- Description of the Exceptionpublic void setGUIPrefs(GUIPrefs prefs)
prefs
- The new gUIPrefs valueException
- Description of the Exceptionpublic Properties getVariables()
public void addPanelJar(Panel panel, URL jarURL)
public void addCustomJar(CustomData ca, URL url)
ca
- custom action objecturl
- the URL to include oncepublic void addPack(PackInfo pack)
pack
- contains all the files and items that go with a packpublic List getPacksList()
public void addLangPack(String iso3, URL xmlURL, URL flagURL)
iso3
- The ISO3 code.xmlURL
- The location of the xml local infoflagURL
- The location of the flag image resourceException
- Description of the Exceptionpublic void addResource(String resId, URL url)
resId
- The resource Id.url
- The location of the dataException
- Description of the Exceptionpublic void addNativeLibrary(String name, URL url) throws Exception
name
- The native library name.url
- The url to get the data from.Exception
- Description of the Exceptionpublic void addJarContent(URL jarURL)
jarURL
- The url of the jar to add to the installer. We use a URL so the jar may be
nested within another.public void addJarContent(URL jarURL, List files)
jarURL
- The url of the jar to add to the installer. We use a URL so the jar may be
nested within another.public void addNativeUninstallerLibrary(CustomData data)
data
- the describing custom action data objectprivate void writeSkeletonInstaller() throws IOException
IOException
private void writeInstallerObject(String entryName, Object object) throws IOException
IOException
private void writeInstallerResources() throws IOException
IOException
private void writeIncludedJars() throws IOException
IOException
private void writePacks() throws Exception
Exception
private JarOutputStream getJarOutputStream(String name) throws IOException
IOException
private void copyZip(ZipInputStream zin, org.apache.tools.zip.ZipOutputStream out) throws IOException
TODO: it would be useful to be able to keep signature information from signed jar files, can we combine manifests and still have their content signed?
IOException
copyStream(InputStream, OutputStream)
private void copyZip(ZipInputStream zin, org.apache.tools.zip.ZipOutputStream out, List files) throws IOException
TODO: it would be useful to be able to keep signature information from signed jar files, can we combine manifests and still have their content signed?
IOException
copyStream(InputStream, OutputStream)
private long copyStream(InputStream in, OutputStream out) throws IOException
in
- the input stream to readout
- the output stream to writeIOException
- if an I/O error occurspublic PackCompressor getCompressor()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses