SHARE
TWEET

Untitled

a guest Apr 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    public static void listFilesForFolder(File folder) { //@return Database for debugging
  2.         //Database test = new Database(; // for debugging
  3.         File[] fileNames = folder.listFiles();
  4.         for (File fileEntry : fileNames) {
  5.             if (fileEntry.isDirectory()) {
  6.                 listFilesForFolder(fileEntry);
  7.             } else {
  8.                 try {
  9.                     String name = fileEntry.getName();
  10.  
  11.                     String extension = name.substring(name.lastIndexOf("."));
  12.                     if (extension.equals(".tbl")) {
  13.  
  14.                         System.out.println("Table " + name);
  15.  
  16.                     } //do something
  17.                     else {
  18.                         System.out.println("Reference " + name);
  19.                         Relation tester = new Relation(fileEntry);
  20.                         System.out.println(tester.storage);
  21.  
  22.  
  23.  
  24.                     }
  25.                 } catch (Exception e) {
  26.                     System.out.println("Yeah that didn't work...");
  27.                     System.out.println(fileEntry.getName());
  28.                 }
  29.             }
  30.         }
  31.  
  32.     }
  33.  
  34.  
  35.  
  36.  
  37.     private static void listFiles(String inName) { //idk why I couldn't just add this to the bigger method but it didn't work 😎
  38.         File folder = new File(inName);
  39.         listFilesForFolder(folder);
  40.  
  41.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top