jdk/test/lib/testlibrary/ClassFileInstaller.java
changeset 21648 b485e4eb2fd9
parent 18234 996e8c4c858d
equal deleted inserted replaced
21647:d1825822d9a0 21648:b485e4eb2fd9
    43             String pathName = arg.replace('.', '/').concat(".class");
    43             String pathName = arg.replace('.', '/').concat(".class");
    44             InputStream is = cl.getResourceAsStream(pathName);
    44             InputStream is = cl.getResourceAsStream(pathName);
    45 
    45 
    46             // Create the class file's package directory
    46             // Create the class file's package directory
    47             Path p = Paths.get(pathName);
    47             Path p = Paths.get(pathName);
    48             Files.createDirectories(p.getParent());
    48             Path parent = p.getParent();
       
    49             if (parent != null) {
       
    50                 Files.createDirectories(parent);
       
    51             }
    49             // Create the class file
    52             // Create the class file
    50             Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING);
    53             Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING);
    51         }
    54         }
    52     }
    55     }
    53 }
    56 }