Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package scandemo;
- import java.awt.List;
- import java.io.File;
- import java.util.ArrayList;
- /**
- *
- * @author Thieu Mao
- */
- public class test {
- public static void main(String[] args) {
- File directory = new File("D:\\Test");
- String[] directoryContents = directory.list();
- ArrayList<String> fileLocations = new ArrayList<String>();
- for (String fileName : directoryContents) {
- File temp = new File(String.valueOf(directory), fileName);
- System.out.println(String.valueOf(temp));
- fileLocations.add(String.valueOf(temp));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment