https://github.com/mamoe/kotdrive
Upload Big File to OneDrive via OneDrive API in incredible speed
https://github.com/mamoe/kotdrive
Last synced: 2 months ago
JSON representation
Upload Big File to OneDrive via OneDrive API in incredible speed
- Host: GitHub
- URL: https://github.com/mamoe/kotdrive
- Owner: mamoe
- License: gpl-3.0
- Created: 2020-04-01T16:52:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-02T16:39:41.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T18:52:36.184Z (3 months ago)
- Language: Kotlin
- Size: 46.9 KB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kotdrive
OneDrive API in Kotlin
now supported:
Upload File(15G max) to OneDrive
```kotlin
val driver = oneDriveWorker {
object : AuthProvider {
override suspend fun getAccessToken(): AccessToken {
return AccessToken("bearer", TODO())//ways to get ur token, cache is needed
}
//also you can set the API url to use business API index
}
}
try{
driver.tryNTimes(2) {//try 2 times before upload failed
this.upload(ConflictBehavior.REPLACE,"mirai/plugins/Test.md", File(System.getProperty("user.dir") + "/README.md"))
}
println("Upload Success")
}catch (e:Exception){
println("Failed to upload")
e.printStackTrace()
}
```