Java Path Copy nio renameTo(Path from, Path to, CopyOption... options)

Here you can find the source of renameTo(Path from, Path to, CopyOption... options)

Description

rename To

License

Apache License

Declaration

public static boolean renameTo(Path from, Path to, CopyOption... options) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

import java.nio.file.CopyOption;

import java.nio.file.Files;

import java.nio.file.Path;

public class Main {
    public static boolean renameTo(Path from, Path to, CopyOption... options) {
        try {/* w  ww . j av a  2s.c  o m*/
            return Files.move(from, to, options) != null;
        } catch (IOException e) {
            return false;
        }
    }
}

Related

  1. createDirectory(Path outDir, boolean cleanExisting)
  2. createDirectory(Path parent, String name)
  3. createDirectoryIfNotExists(Path path)
  4. createDirectoryRecursively(Path dir)
  5. createDirectoryRecursively(String dirName)
  6. write(InputStream in, Path path, StandardCopyOption op)