< prev index next >

src/java.base/share/classes/jdk/internal/jrtfs/ExplodedImage.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
--- 1,7 ---
  /*
!  * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

*** 117,13 ***
                  throw new FileSystemException(getName() + " is not file");
              return Files.readAllBytes(path);
          }
  
          @Override
!         public List<Node> getChildren() {
              if (!isDirectory())
!                 throw new IllegalArgumentException("not a directory: " + getNameString());
              if (children == null) {
                  List<Node> list = new ArrayList<>();
                  try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {
                      for (Path p : stream) {
                          p = explodedModulesDir.relativize(p);
--- 117,13 ---
                  throw new FileSystemException(getName() + " is not file");
              return Files.readAllBytes(path);
          }
  
          @Override
!         public Stream<String> getChildNames() {
              if (!isDirectory())
!                 throw new IllegalArgumentException("not a directory: " + getName());
              if (children == null) {
                  List<Node> list = new ArrayList<>();
                  try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {
                      for (Path p : stream) {
                          p = explodedModulesDir.relativize(p);

*** 136,11 ***
                  } catch (IOException x) {
                      return null;
                  }
                  children = list;
              }
!             return children;
          }
  
          @Override
          public long size() {
              try {
--- 136,11 ---
                  } catch (IOException x) {
                      return null;
                  }
                  children = list;
              }
!             return children.stream().map(Node::getName);
          }
  
          @Override
          public long size() {
              try {
< prev index next >