Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8157936

Files.size(Path p) returns 0 if path is from JrtFileSystem with exploded build

XMLWordPrintable

    • b125
    • generic
    • linux
    • Verified

      This can be easily reproduce with following snippet of code:

              // or try "modules/java.base/java/lang/Object.class"
              String path = "/modules/java.base/java/lang/Object.class";
              FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
              Path classFile = fs.getPath(path);

              System.out.println("Class File Size: " + Files.size(classFile));
              if (Files.size(classFile) <= 0L) throw new RuntimeException("Invalid file size");

      I only tested on Linux X64.

            sundar Sundararajan Athijegannathan
            xiaofeya Xiaofeng Yang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: