diff --git a/src/main/java/org/aarboard/nextcloud/api/NextcloudConnector.java b/src/main/java/org/aarboard/nextcloud/api/NextcloudConnector.java index e0f6a85..5515b51 100644 --- a/src/main/java/org/aarboard/nextcloud/api/NextcloudConnector.java +++ b/src/main/java/org/aarboard/nextcloud/api/NextcloudConnector.java @@ -39,7 +39,7 @@ import org.aarboard.nextcloud.api.webdav.pathresolver.WebDavPathResolver; import org.aarboard.nextcloud.api.webdav.pathresolver.WebDavPathResolverBuilder; -public class NextcloudConnector { +public class NextcloudConnector implements AutoCloseable { private final ServerConfig serverConfig; private final ProvisionConnector pc; @@ -188,6 +188,16 @@ public void shutdown() throws IOException { ConnectorCommon.shutdown(); } + /** + * Close the HTTP client. Perform this to cleanly shut down this + * application. + * + * @throws Exception In case of errors + */ + public void close() throws Exception { + shutdown(); + } + /** * Trust all HTTPS certificates presented by the server. This is e.g. used * to work against a Nextcloud instance with a self-signed certificate.