Writes the configuration to file.
@param f the file
@throws FileNotFoundException if the file does not exist, is a directory rather
than a regular file, or for some other reason cannot be opened for reading.
@throws IOException if an I/O problem occurs.
554472
void write(File f) throws FileNotFoundException, IOException {
		try (ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(f))) {
			os.writeObject(this);
		}
	}
1331006
public static FlacFile open(File f) throws IOException, FileNotFoundException {
        // Open, in a way that we can skip backwards a few bytes
        InputStream inp = new BufferedInputStream(new FileInputStream(f), 8);
        FlacFile file = open(inp);
        return file;
    }
485819
public static void createFile(String filePath) throws IOException {
    Path storagePath = Paths.get(filePath);
    Files.createDirectories(storagePath.getParent());
    Files.createFile(storagePath);
  }
602108
def write_to_file(self, f):
        """"""
        for section, values in self._values.iteritems():
            try:
                section_name, subsection_name = section
            except ValueError:
                (section_name, ) = section
                subsection_name = None
            if subsection_name is None:
                f.write("[%s]\n" % section_name)
            else:
                f.write("[%s \"%s\"]\n" % (section_name, subsection_name))
            for key, value in values.iteritems():
                f.write("%s = %s\n" % (key, _escape_value(value)))
9574
public void writeFile(String filePath, byte[] data) throws IOException
   {
      Object lock = retrieveLock(filePath);      
      synchronized (lock) 
      {
         IO.writeFile(filePath, data);
      }
   }
200513
protected void create(File file) throws IOException {
        if(!file.exists()) {
            File dir = file.getParentFile();
            if(dir.exists()) file.createNewFile();
            else if(dir.mkdirs()) file.createNewFile();
            else throw new IOException("Failed to create " + file.getAbsolutePath());
        }
        
        if(file.isDirectory()) {
            throw new IOException("Cannot open directory " + file.getAbsolutePath());
        }
    }
1177355
public static void write(final InputStream inputStream, final OutputStream outputStream)
		throws FileNotFoundException, IOException
	{
		int counter;
		final byte byteArray[] = new byte[FileConst.BLOCKSIZE];
		while ((counter = inputStream.read(byteArray)) != -1)
		{
			outputStream.write(byteArray, 0, counter);
		}
	}
979187
public static void writeInput(Configuration conf, Path inputDir) throws IOException {
        FileSystem fs = FileSystem.get(conf);

        if (fs.exists(inputDir)) {
            throw new IOException(String.format("Input directory '%s' exists - please remove and rerun this example", inputDir));
        }

        OutputStreamWriter writer = new OutputStreamWriter(fs.create(new Path(inputDir, "input.txt")));
        for (String name : EXAMPLE_NAMES) {
            writer.write(name);
        }
        IOUtils.closeStream(writer);
    }
209869
public void fileNotFound(File f) {
        if (!recentFiles.contains(f)) {
            throw new IllegalStateException("Well no wonder it wasn't found, its not in the list.");
        } else {
            recentFiles.remove(f);
        }

    }
1287290
public static void writeToFile(InputStream inputStream, File file) {
        try (InputStreamReader inputStreamReader = new InputStreamReader(inputStream)) {
            writeToFile(FileCopyUtils.copyToString(inputStreamReader), file, getDefaultCharset());
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to write file", e);
        }
    }
178749
public static void writeFile(File file, byte[] bytes) throws IOException {
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(file);
            fos.write(bytes);
        } finally {
            if (fos != null) {
                fos.close();
            }
        }
    }
953937
public void write(File file) throws Exception {
        try {
            FileOutputStream fos = new FileOutputStream(file);
            write(fos);
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
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 );
	}
114592
public void write(final File folder) throws IOException {
    try (final DataInputStream keyStream = entry.getKeyStream();
         final DataInputStream valueStream = entry.getValueStream();) {
      final String containerId = keyStream.readUTF();
      try (final Writer outputWriter = new OutputStreamWriter(
          new FileOutputStream(new File(folder, containerId + ".txt")), StandardCharsets.UTF_8)) {
        this.writeFiles(valueStream, outputWriter);
      }
    }
  }
560753
public void addOutputFile(String file) {
        if (file != null) {
            File f = new File(file);
            if (f.isDirectory()) {
                throw new IllegalArgumentException("output file parameter points to a directory, must be a file");
            } else if (f.exists() && !f.canWrite()) {
                throw new IllegalArgumentException(
                        "output file parameter points to a file we have no write permissions");
            }

            setOutputFile(f);
        }
    }
155479
public static void write(File file, String text, boolean append) throws IOException {
        FileWriter writer = new FileWriter(file, append);
        try {
            writer.write(text);
        } finally {
            writer.close();
        }
    }
417137
public static void writeConfigFile(String fileName, Class<?>[] classes, boolean sortClasses)
			throws SQLException, IOException {
		File rawDir = findRawDir(new File("."));
		if (rawDir == null) {
			System.err.println("Could not find " + RAW_DIR_NAME + " directory which is typically in the "
					+ RESOURCE_DIR_NAME + " directory");
		} else {
			File configFile = new File(rawDir, fileName);
			writeConfigFile(configFile, classes, sortClasses);
		}
	}