This is a provider for sync4j that allows to synchronize files with pCloud.
- Java 17
- A pCloud token (see here to know how to get one).
Import with Maven:
<dependency>
<groupId>com.fathzer</groupId>
<artifactId>sync4j-pcloud</artifactId>
<version>0.0.1</version>
</dependency>try (FileProvider provider = new PCloudProvider(Zone.US, accessToken)) {
Entry entry = provider.get("/path/to/file");
if (entry.isFile()) {
File file = entry.asFile();
}
if (entry.isFolder()) {
Folder folder = entry.asFolder();
}
}This project includes integration tests that communicate with the pCloud API. These tests require a valid pCloud access token to run.
To execute the full suite of tests including integration tests, you must provide the pcloud.token system property:
mvn test -Dpcloud.token=YOUR_ACCESS_TOKENIf the pcloud.token property is missing, the integration tests will be automatically skipped.
You can also specify the zone (defaults to US if not specified):
mvn test -Dpcloud.token=YOUR_ACCESS_TOKEN -Dpcloud.zone=EUNote for contributors: Pull requests from forked repositories do not have access to the repository secrets. Consequently, the integration tests will be skipped in the CI pipeline for these PRs. This is a standard security measure. If you want to run these tests, you must do so locally as described above. A maintainer can manually run the integration tests for a PR by pushing the PR's branch to this repository.