Template method responsible for file compression checks, file creation, and
delegation to specific strategy implementations.

@param backupFile
The file to be compressed.
@param properties
The appender's configuration.
546265
final void compress(final File backupFile,
      final AppenderRollingProperties properties) {
    if (this.isCompressed(backupFile)) {
      LogLog.debug("Backup log file " + backupFile.getName()
          + " is already compressed");
      return; // try not to do unnecessary work
    }
    final long lastModified = backupFile.lastModified();
    if (0L == lastModified) {
      LogLog.debug("Backup log file " + backupFile.getName()
          + " may have been scavenged");
      return; // backup file may have been scavenged
    }
    final File deflatedFile = this.createDeflatedFile(backupFile);
    if (deflatedFile == null) {
      LogLog.debug("Backup log file " + backupFile.getName()
          + " may have been scavenged");
      return; // an error occurred creating the file
    }
    if (this.compress(backupFile, deflatedFile, properties)) {
      deflatedFile.setLastModified(lastModified);
      FileHelper.getInstance().deleteExisting(backupFile);
      LogLog.debug("Compressed backup log file to " + deflatedFile.getName());
    } else {
      FileHelper.getInstance().deleteExisting(deflatedFile); // clean up
      LogLog
          .debug("Unable to compress backup log file " + backupFile.getName());
    }
  }
52417
private void writePropertyFile()
	{
	    try
	    {
	    	java.util.Properties props = new java.util.Properties();
			
	    	MultimediaContainerManager.getContainerConfigs(props);
			props.setProperty(PROPERTY_SEARCHPATH, searchPath);
			props.setProperty(PROPERTY_EXPORTPATH, exportPath);
			props.setProperty(PROPERTY_LOOKANDFEEL, uiClassName);
			props.setProperty(PROPERTY_SYSTEMTRAY, Boolean.toString(useSystemTray));
			props.setProperty(PROPERTY_VOLUME_VALUE, Float.toString(currentVolume));
			props.setProperty(PROPERTY_BALANCE_VALUE, Float.toString(currentBalance));
			for (int i=0; i<PROPERTY_LASTLOADED_MAXENTRIES; i++)
			{
				URL element = lastLoaded.get(i);
				if (element!=null)
					props.setProperty(PROPERTY_LASTLOADED+'.'+i, element.toString());
			}
			props.setProperty(PROPERTY_EFFECTS_PASSTHROUGH, Boolean.toString(isDSPEnabled()));

			props.setProperty(PROPERTY_MAINDIALOG_POS, Helpers.getStringFromPoint(getLocation()));
			props.setProperty(PROPERTY_MAINDIALOG_SIZE, Helpers.getStringFromDimension(getSize()));
			props.setProperty(PROPERTY_SETUPDIALOG_POS, Helpers.getStringFromPoint(getPlayerSetUpDialog().getLocation()));
			props.setProperty(PROPERTY_SETUPDIALOG_SIZE, Helpers.getStringFromDimension(getPlayerSetUpDialog().getSize()));
			props.setProperty(PROPERTY_SETUPDIALOG_VISABLE, Boolean.toString(getPlayerSetUpDialog().isVisible()));
			props.setProperty(PROPERTY_PROPERTIESDIALOG_POS, Helpers.getStringFromPoint(getModInfoDialog().getLocation()));
			props.setProperty(PROPERTY_PROPERTIESDIALOG_SIZE, Helpers.getStringFromDimension(getModInfoDialog().getSize()));
			props.setProperty(PROPERTY_PROPERTIESDIALOG_VISABLE, Boolean.toString(getModInfoDialog().isVisible()));
			props.setProperty(PROPERTY_PLAYLISTDIALOG_POS, Helpers.getStringFromPoint(getPlaylistDialog().getLocation()));
			props.setProperty(PROPERTY_PLAYLISTDIALOG_SIZE, Helpers.getStringFromDimension(getPlaylistDialog().getSize()));
			props.setProperty(PROPERTY_PLAYLIST_VISABLE, Boolean.toString(getPlaylistDialog().isVisible()));
			props.setProperty(PROPERTY_EFFECTDIALOG_POS, Helpers.getStringFromPoint(getEffectDialog().getLocation()));
			props.setProperty(PROPERTY_EFFECTDIALOG_SIZE, Helpers.getStringFromDimension(getEffectDialog().getSize()));
			props.setProperty(PROPERTY_EFFECT_VISABLE, Boolean.toString(getEffectDialog().isVisible()));
			if (currentEqualizer!=null)
			{
				props.setProperty(PROPERTY_EQUALIZER_ISACTIVE, Boolean.toString(currentEqualizer.isActive()));
				props.setProperty(PROPERTY_EQUALIZER_PREAMP, Float.toString(currentEqualizer.getPreAmpDB()));
				for (int i=0; i<currentEqualizer.getBandCount(); i++)
				{
					props.setProperty(PROPERTY_EQUALIZER_BAND_PREFIX + Integer.toString(i), Float.toString(currentEqualizer.getBand(i)));
				}
			}
			if (currentPitchShift!=null)
			{
				props.setProperty(PROPERTY_PITCHSHIFT_ISACTIVE, Boolean.toString(currentPitchShift.isActive()));
				props.setProperty(PROPERTY_PITCHSHIFT_PITCH, Float.toString(currentPitchShift.getPitchScale()));
				props.setProperty(PROPERTY_PITCHSHIFT_SAMPLESCALE, Float.toString(currentPitchShift.getSampleScale()));
				props.setProperty(PROPERTY_PITCHSHIFT_FRAMESIZE, Integer.toString(currentPitchShift.getFftFrameSize()));
				props.setProperty(PROPERTY_PITCHSHIFT_OVERSAMPLING, Integer.toString(currentPitchShift.getFFTOversampling()));
			}

			File propertyFile = new File(propertyFilePath + File.separator + PROPERTYFILENAME);
	        if (propertyFile.exists())
	        {
	        	boolean ok = propertyFile.delete();
	        	if (ok) ok = propertyFile.createNewFile();
	        	if (!ok) Log.error("Could not create property file: " + propertyFile.getCanonicalPath());
	        }
	        java.io.FileOutputStream fos = null;
	        try
	        {
		    	fos = new java.io.FileOutputStream(propertyFile);
			    props.store(fos, WINDOW_TITLE);
	        }
	        finally
	        {
	        	if (fos!=null) try { fos.close(); } catch (IOException ex) { Log.error("IGNORED", ex); }
	        }
	    }
	    catch (Throwable ex)
	    {
			Log.error("MainForm]", ex);
	    }
	}
