Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Jun 17, 2021 4:50 PM
Views: 46
Tags: exception
  1. // Dateien in einem Verzeichnis ermitteln
  2.        
  3.         try {
  4.             var files = Files.newDirectoryStream(p2);
  5.  
  6.             for (Path found : files) {
  7.                 if (Files.isRegularFile(found))
  8.                     System.out.println(found);
  9.             }
  10.         }catch (IOException e){
  11.             System.out.println("Verzeichnis existiert nicht");
  12.             e.printStackTrace();
  13.         }