Skip to content

sync4j/sync4j-pcloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sync4j-pcloud

Maven Central License Javadocs SonarCloud

This is a provider for sync4j that allows to synchronize files with pCloud.

Requirements

  • Java 17
  • A pCloud token (see here to know how to get one).

Installation

Import with Maven:

<dependency>
    <groupId>com.fathzer</groupId>
    <artifactId>sync4j-pcloud</artifactId>
    <version>0.0.1</version>
</dependency>

Usage

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();
    }
}

Running Tests

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_TOKEN

If 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=EU

Note 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.

About

A pCloud minimal file system to be used with sync4j

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages