Java Path File Write nio newBufferedWriter(Path path)

Here you can find the source of newBufferedWriter(Path path)

Description

new Buffered Writer

License

Open Source License

Declaration

public static BufferedWriter newBufferedWriter(Path path) throws IOException 

Method Source Code

//package com.java2s;
/*//from  ww  w . ja  v a2 s.  co  m
 *        _____                     __    _     _   _____ _
 *       |   __|___ ___ _ _ ___ ___|  |  |_|___| |_|  _  | |_ _ ___
 *       |__   | -_|  _| | | -_|  _|  |__| |_ -|  _|   __| | | |_ -|
 *       |_____|___|_|  \_/|___|_| |_____|_|___|_| |__|  |_|___|___|
 *
 *  ServerListPlus - http://git.io/slp
 *  Copyright (c) 2014, Minecrell <https://github.com/Minecrell>
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.BufferedWriter;
import java.io.IOException;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static final Charset CHARSET = StandardCharsets.UTF_8;

    public static BufferedWriter newBufferedWriter(Path path) throws IOException {
        return Files.newBufferedWriter(path, CHARSET);
    }
}

Related

  1. canWrite(Path path)
  2. checkFilePermissions(final String filepath, final boolean canRead, final boolean canWrite)
  3. compareTable(final String table, final List d1, final List d2, final BufferedWriter errors)
  4. isWritePermission(Path p)
  5. newBufferedWriter(Path path, OpenOption... options)
  6. newGzipBufferedWriter(Path path)
  7. okayToOverwrite(Path file)
  8. overwriteFile(final String newFilePath, final String oldFilePath)