Skip to content

Connect and query a Nextcloud installation.

Notifications You must be signed in to change notification settings

derBobby/java-nextcloud-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merge Dependabot PR CD

java-nextcloud-connector

This spring boot library allows to connect to the Nextcloud OCS API v1.

Supported API functions

  • Fetch all userids from a Nextcloud installation
  • Fetch all userid:email maps from a Nextcloud installation
  • Create user

Usage

Maven setup

        <dependency>
            <groupId>eu.planlos</groupId>
            <artifactId>java-nextcloud-connector</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>

Config class setup

@Configuration
@ComponentScan(basePackages = "eu.planlos.javanextcloudconnector")
public class NextcloudConfig {}

Properties setup

Property Type Description
nextcloud.api.active Boolean Enable/Disable usage of API
nextcloud.api.address String Nextcloud URL
nextcloud.api.user String Nextcloud Username
nextcloud.api.password String Nextcloud password
nextcloud.api.defaultgroup String default group for user creation
nextcloud.api.retry-count String Retry count in case of exception
nextcloud.api.retry-interval String PInterval for retries in case of exception
nextcloud.api.account-name-prefix String Prefix to be used for a created account name
nextcloud.api.account-name-suffix String Suffix to be used for a created account name

Use in your code

Autowire the SignalService

class YourClass {
    @Autowired
    private final NextcloudApiUserService ncUserService;
}

Call service to use API functions

class YourClass {
    yourMethod() {
        try {
            // Your code
            List<String> list = ncUserService.getAllUserIdsFromNextcloud();
            Map<String, String> map = ncUserService.getAllUsersAsUseridEmailMap();
            String username = createUser(email, firstName, lastName);
            // Your code
        } catch(NextcloudException e) {
            // your code
}   }   }

About

Connect and query a Nextcloud installation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages