Class MendeleyDataClient


  • public class MendeleyDataClient
    extends java.lang.Object
    A 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.JsonNode addFileToDataset​(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.JsonNode createDataset​(com.fasterxml.jackson.databind.JsonNode metadata)
      Create a Mendeley Data Dataset.
      com.fasterxml.jackson.databind.JsonNode createFileContent​(java.io.File file)
      Create a Mendeley Data File Content resource.
      com.fasterxml.jackson.databind.JsonNode publishDataset​(java.lang.String datasetId)
      Publish a Mendeley Data draft Dataset.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.IOException
        Create 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.IOException
        Create 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.IOException
        Add 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.IOException
        Publish 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