153850
public void setPropertyFile(String... thePropertyFile) {
		Validate.notNull(thePropertyFile, "Property file can not be null");
		myPropertyFile = Arrays.asList(thePropertyFile);
	}
345307
public void configure(String filename, boolean isExternalFile) {
        try {
            Properties properties;
            InputStream inputStream;

            if (!isExternalFile) {
                Resources resources = context.getResources();
                AssetManager assetManager = resources.getAssets();

                inputStream = assetManager.open(filename);
            } else {
                inputStream = new FileInputStream(filename);
            }

            properties = loadProperties(inputStream);
            inputStream.close();

            startConfiguration(properties);
        } catch (IOException e) {
            Log.e(TAG, "Failed to open file. " + filename + " " + e);
        }
    }
94786
public void init(Object env, Map<String,Object> properties, Object applet)
    {
        super.init(env, properties, applet);
        if (this.registerUniqueApplication(BACKUP_QUEUE_NAME, BACKUP_QUEUE_TYPE) != Constants.NORMAL_RETURN)
        {
            this.free();    // Don't start this application (It's already running somewhere)
            return;
        }
        MessageManager messageManager = RemoteMessageManager.getMessageManager(this);
        BaseMessageReceiver receiver = (BaseMessageReceiver)messageManager.getMessageQueue(BACKUP_QUEUE_NAME, BACKUP_QUEUE_TYPE).getMessageReceiver();
        
        m_messageFilter = new BaseMessageFilter(BACKUP_QUEUE_NAME, BACKUP_QUEUE_TYPE, this, null);
        new BaseMessageListener(m_messageFilter)    // Listener added to filter.
        {
            public int handleMessage(BaseMessage message)
            {
                Object objMessage = message.get(MESSAGE_PARAM);
                backupTrxLog(objMessage);
                return Constants.NORMAL_RETURN;
            }
        };
        receiver.addMessageFilter(m_messageFilter);
    }
