@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { File file = new File(externalPath); if (internalPath == null) { return InterpreterUtil.getBytes(file); } else { try (ZipFile archive = new ZipFile(file)) { ZipEntry entry = archive.getEntry(internalPath); if (entry == null) throw new IOException("Entry not found: " + internalPath); return InterpreterUtil.getBytes(archive, entry); } } }
private static String getContent(File expected) { try { return new String(InterpreterUtil.getBytes(expected), StandardCharsets.UTF_8).replace("\r\n", "\n"); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { File file = new File(externalPath); if (internalPath == null) { return InterpreterUtil.getBytes(file); } else { ZipFile archive = zipFiles.get(file.getName()); if (archive == null) { archive = new ZipFile(file); zipFiles.put(file.getName(), archive); } ZipEntry entry = archive.getEntry(internalPath); if (entry == null) throw new IOException("Entry not found: " + internalPath); return InterpreterUtil.getBytes(archive, entry); } }
if (!entry.isDirectory()) { if (name.endsWith(".class")) { byte[] bytes = InterpreterUtil.getBytes(archive, entry); StructClass cl = new StructClass(bytes, isOwn, loader); classes.put(cl.qualifiedName, cl);
@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { return InterpreterUtil.getBytes(jar, entry); } };
@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { return InterpreterUtil.getBytes(jar, entry); } };
@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { return InterpreterUtil.getBytes(new File(externalPath)); } };
@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { return InterpreterUtil.getBytes(new File(externalPath)); } };
@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { File file = new File(externalPath); if (internalPath == null) { return InterpreterUtil.getBytes(file); } else { try (ZipFile archive = new ZipFile(file)) { ZipEntry entry = archive.getEntry(internalPath); if (entry == null) throw new IOException("Entry not found: " + internalPath); return InterpreterUtil.getBytes(archive, entry); } } }
@Override public byte[] getBytecode(String externalPath, String internalPath) throws IOException { File file = new File(externalPath); if (internalPath == null) { return InterpreterUtil.getBytes(file); } else { try (ZipFile archive = new ZipFile(file)) { ZipEntry entry = archive.getEntry(internalPath); if (entry == null) { throw new IOException("Entry not found: " + internalPath); } return InterpreterUtil.getBytes(archive, entry); } } } }
if (!entry.isDirectory()) { if (name.endsWith(".class")) { byte[] bytes = InterpreterUtil.getBytes(archive, entry); StructClass cl = new StructClass(bytes, isOwn, loader); classes.put(cl.qualifiedName, cl);