private List<File> getChildFiles(final File base) { final List<File> childFiles = new ArrayList<>(); getChildFiles(base, childFiles); return childFiles; }
private List<File> getChildFiles(final File base) { final List<File> childFiles = new ArrayList<File>(); getChildFiles(base, childFiles); return childFiles; }
private void getChildFiles(final File base, final List<File> childFiles) { for (File child : base.listFiles()) { if (child.isFile()) { childFiles.add(child); } else { getChildFiles(child, childFiles); } } }
private void getChildFiles(final File base, final List<File> childFiles) { for (File child : base.listFiles()) { childFiles.add(child); if (child.isFile() || isEmpty(child)) { childFiles.add(child); } else { getChildFiles(child, childFiles); } } }
private void writeResponse(final File localPath, final FlushableDataOutput output) throws IOException { output.writeByte(protocol.paramNumFiles()); if (localPath == null || !localPath.exists()) { output.writeInt(-1); } else if (localPath.isFile()) { output.writeInt(1); writeFile(localPath, localPath, output); } else { final List<File> childFiles = getChildFiles(localPath); output.writeInt(childFiles.size()); for (File child : childFiles) { writeFile(localPath, child, output); } } }
private void writeResponse(final File localPath, final FlushableDataOutput output) throws IOException { output.writeByte(protocol.paramNumFiles()); if (localPath == null || !localPath.exists()) { output.writeInt(-1); } else if (localPath.isFile()) { output.writeInt(1); writeFile(localPath, localPath, output); } else { final List<File> childFiles = getChildFiles(localPath); output.writeInt(childFiles.size()); for (File child : childFiles) { writeFile(localPath, child, output); } } }