237366
private void saveProperties(Properties prop) throws FileNotFoundException, IOException {
		FileOutputStream fos = new FileOutputStream(getPropertiesFile());
		try {
			prop.store(fos, null);
		} finally {
			fos.close();
		}
	}
489943
@SuppressWarnings("resource")
	public static ISynchronizationPoint<IOException> savePropertiesFile(Properties properties, File file, Charset charset, byte priority) {
		FileIO.ReadWrite io = new FileIO.ReadWrite(file, priority);
		AsyncWork<Void,IOException> resize = io.setSizeAsync(0);
		SynchronizationPoint<IOException> result = new SynchronizationPoint<>();
		resize.listenInline(new Runnable() {
			@Override
			public void run() {
				if (resize.hasError()) {
					result.error(resize.getError());
					io.closeAsync();
					return;
				}
				savePropertiesFile(properties, io, charset, priority, true).listenInline(result);
			}
		});
		return result;
	}
1078709
private static Properties loadProperties(String propertiesFile) {
    Properties properties = new Properties();
    try (InputStream is = new FileInputStream(propertiesFile)) {
      properties.load(is);
    } catch (IOException e) {
      throw new RuntimeException("failed to load properties", e);
    }
    return properties;
  }
1210779
public static FrameworkProjectConfig create(
            final String name,
            final File propertyFile,
            final Properties properties,
            final IFilesystemFramework filesystemFramework
    )
    {

        if (!propertyFile.exists() ) {
            generateProjectPropertiesFile(name, propertyFile, false, properties, true);
        }
        return create(name, propertyFile, filesystemFramework);
    }
436519
public void setBackupPlansList(java.util.Collection<BackupPlansListMember> backupPlansList) {
        if (backupPlansList == null) {
            this.backupPlansList = null;
            return;
        }

        this.backupPlansList = new java.util.ArrayList<BackupPlansListMember>(backupPlansList);
    }
1233761
public void setBackupSelectionsList(java.util.Collection<BackupSelectionsListMember> backupSelectionsList) {
        if (backupSelectionsList == null) {
            this.backupSelectionsList = null;
            return;
        }

        this.backupSelectionsList = new java.util.ArrayList<BackupSelectionsListMember>(backupSelectionsList);
    }
220390
public static void compress(File dir, File zipFile) throws IOException {

    FileOutputStream fos = new FileOutputStream(zipFile);
    ZipOutputStream zos = new ZipOutputStream(fos);

    recursiveAddZip(dir, zos, dir);

    zos.finish();
    zos.close();

  }
474714
public void setBackupSummaries(java.util.Collection<BackupSummary> backupSummaries) {
        if (backupSummaries == null) {
            this.backupSummaries = null;
            return;
        }

        this.backupSummaries = new java.util.ArrayList<BackupSummary>(backupSummaries);
    }
734009
public void restore(BackupMetaData backup, File destinationFile) throws Exception
    {
        File tempFile = File.createTempFile("exhibitor-backup", ".tmp");
        OutputStream out = new FileOutputStream(tempFile);
        InputStream in = null;
        try {
            backupProvider.get().downloadBackup(exhibitor, backup, out, getBackupConfig());
            CloseableUtils.closeQuietly(out);
            out = null;

            out = new FileOutputStream(destinationFile);
            in = new GZIPInputStream(new FileInputStream(tempFile));

            ByteStreams.copy(in, out);
        }
        finally {
            CloseableUtils.closeQuietly(in);
            CloseableUtils.closeQuietly(out);
            if (!tempFile.delete()) {
                exhibitor.getLog().add(ActivityLog.Type.ERROR, "Could not delete temp file (for restore): " + tempFile);
            }
        }
    }
