Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java rename file

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

  //...

  Path source = Paths.get("/home/mkyong/newfolder/test1.txt");
  Path target = Paths.get("/home/mkyong/newfolder/test2.txt");

  try{

    Files.move(source, target);

  } catch (IOException e) {
    e.printStackTrace();
  }
Comment

PREVIOUS NEXT
Code Example
Java :: keytool error: java.lang.Exception: Key pair not generated, alias <demo already exists 
Java :: java explicit array declaration 
Java :: what is a do while loop in java 
Java :: How to check if a string is in alphabetical order in java 
Java :: Powermockito static method call 
Java :: arraylist index java 
Java :: if and else on one line java 
Java :: fastreader in java 
Java :: swing getsource 
Java :: commenting in java 
Java :: java vs python 
Java :: throw and throws keyword in java 
Java :: first line of java code 
Java :: selection sort java 
Java :: Java try...catch block 
Java :: How to get a context in a recycler view adapter 
Java :: javafx fxmlloader location is not set 
Java :: static class java 
Java :: online java code fixer 
Java :: uninstall java 
Java :: how to create object of abstract class in java 
Java :: java check if string contains multiple words 
Java :: write file java 
Java :: check if duplicate element in java 
Java :: java method parameters 
Java :: A* shortest path algorithm 
Java :: quicksort java 
Java :: bukkit console filter 
Java :: java convert double to boolean 
Java :: how to create a subclass in java 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =