Class DriveItemPageParser

java.lang.Object
com.amilesend.onedrive.parse.resource.parser.DriveItemPageParser
All Implemented Interfaces:
GsonParser<DriveItemPage>

public class DriveItemPageParser extends Object implements GsonParser<DriveItemPage>
Parses a paginated response body that contains a list of DriveItems.

Example response body:

 {
   "value": [
     {"name": "myfile.jpg", "size": 2048, "file": {} },
     {"name": "Documents", "folder": { "childCount": 4} },
     {"name": "Photos", "folder": { "childCount": 203} },
     {"name": "my sheet(1).xlsx", "size": 197 }
   ],
   "@odata.nextLink": "https://..."
 }
 
API Documentation
See Also:
  • Constructor Details

    • DriveItemPageParser

      public DriveItemPageParser()
  • Method Details

    • parse

      public DriveItemPage parse(@NonNull com.google.gson.Gson gson, @NonNull InputStream jsonStream)
      Description copied from interface: GsonParser
      Deserializes a JSON-formatted input stream to the defined POJO type.
      Specified by:
      parse in interface GsonParser<DriveItemPage>
      Parameters:
      gson - the Gson instance used to deserialize the string
      jsonStream - stream with expected JSON-formatted contents
      Returns:
      the parsed POJO instance