Java client library for the RestBackup(tm) Backup and Management APIs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

RestBackup(tm) Client Library

This package provides convenient classes for making calls to the RestBackup(tm) Backup and Management APIs. These APIs are documented at


  • JavaSE-1.6
  • gson-1.6.jar
  • httpclient-4.1.jar
    • commons-logging-1.1.1.jar
  • httpcore-4.1.jar

Unit Test Dependencies:

  • JUnit 4
  • mockito-all-1.8.5.jar

Example usage:

// Make a caller object for the management api account
String managementApiAccessUrl = "";
ManagementApiCaller man_api = new ManagementApiCaller(managementApiAccessUrl);

// Create a new backup account
BackupAccountDetails newAccount = man_api.createBackupAccount("description", 9);

// Get a backup account by ID
BackupAccountDetails otherAccount = man_api.getBackupAccount("/576d91c7-11a1-4375-a599-a001c07584cd");

// List backup accounts
for (BackupAccount account : man_api.listBackupAccounts()) {

// Make a caller object for the new account
String backupApiAccessUrl = newAccount.getAccessUrl();
BackupApiCaller backup_api = new BackupApiCaller(backupApiAccessUrl);

// Backup a file
File file = new File("/file/to/backup");
HttpEntity requestEntity = new org.apache.http.entity.FileEntity(file, "application/octet-stream");
backup_api.put(name, requestEntity);

// Restore a file
HttpEntity entity = backup_api.get(name);
entity.writeTo(new FileOutputStream("/restored/file"));

// List available files
for (FileDetails fileDetails : backup_api.list()) {

// Delete backup account

See src/com/restbackup/ for a runnable example.