Class MendeleyDataClient
- java.lang.Object
-
- uk.org.esciencelab.researchobjectservice.deposition.MendeleyDataClient
-
public class MendeleyDataClient extends java.lang.ObjectA very basic client to interact with Mendeley Data's REST API. Only a very limited set of operations are supported.
-
-
Constructor Summary
Constructors Constructor Description MendeleyDataClient(java.lang.String baseUrl, java.lang.String accessToken)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodeaddFileToDataset(java.lang.String datasetId, java.lang.String fileId, java.lang.String filename, java.lang.String description)Add a created file to an existing Mendeley Data Dataset.com.fasterxml.jackson.databind.JsonNodecreateDataset(com.fasterxml.jackson.databind.JsonNode metadata)Create a Mendeley Data Dataset.com.fasterxml.jackson.databind.JsonNodecreateFileContent(java.io.File file)Create a Mendeley Data File Content resource.com.fasterxml.jackson.databind.JsonNodepublishDataset(java.lang.String datasetId)Publish a Mendeley Data draft Dataset.
-
-
-
Constructor Detail
-
MendeleyDataClient
public MendeleyDataClient(java.lang.String baseUrl, java.lang.String accessToken)- Parameters:
baseUrl- The URL of the instance of Mendeley Data to interact with. Usually `https://api.mendeley.com`.accessToken- A valid OAuth access token. We are assuming all authentication has been done externally.
-
-
Method Detail
-
createDataset
public com.fasterxml.jackson.databind.JsonNode createDataset(com.fasterxml.jackson.databind.JsonNode metadata) throws java.io.IOExceptionCreate a Mendeley Data Dataset.- Parameters:
metadata- A JSON document containing required metadata (see: https://dev.mendeley.com/methods/#public-dataset-attributes)- Returns:
- A Mendeley Data Dataset resource, as JSON.
- Throws:
java.io.IOException
-
createFileContent
public com.fasterxml.jackson.databind.JsonNode createFileContent(java.io.File file) throws java.io.IOExceptionCreate a Mendeley Data File Content resource.- Parameters:
file- The File to upload.- Returns:
- A Mendeley Data File Content resource, as JSON.
- Throws:
java.io.IOException
-
addFileToDataset
public com.fasterxml.jackson.databind.JsonNode addFileToDataset(java.lang.String datasetId, java.lang.String fileId, java.lang.String filename, java.lang.String description) throws java.io.IOExceptionAdd a created file to an existing Mendeley Data Dataset.- Parameters:
datasetId- The ID of the Dataset.fileId- The ID of the File Content.filename- The filename for the file.description- A description of how the file relates to the dataset.- Returns:
- The modified Mendeley Data Dataset resource, as JSON.
- Throws:
java.io.IOException
-
publishDataset
public com.fasterxml.jackson.databind.JsonNode publishDataset(java.lang.String datasetId) throws java.io.IOExceptionPublish a Mendeley Data draft Dataset.- Parameters:
datasetId- The ID of the Dataset.- Returns:
- The modified Mendeley Data Dataset resource, as JSON.
- Throws:
java.io.IOException
-
-