Returns file with full backup. In case of RDBMS backup
it may be a directory.

@param restoreDir
@return
4527
public static File getFullBackupFile(File restoreDir)
   {
      Pattern p = Pattern.compile(".+\\.0");

      for (File f : PrivilegedFileHelper.listFiles(restoreDir, new FileFilter()
      {
         public boolean accept(File pathname)
         {
            Pattern p = Pattern.compile(".+\\.[0-9]+");
            Matcher m = p.matcher(pathname.getName());
            return m.matches();
         }
      }))
      {
         Matcher m = p.matcher(f.getName());
         if (m.matches())
         {
            return f;
         }
      }

      return null;
   }
1010609
@Nonnull
  public final ESuccess createBackup (@Nonnull final File fDestFile)
  {
    ValueEnforcer.notNull (fDestFile, "DestFile");

    LOGGER.info ("Backing up database '" + getDatabaseName () + "' to " + fDestFile);
    final DBExecutor aExecutor = new DBExecutor (this);
    return aExecutor.executeStatement ("BACKUP TO '" + fDestFile.getAbsolutePath () + "'");
  }
1096334
@javax.annotation.Nonnull
  public File getResourceDir() {
    @javax.annotation.Nonnull final File etc = new File(fileName.getParentFile(), "etc");
    etc.mkdirs();
    return etc;
  }
872278
public static JavaRDD<List<Writable>> restoreSequenceFile(String path, JavaSparkContext sc) {
        return restoreMapFile(path, sc).values();
    }
27336
public static RecoveryDirector createRecoveryDirector()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "createRecoveryDirector");
        _recoveryDirector = LibertyRecoveryDirectorImpl.instance();

        if (tc.isEntryEnabled())
            Tr.exit(tc, "createRecoveryDirector", _recoveryDirector);
        return _recoveryDirector;
    }
975180
@Override
    @Transactional
    public Restoration restartRestore(String restoreId) throws SnapshotException {
        Restoration restoration = this.jobManager.stopRestore(restoreId);
        restoration.setEndDate(null);
        restoration.setStatus(RestoreStatus.RETRIEVING_FROM_STORAGE);
        restoration = restoreRepo.save(restoration);
        eventLog.logRestoreUpdate(restoration);
        return this.restoreCompleted(restoration);
    }
346824
def full_restore(self, using=None):
        using = using or router.db_for_write(self.__class__, instance=self)
        restore_counter = Counter()
        if self.deleted:
            time = self.deleted_at
        else:
            return restore_counter
        self.collector = models.deletion.Collector(using=using)
        self.collector.collect([self])
        

        for model, instances in self.collector.data.items():
            instances_to_delete = sorted(instances, key=attrgetter("pk"))

        self.sort()

        for qs in self.collector.fast_deletes:
            # TODO make sure the queryset delete has been made a soft delete
            for qs_instance in qs:
                restore_counter.update([qs_instance._meta.model_name])
                qs_instance.restore(time=time)

        for model, instances in self.collector.data.items():
            for instance in instances:
                restore_counter.update([instance._meta.model_name])
                instance.restore(time=time)

        return sum(restore_counter.values()), dict(restore_counter)

        
        self.collector = models.deletion.Collector(using=using) 
        self.collector.collect([self], keep_parents=keep_parents)
193866
public static List<String> getDirectoryNames(String root, boolean fullPath) {
        List<File> fileList = getDirectoriesByName(root);
        List<String> list = new ArrayList<String>(fileList.size());

        for (File f : fileList) {
            String name = fullPath ? f.getAbsolutePath() : f.getName();
            list.add(name);
        }

        return list;
    }
841677
public void backup(Path pathToDir) {
        if (!isPersistent()) {
            throw new BitsyException(BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS, "Transaction log threshold is only defined for persistent graphs (with a defined path to DB)");
        } else {
            ((FileBackedMemoryGraphStore)graphStore).backup(pathToDir);
        }
    }
752322
public static String getRelativePath(File file, File srcDir) {

		String base = srcDir.getPath();
		String filePath = file.getPath();

		String relativePath = new File(base).toURI()
				.relativize(new File(filePath).toURI()).getPath();
		return relativePath;
	}
1350907
StorageDirectory getStorageDirectory(URI uri) {
    try {
      uri = Util.fileAsURI(new File(uri));
      Iterator<StorageDirectory> it = dirIterator();
      for (; it.hasNext(); ) {
        StorageDirectory sd = it.next();
        if (Util.fileAsURI(sd.getRoot()).equals(uri)) {
          return sd;
        }
      }
    } catch (IOException ioe) {
      LOG.warn("Error converting file to URI", ioe);
    }
    return null;
  }
694401
@Override
  public CloudStorageFileSystem getFileSystem(URI uri) {
    initStorage();
    return newFileSystem(uri, Collections.<String, Object>emptyMap());
  }
263739
def restore_backup(self, backup, name, flavor, volume):
        
        return self._manager.restore_backup(backup, name, flavor, volume)
820468
def _retrieve_archive():
    
    archive_file = TodoFile.TodoFile(config().archive())
    archive = TodoListBase.TodoListBase(archive_file.read())

    return (archive, archive_file)
3853
public static Map<String,byte[]> storeDirectoryResourcesAsBytes( File directory ) throws IOException {
		return storeDirectoryResourcesAsBytes( directory, new ArrayList<String>( 0 ));
	}
1007074
public static backup_file delete(nitro_service client, backup_file resource) throws Exception
	{
		resource.validate("delete");
		return ((backup_file[]) resource.delete_resource(client))[0];
	}
1146177
function restoreBackup(backupRecord, mongoUri) {
  var receipts = backupRecord.receipts;
  var handler = getHandler(backupRecord.type);

  var restorePromises = receipts.map(function (receipt) {
    var tmpfile = util.getTempFileName() + '.bson';
    return R.pPipe(
      handler.restore.bind(handler),
      R.curry(R.flip(mds.dump.fs.file))(tmpfile),
      R.curryN(4, mongoRestoreFromFile)(tmpfile, mongoUri, receipt.collection)
    )(receipt.data);
  });

  return q.all(restorePromises).thenResolve('done');
}