mainPlugin/src/main/java/org/simpleyaml/configuration/file/YamlFile.java
/**
     * Copy this configuration file to another file, without deleting configuration file.
     *
     * @param file destination file (mustn't be a directory)
     * @throws FileNotFoundException    if configuration file is not found as source to copy
     * @throws IllegalArgumentException if path is a directory or it is null
     * @throws IOException              if there I/O error occurs copying file
     */
Copy this configuration file to another file, without deleting configuration file.
@param file destination file (mustn't be a directory)
@throws FileNotFoundException    if configuration file is not found as source to copy
@throws IllegalArgumentException if path is a directory or it is null
@throws IOException              if there I/O error occurs copying file
Copy this configuration file to another file without deleting configuration file . @param file destination file ( mustn ' t be a directory ) @throws FileNotFoundException if configuration file is not found as source to copy @throws IllegalArgumentException if path is a directory or it is null @throws IOException if there I / O error occurs copying file
public void copyTo(final File file) throws FileNotFoundException, IllegalArgumentException, IOException {
        Validate.notNull(this.configFile, "This configuration file is null!");
        if (!this.configFile.exists()) {
            throw new FileNotFoundException(this.configFile.getName() + " is not found in " + this.configFile.getAbsolutePath());
        }
        if (file.isDirectory()) {
            throw new IllegalArgumentException(file.getAbsolutePath() + " is a directory!");
        }
        try (final OutputStream fos = Files.newOutputStream(file.toPath())) {
            Files.copy(this.configFile.toPath(), fos);
        } catch (final Exception exception) {
            exception.printStackTrace();
        }
    }
public void copyTo ( final File file ) throws FileNotFoundException , IllegalArgumentException , IOException { Validate . notNull ( this . configFile , "This configuration file is null!" ) ; if ( ! this . configFile . exists ( ) ) { throw new FileNotFoundException ( this . configFile . getName ( ) + " is not found in " + this . configFile . getAbsolutePath ( ) ) ; } if ( file . isDirectory ( ) ) { throw new IllegalArgumentException ( file . getAbsolutePath ( ) + " is a directory!" ) ; } try ( final OutputStream fos = Files . newOutputStream ( file . toPath ( ) ) ) { Files . copy ( this . configFile . toPath ( ) , fos ) ; } catch ( final Exception exception ) { exception . printStackTrace ( ) ; } }
Copy this configuration file to another file, without deleting configuration file.
Copy this configuration file to another file without deleting configuration file .