pCloud adapter API
pCloud adapter API
Section titled “pCloud adapter API”Package: dev.properpcloud.source.pcloud
PCloudSession
Section titled “PCloudSession”data class PCloudSession( val accessToken: String, val apiHost: String, val userId: Long, val tokenKind: PCloudTokenKind = PCloudTokenKind.OAUTH_BEARER,)Allowed hosts are api.pcloud.com and eapi.pcloud.com. The token is redacted from toString and must remain in a platform credential store.
PCloudSourceFactory.create(session) chooses the correct SDK authenticator for OAuth bearer or legacy authentication tokens and returns PCloudAudioSource.
Node IDs
Section titled “Node IDs”PCloudNodeIds.folder(id) and PCloudNodeIds.file(id) encode provider type and numeric ID. parse rejects malformed and type-confused identifiers. Do not pass raw provider numbers through the core API.
PCloudAudioSource
Section titled “PCloudAudioSource”The source adapter:
- lists folders through the official Java core SDK;
- filters non-audio files by MIME type or recognized extension;
- maps provider timestamps and sizes into core records;
- resolves a fresh best direct URL for playback;
- exposes provider inspection fields without returning credentials;
- implements verified metadata staging downloads.
Verified metadata download
Section titled “Verified metadata download”prepareMetadataSource performs:
- provider snapshot with size, provider hash, modified time, and SHA-256;
- download into a non-existing destination;
- local size and SHA-256 verification;
- second provider snapshot;
- revision equality check;
- return of
PreparedMetadataSourceevidence.
Any failure deletes the destination file.
Direct login
Section titled “Direct login”PCloudDirectLoginClient.signIn(email, password, region) returns a sealed PCloudDirectLoginResult. Input, response, token, and body sizes are bounded. Cancellation is preserved, network failures are classified, and the supplied password array is overwritten in finally.
