This spring boot library allows to connect to the Nextcloud OCS API v1.
- Fetch all userids from a Nextcloud installation
- Fetch all userid:email maps from a Nextcloud installation
- Create user
<dependency>
<groupId>eu.planlos</groupId>
<artifactId>java-nextcloud-connector</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
@Configuration
@ComponentScan(basePackages = "eu.planlos.javanextcloudconnector")
public class NextcloudConfig {}
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 |
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
} } }