void (String path, File file, boolean isOwn, int level) { if (file.isDirectory()) { if (level == 1) path += file.getName(); else if (level > 1) path += "/" + file.getName(); File[] files = file.listFiles(); if (files != null) { for (int i = files.length - 1; i >= 0; i--) { addSpace(path, files[i], isOwn, level + 1); } } } else { String filename = file.getName(); boolean isArchive = false; try { if (filename.endsWith(".jar")) { isArchive = true; addArchive(path, file, ContextUnit.TYPE_JAR, isOwn); } else if (filename.endsWith(".zip")) { isArchive = true; addArchive(path, file, ContextUnit.TYPE_ZIP, isOwn); } } catch (IOException ex) { String message = "Corrupted archive file: " + file; DecompilerContext.getLogger().writeMessage(message, ex); } if (isArchive) { return; } ContextUnit unit = units.get(path); if (unit == null) { unit = new ContextUnit(ContextUnit.TYPE_FOLDER, null, path, isOwn, saver, decompiledData); units.put(path, unit); } if (filename.endsWith(".class")) { try (DataInputFullStream in = loader.getClassStream(file.getAbsolutePath(), null)) { StructClass cl = StructClass.create(in, isOwn, loader); classes.put(cl.qualifiedName, cl); unit.addClass(cl, filename); loader.addClassLink(cl.qualifiedName, new LazyLoader.Link(file.getAbsolutePath(), null)); } catch (IOException ex) { String message = "Corrupted class file: " + file; DecompilerContext.getLogger().writeMessage(message, ex); } } else { unit.addOtherEntry(file.getAbsolutePath(), filename); } } }