Java Path File Write nio writeUntouchedImage(Path sourceFile, Path destFile)

Here you can find the source of writeUntouchedImage(Path sourceFile, Path destFile)

Description

writes unchanged file to disk.

License

Open Source License

Parameter

Parameter Description
sourceFile - file to read from
destFile - file to write to

Exception

Parameter Description
IOException when IO Exception occurs.

Declaration

private static void writeUntouchedImage(Path sourceFile, Path destFile) throws IOException 

Method Source Code

//package com.java2s;
/*/* w  w  w  .j  a  v a 2s .c om*/
 * CKFinder
 * ========
 * http://cksource.com/ckfinder
 * Copyright (C) 2007-2015, CKSource - Frederico Knabben. All rights reserved.
 *
 * The software, this file and its contents are subject to the CKFinder
 * License. Please read the license.txt file before using, installing, copying,
 * modifying or distribute this file or part of its contents. The contents of
 * this file is part of the Source Code of CKFinder.
 */

import java.io.IOException;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;

public class Main {
    /**
     * writes unchanged file to disk.
     *
     * @param sourceFile - file to read from
     * @param destFile - file to write to
     * @throws IOException when IO Exception occurs.
     */
    private static void writeUntouchedImage(Path sourceFile, Path destFile) throws IOException {
        Files.copy(sourceFile, destFile, StandardCopyOption.REPLACE_EXISTING);
    }
}

Related

  1. writeToFile(final Path file, final String text)
  2. writeToFile(Path file, boolean isAppendingToFile, List lines)
  3. writeToFile(Path path, String string)
  4. writeToFile(String log, Path path)
  5. writeToFile(String s, Path file)