private Completion listDir(P dir, final String filter) throws Exception { Collection<P> children = getChilren(dir); if (children != null) { Completion.Builder builder = Completion.builder(filter); for (P child : children) { String name = getName(child); if (name.startsWith(filter)) { String suffix = name.substring(filter.length()); if (isDirectory(child)) { Collection<P> grandChildren = getChilren(child); if (grandChildren != null) { builder.add(suffix + File.separator, false); } else { // Skip it } } else { builder.add(suffix, true); } } } return builder.build(); } else { return Completion.create(); } } }
if (isDirectory(f)) { if (prefix.endsWith(sep)) { Collection<P> children = getChilren(f); if (children != null) { if (children.size() > 0) { Collection<P> children = getChilren(f); if (children == null) { return Completion.create();
private Completion listDir(P dir, final String filter) throws Exception { Collection<P> children = getChilren(dir); if (children != null) { Completion.Builder builder = Completion.builder(filter); for (P child : children) { String name = getName(child); if (name.startsWith(filter)) { String suffix = name.substring(filter.length()); if (isDirectory(child)) { Collection<P> grandChildren = getChilren(child); if (grandChildren != null) { builder.add(suffix + File.separator, false); } else { // Skip it } } else { builder.add(suffix, true); } } } return builder.build(); } else { return Completion.create(); } } }
private Completion listDir(P dir, final String filter) throws Exception { Collection<P> children = getChilren(dir); if (children != null) { Completion.Builder builder = Completion.builder(filter); for (P child : children) { String name = getName(child); if (name.startsWith(filter)) { String suffix = name.substring(filter.length()); if (isDirectory(child)) { Collection<P> grandChildren = getChilren(child); if (grandChildren != null) { builder.add(suffix + File.separator, false); } else { // Skip it } } else { builder.add(suffix, true); } } } return builder.build(); } else { return Completion.create(); } } }
if (isDirectory(f)) { if (prefix.endsWith(sep)) { Collection<P> children = getChilren(f); if (children != null) { if (children.size() > 0) { Collection<P> children = getChilren(f); if (children == null) { return Completion.create();
if (isDirectory(f)) { if (prefix.endsWith(sep)) { Collection<P> children = getChilren(f); if (children != null) { if (children.size() > 0) { Collection<P> children = getChilren(f); if (children == null) { return Completion.create();