Skip to content

Commit eab3737

Browse files
authored
Merge pull request #88 from raboof/connector-AutoCloseable
Make NextcloudConnector implement AutoCloseable
2 parents 17dc6af + 196242d commit eab3737

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/java/org/aarboard/nextcloud/api/NextcloudConnector.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.aarboard.nextcloud.api.webdav.pathresolver.WebDavPathResolver;
4040
import org.aarboard.nextcloud.api.webdav.pathresolver.WebDavPathResolverBuilder;
4141

42-
public class NextcloudConnector {
42+
public class NextcloudConnector implements AutoCloseable {
4343

4444
private final ServerConfig serverConfig;
4545
private final ProvisionConnector pc;
@@ -188,6 +188,16 @@ public void shutdown() throws IOException {
188188
ConnectorCommon.shutdown();
189189
}
190190

191+
/**
192+
* Close the HTTP client. Perform this to cleanly shut down this
193+
* application.
194+
*
195+
* @throws Exception In case of errors
196+
*/
197+
public void close() throws Exception {
198+
shutdown();
199+
}
200+
191201
/**
192202
* Trust all HTTPS certificates presented by the server. This is e.g. used
193203
* to work against a Nextcloud instance with a self-signed certificate.

0 commit comments

Comments
 (0)