Store only those properties defined at this local level

@param file The file to write to
@throws IOException If the file can't be found or there is an io error
191311
public void storeLocal(final File file) throws IOException {
    final BufferedOutputStream out =
        new BufferedOutputStream(new FileOutputStream(file));
    try {
      storeLocal(out);
    } finally {
      out.close();
    }
  }
112555
public void storeFlattened(File file) throws IOException {
        BufferedOutputStream out = new BufferedOutputStream(
                new FileOutputStream(file));
        try {
            storeFlattened(out);
        } finally {
            out.close();
        }
    }
949267
public static Properties load(File file) throws IOException {
        if (file.isFile()) {
            FileInputStream fis = null;
            try {
                Properties headers = new Properties();
                fis = new FileInputStream(file);
                headers.load(fis);
                return headers;
            } finally {
                IOUtils.closeQuietly(fis);
            }
        }
        return new Properties();
    }
51878
public static void save(Object o, File file) {
        try {
            FileOutputStream fos = new FileOutputStream(file);
            ObjectOutputStream outStream = 
                new ObjectOutputStream(new BufferedOutputStream(fos));
            outStream.writeObject(o);
            outStream.close();
        } catch (IOException ioe) {
            throw new IOError(ioe);
        }
    }
124057
public void saveProperties(CmsParameterConfiguration properties, String file, boolean backup) {

        if (new File(m_configRfsPath + file).isFile()) {
            String backupFile = file + CmsConfigurationManager.POSTFIX_ORI;
            String tempFile = file + ".tmp";

            m_errors.clear();

            if (backup) {
                // make a backup copy
                copyFile(file, FOLDER_BACKUP + backupFile);
            }

            //save to temporary file
            copyFile(file, tempFile);

            // save properties
            save(properties, tempFile, file, null);

            // delete temp file
            File temp = new File(m_configRfsPath + tempFile);
            temp.delete();
        } else {
            m_errors.add("No valid file: " + file + "\n");
        }

    }
1296652
public static void saveFile(final File file, byte[] fileContents) throws IOException {
        if (file.isDirectory()) {
            throw new IOException("Unable to save file contents as a directory.");
        }

        final FileOutputStream fos = new FileOutputStream(file);
        fos.write(fileContents);
        fos.flush();
        fos.close();
    }
701158
public void setFile(String file) {

        if (file != null) {
            m_file = file.toLowerCase();
        } else {
            m_file = null;
        }
    }
641328
private void buildupPropertiesBundles(final File file) throws IOException {
		File[] files = file.listFiles();

		for (File f : files) {
			if (f.getName().endsWith("properties")) {
				String bundleName = f.getName().substring(0,
						f.getName().indexOf("properties") - 1);

				LOG.info("Loading: " + bundleName);
				ResourceBundle bundle = new PropertyResourceBundle(
						new FileInputStream(f));
				bundles.put(bundleName, bundle);
			}
		}
	}
1071514
public static void loadProps(Properties props, File file) throws IOException {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(file);
            props.load(fis);
        } finally {
            if (null != fis) {
                fis.close();
            }
        }
    }
1357618
public static void writeProperties2File(final String filename, final Properties properties)
		throws IOException
	{
		// Write properties to the file.
		try (FileOutputStream fos = new FileOutputStream(filename))
		{
			properties.store(fos, null);
		}
	}
1252451
private Properties readPropertyFile(String file) throws IOException {
        String fileName = file.startsWith("/") ? file : "/" + file;
        LOGGER.info("Reading properties from: " + fileName + ". Will try classpath, then file system.");
        return Util.readProperties(fileName);
    }
1158146
public void save(String file) throws IOException,FileNotFoundException
	{
		ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
		oos.writeObject(blockerNames);
		oos.writeObject(datasetNames);
		oos.writeObject(learnerNames);
		oos.writeObject(expt);
		oos.close();
	}
95447
public static void writePropertiesFile( Properties properties, File file ) throws IOException {

		OutputStream out = null;
		try {
			out = new FileOutputStream( file );
			properties.store( out, "" );

		} finally {
			closeQuietly( out );
		}
	}
1143318
public static void setFileProperties (final File file, final String contentType) throws IOException, FrameworkException {

		final java.io.File fileOnDisk = file.getFileOnDisk(false);
		final PropertyMap map         = new PropertyMap();

		map.put(StructrApp.key(File.class, "contentType"), contentType != null ? contentType : FileHelper.getContentMimeType(fileOnDisk, file.getProperty(File.name)));
		map.put(StructrApp.key(File.class, "size"),        FileHelper.getSize(fileOnDisk));
		map.put(StructrApp.key(File.class, "version"),     1);

		map.putAll(getChecksums(file, fileOnDisk));

		file.setProperties(file.getSecurityContext(), map);
	}
106291
public static void save( File f, Application app ) throws IOException {

		Properties properties = new Properties();
		if( ! Utils.isEmptyOrWhitespaces( app.getDisplayName()))
			properties.setProperty( APPLICATION_NAME, app.getDisplayName());

		if( ! Utils.isEmptyOrWhitespaces( app.getDescription()))
			properties.setProperty( APPLICATION_DESCRIPTION, app.getDescription());

		if( app.getTemplate() != null ) {
			if( ! Utils.isEmptyOrWhitespaces( app.getTemplate().getName()))
				properties.setProperty( APPLICATION_TPL_NAME, app.getTemplate().getName());

			if( ! Utils.isEmptyOrWhitespaces( app.getTemplate().getVersion()))
				properties.setProperty( APPLICATION_TPL_VERSION, app.getTemplate().getVersion());
		}

		Utils.writePropertiesFile( properties, f );
	}
299240
public static void storeProperties(Properties p, File file) throws IOException {
        FileOutputStream fos = new FileOutputStream(file);
        try {
            p.store(fos,"");
        } finally {
            ArchiveUtils.closeQuietly(fos);
        }
    }
815695
public void loadSettings(String file) throws IOException {
        Path path = Paths.get(file);

        try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)) {
            Properties props = new Properties();
            props.load(reader);
            loadSettings(props);
        }
    }