Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.util.Arrays;
- import java.util.List;
- public class Test {
- public static void main(String[] args) {
- String targetFolder = "/home/you/";
- File folder = new File("C:\\");
- System.out.println("folder=" + folder);
- if (folder.listFiles() != null) {
- List<File> listOfFiles = Arrays.asList(folder.listFiles());
- for (File file : listOfFiles) {
- System.out.println("File name: " + file.getName());
- System.out.println("Full path: " + file.getAbsolutePath());
- System.out.println("Target path: " + targetFolder + file.getName());
- System.out.println();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement