Ejemplo n.º 1
0
 @Override
 public boolean deleteOrphans(ProgressDelegate progress) {
   List<OrphanVersion> orphans = orphans();
   if (progress != null) progress.setMax(orphans.size());
   int count = 0;
   for (OrphanVersion orphan : orphans) {
     delete(orphan);
     if (progress != null) {
       progress.setActual(++count);
       progress.setInfo(orphan.getOriginalFilePath());
     }
   }
   if (progress != null) progress.finished();
   return true;
 }
Ejemplo n.º 2
0
  @Override
  public boolean delete(OrphanVersion orphan) {
    VFSLeaf versionLeaf = orphan.getVersionsLeaf();

    if (versionLeaf == null) return true; // already deleted
    Versions versions = orphan.getVersions();
    for (VFSRevision versionToDelete : versions.getRevisions()) {
      RevisionFileImpl versionImpl = (RevisionFileImpl) versionToDelete;
      versionImpl.setContainer(orphan.getVersionsLeaf().getParentContainer());
      VFSLeaf fileToDelete = versionImpl.getFile();
      if (fileToDelete != null) {
        fileToDelete.delete();
      }
    }
    versionLeaf.delete();
    return true;
  }