karim-ramadan commented on issue #7287:
URL: https://github.com/apache/iceberg/issues/7287#issuecomment-1500047391

   Hi @jackye1995 I'd like to open a PR to fix it, I was also thinking instead 
of fixing all the problems case by case we could create a class like this 
   
   `
   public class UriFileSystem {
     File parent;
   
     public UriFileSystem(URI uri) {
       this.parent = Paths.get(uri).toFile();
     }
   
     public UriFileSystem(File file) {
       this.parent = file;
     }
   
     public UriFileSystem(Path path) {
       this.parent = path.toFile();
     }
   
     public URI newFolder(String... paths) throws IOException {
       if (paths.length == 0) {
         return parent.toURI();
       }
       File f = parent;
       for (String p : paths) {
         f = new File(f, p);
       }
       f.mkdirs();
       return f.toURI();
     }
   
     public URI newFile(String name) throws IOException {
       File f = new File(parent, name);
       f.createNewFile();
       return f.toURI();
     }
   
     public static Stream<URI> listFiles(URI location) {
       return 
Arrays.stream(Objects.requireNonNull(Paths.get(location).toFile().listFiles()))
           .map(File::toURI);
     }
   }
   `
   Inside the core test module, in this way, we could manage all resources as 
URIs avoiding silly mistakes and ensuring that in the future tests are always 
compatible across all OS.
   What do you think? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to