How to move a file in Java

In this post we will provide an example of how to move a file in Java. This example uses the standard java libraries so you will not need any external dependencies.

How to move a file in Java:

The example below uses the Files class which is available from Java 1.7 and above.

 

Similar posts:

  1. How to get file size in Java
  2. How to delete a file in Java
  3. How to list files in a directory in Java
  4. How to write to a file in Java

References:

  1. Files API Documentation

Leave a Reply