Skip to content

Sync files via Redunda

Felix edited this page Mar 22, 2017 · 2 revisions

Automatic synchronization

Get the DataService

You can easily get the DataService with the same API-key as PingService:

DataService redundaData = redunda.buildDataService();

Track files for syncing

Each file that should be automatically synchronized needs to be tracked:

redundaData.trackFile("./myFile");

Note: You should not use absolute paths and a path should not contain the String _slash_.

Start synchronizing

The automatic sync can be started like this:

redundaData.syncAndStart();

This will call syncFiles() synchronously (for proper initialization of your bot) and then start the background thread. Alternatively, you can use start() if you don't need the files on launch.

If you don't want to sync automatically in background, you can just call syncFiles().

Upload and download files manually

If you don't want to sync automatically, you can call the methods for uploading and downloading by yourself. They are the same as syncFiles() uses. Please have a look at the documentation for more information.

Clone this wiki locally