The "library" you're looking for is Microsoft's SDK. You will need to import the following dependencies (Microsoft Documentation):
Gradle:
dependencies {
// Include the sdk as a dependency
implementation("com.microsoft.graph:microsoft-graph:6.+")
// Include Azure identity for authentication
implementation("com.azure:azure-identity:1.+")
}
Maven:
<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph</artifactId>
<version>[6.0,)</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>[1.11,)</version>
</dependency>
This will allow you to interact with the Graph API using Microsoft's SDK.
To upload files, you'll want to look at documentations like this:
https://learn.microsoft.com/en-us/graph/sdks/large-file-upload?tabs=java