1111562
@Deprecated
    public static void validatePropertiesFile(Properties repoProperties) throws InstallException {
        List<String> repoList = new ArrayList<String>();
        List<String> duplicateRepoList = new ArrayList<String>();

        // Retrieves the Repository Properties file
        File repoPropertiesFile = new File(getRepoPropertiesFileLocation());

        if (repoPropertiesFile.exists() && repoPropertiesFile.isFile()) {
            logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_VALIDATING", getRepoPropertiesFileLocation()));
            //Load repository properties
            FileInputStream repoPropertiesInput = null;
            BufferedReader repoPropertiesReader = null;
            try {
                repoPropertiesInput = new FileInputStream(repoPropertiesFile);
                repoPropertiesReader = new BufferedReader(new InputStreamReader(repoPropertiesInput));
                String line;
                String repoName;
                //Validate configurations in the repositories.properties file
                while ((line = repoPropertiesReader.readLine()) != null) {
                    String keyValue[] = line.split(EQUALS);
                    if (!line.startsWith(COMMENT_PREFIX) && keyValue.length > 1 && keyValue[0].endsWith(URL_SUFFIX)) {
                        repoName = keyValue[0].substring(0, keyValue[0].length() - URL_SUFFIX.length());
                        //Check for empty repository names
                        if (repoName.isEmpty()) {
                            logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_NO_REPO_NAME", line));
                            continue;
                        }
                        //Check for duplicate entries
                        if (repoList.contains(repoName)) {
                            logger.log(Level.FINE,
                                       Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DUPLICATE_REPO_NAMES", repoName, duplicateRepoList.get(repoList.indexOf(repoName))));
                            duplicateRepoList.remove(repoList.indexOf(repoName));
                            repoList.remove(repoName);
                        }
                        repoList.add(repoName);
                        duplicateRepoList.add(line);
                    }
                }
                //Check for invalid value set for default repository
                String wlpEnabled = repoProperties.getProperty(USE_WLP_REPO);
                wlpEnabled = wlpEnabled == null ? null : wlpEnabled.trim();
                if (wlpEnabled != null && !wlpEnabled.equalsIgnoreCase("false") && !wlpEnabled.equalsIgnoreCase("true"))
                    logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DEFAULT_INVALID_VALUE", wlpEnabled));
            } catch (IOException e) {
                throw new InstallException(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("ERROR_TOOL_REPOSITORY_PROPS_NOT_LOADED",
                                                                                          getRepoPropertiesFileLocation()), InstallException.IO_FAILURE);
            } finally {
                InstallUtils.close(repoPropertiesInput);
                InstallUtils.close(repoPropertiesReader);
            }
            logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_VALIDATION_DONE"));
        }
    }
1144493
static void generateProjectPropertiesFile(
            final String name,
            final File destfile,
            final boolean overwrite,
            final Properties properties,
            boolean addDefaultProps
    )
    {

        generateProjectPropertiesFile(name, destfile, overwrite, properties, false, null, addDefaultProps);
    }
316616
public String successfulFileUpload(File file, Properties properties)
	{
		String strHTML = super.successfulFileUpload(file, properties);
		strHTML = "<a href=\"/\">Home</a>" + RETURN + strHTML;
			// Create a properties object to describe where to move these files
		String strPath = file.getPath();
			// May as well use the passed-in properties object (No properties are usable)
		properties.setProperty(SOURCE_PARAM, "Zip");
		properties.setProperty(ZIPIN_FILENAME_PARAM, strPath);	// Source jar/zip

		properties.setProperty(DESTINATION, "Filesystem");
		String strDest = properties.getProperty(DESTINATION, "C:\\TEMP\\");
		properties.setProperty(DEST_ROOT_PATHNAME_PARAM, strDest);	// Destination jar/zip
			// Queue up the task to move them!
		org.jbundle.jbackup.Scanner scanner = new org.jbundle.jbackup.Scanner(properties);
		new Thread(scanner).start();
		
		strHTML += "<p>Unjar thread successfully started</p>";
		return strHTML;
	}