Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* $Id:$
* IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
*
* http://izpack.org/
* http://izpack.codehaus.org/
*
* Copyright 2007 Klaus Bartz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.izforge.izpack.compiler.packager.impl;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.jar.Manifest;
import java.util.zip.ZipInputStream;
import com.izforge.izpack.api.data.DynamicInstallerRequirementValidator;
import com.izforge.izpack.api.data.DynamicVariable;
import com.izforge.izpack.api.data.GUIPrefs;
import com.izforge.izpack.api.data.Info;
import com.izforge.izpack.api.data.InstallerRequirement;
import com.izforge.izpack.api.data.Panel;
import com.izforge.izpack.api.rules.Condition;
import com.izforge.izpack.compiler.compressor.PackCompressor;
import com.izforge.izpack.compiler.data.CompilerData;
import com.izforge.izpack.compiler.listener.PackagerListener;
import com.izforge.izpack.compiler.merge.CompilerPathResolver;
import com.izforge.izpack.compiler.merge.PanelMerge;
import com.izforge.izpack.compiler.packager.IPackager;
import com.izforge.izpack.compiler.stream.JarOutputStream;
import com.izforge.izpack.data.CustomData;
import com.izforge.izpack.data.PackInfo;
import com.izforge.izpack.merge.MergeManager;
import com.izforge.izpack.merge.resolve.MergeableResolver;
import com.izforge.izpack.util.FileUtil;
import com.izforge.izpack.util.IoHelper;
/**
* The packager base class. The packager interface IPackager is used by the compiler to put files into an installer, and
* create the actual installer files. The packager implementation depends on different requirements (e.g. normal packager versus multi volume packager).
* This class implements the common used method which can also be overload as needed.
*
* @author Klaus Bartz
*/
public abstract class PackagerBase implements IPackager
{
/**
* Path to resources in jar
*/
public static final String RESOURCES_PATH = "resources/";
/**
* Variables.
*/
private final Properties properties;
/**
* The listeners.
*/
private final PackagerListener listener;
/**
* Executable zipped output stream. First to open, last to close.
* Attention! This is our own JarOutputStream, not the java standard!
*/
private final JarOutputStream installerJar;
/**
* The merge manager.
*/
private final MergeManager mergeManager;
/**
* The path resolver.
*/
private final CompilerPathResolver pathResolver;
/**
* The mergeable resolver.
*/
private final MergeableResolver mergeableResolver;
/**
* The compression format to be used for pack compression.
*/
private final PackCompressor compressor;
/**
* The compiler data.
*/
private final CompilerData compilerData;
/**
* Installer requirements.
*/
private List installerRequirements;
/**
* Basic installer info.
*/
private Info info;
/**
* GUI preferences.
*/
private GUIPrefs guiPrefs;
/**
* The ordered panels.
*/
protected List panelList = new ArrayList();
/**
* The ordered pack information.
*/
private final List packsList = new ArrayList();
/**
* The ordered language pack locale names.
*/
private List langpackNameList = new ArrayList();
/**
* The ordered custom actions information.
*/
private List customDataList = new ArrayList();
/**
* The language pack URLs keyed by locale name (e.g. de_CH).
*/
private final Map installerResourceURLMap = new HashMap();
/**
* The conditions.
*/
private final Map rules = new HashMap();
/**
* Dynamic variables.
*/
private final Map> dynamicVariables = new HashMap>();
/**
* Dynamic conditions.
*/
private List dynamicInstallerRequirements =
new ArrayList();
/**
* Jar file URLs who's contents will be copied into the installer.
*/
private Set