# DataSync

A class with helper methods for read and write of Solid PODs.

## Constructor

#### new DataSync()

The constructor initiates a DataSync instance.

Source:
  - datasync.js, line 6

### Methods

#### createEmptyFileForUser(url:) → {Promise}

This method creates an empty file for the given url. It overwrites existing files.

Source:
  - datasync.js, line 22

##### Parameters:

Name | Type | Description
--- | --- | ---
`url:` |  | the url of the empty file

##### Returns:

Type:
  `Promise`

: the promise from auth.fetch().

#### deleteFileForUser(url:) → {Promise}

This method deletes a file.

Source:
  - datasync.js, line 34

##### Parameters:

Name | Type | Description
--- | --- | ---
`url:` |  | the url of the file that needs to be deleted.

##### Returns:

Type:
  `Promise`

: the promise from auth.fetch().

#### executeSPARQLUpdateForUser(url:, query:) → {Promise}

This method executes an SPARQL update on a file.

Source:
  - datasync.js, line 46

##### Parameters:

Name | Type | Description
--- | --- | ---
`url:` |  | the url of the file that needs to be updated.
`query:` |  | the SPARQL update query that needs to be executed.

##### Returns:

Type:
  `Promise`

: the promise from auth.fetch().

#### sendToOpponentsInbox(url:, data:) → {Promise}

This method sends a notification to an inbox.

Source:
  - datasync.js, line 62

##### Parameters:

Name | Type | Description
--- | --- | ---
`url:` |  | the url of the inbox.
`data:` |  | the RDF data representing the notification.

##### Returns:

Type:
  `Promise`

: the promise from auth.fetch().