|
@@ -119,10 +119,11 @@ public class DatabaseResource extends KeyValueResource {
|
|
|
|
|
|
@Override
|
|
|
public Set<String> keys() {
|
|
|
+ String prefix = isDirectory() ? this.path : (this.path + separator);
|
|
|
if(!cachedContent.isEmpty()){
|
|
|
- return cachedContent.keySet().stream().filter(it -> it.startsWith(this.path) && !it.equals(this.path)).collect(Collectors.toSet());
|
|
|
+ return cachedContent.keySet().stream().filter(it -> it.startsWith(prefix)).collect(Collectors.toSet());
|
|
|
}
|
|
|
- String sql = String.format("select file_path from %s where file_path like '%s%%'", tableName, isDirectory() ? this.path : (this.path + separator));
|
|
|
+ String sql = String.format("select file_path from %s where file_path like '%s%%'", tableName, prefix);
|
|
|
return new HashSet<>(template.queryForList(sql, String.class));
|
|
|
}
|
|
|
|