dirs.addAll(files);
return dirs;
}
public void rename(String orig, String dist) {
DbTpl tpl = dao.deleteById(orig);
if (tpl == null) {
return;
}
dao.deleteById(orig);
String name = StringUtils.replace(tpl.getId(), orig, dist, 1);
save(name, tpl.getSource(), tpl.isDirectory());
createParentDir(name);
if (tpl.isDirectory()) {
List<DbTpl> list = dao.getStartWith(orig + "/");
for (DbTpl t : list) {
dao.deleteById(t.getId());
name = StringUtils.replace(t.getId(), orig, dist, 1);
save(name, t.getSource(), t.isDirectory());