Skip to content

Commit 947e57e

Browse files
authored
Merge branch 'a-schild:main' into issue-92
2 parents 5fed859 + db8c7e4 commit 947e57e

7 files changed

Lines changed: 76 additions & 48 deletions

File tree

.github/workflows/build.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@
44
name: Java CI with Maven
55

66
on:
7+
# Triggers the workflow on push for the main and develop branch
78
push:
8-
branches: [ develop ]
9+
branches: [ main, develop ]
910
pull_request:
10-
branches: [ develop ]
11+
branches: [ main, develop ]
1112

1213
jobs:
1314
build:
14-
1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
1619

1720
steps:
18-
- uses: actions/checkout@3
19-
with:
20-
ref: ${{ github.ref }}
21-
- name: Set up JDK 1.8
22-
uses: actions/setup-java@v3
23-
with:
24-
java-version: 8.0
25-
distribution: 'adopt'
26-
architecture: x64
27-
- name: Build with Maven
28-
run: mvn -B package --file pom.xml
21+
- uses: actions/checkout@v5
22+
with:
23+
ref: ${{ github.ref }}
24+
- uses: actions/setup-java@v5
25+
with:
26+
java-version: 11
27+
distribution: 'zulu'
28+
architecture: x64
29+
30+
- name: Build with Maven
31+
run: mvn -B package --file pom.xml

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Changelog for nextcloud api
2+
3+
## Version 14.0.0
4+
- 2025-10-21
5+
- Bump required java version from 8 to 11+ (Thanks to kindlich)
6+
- Make connection autoclosable (thanks to raboof)
7+
- Bump pom.xml dependencies where possible
8+
29
## Version 13.0.2
310
- 2024-03-16
411
- Typo fixes

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ Java api library to access nextcloud features from java applications
1919
<dependency>
2020
<groupId>com.github.a-schild</groupId>
2121
<artifactId>nextcloud-java-api</artifactId>
22-
<version>13.1.0</version>
22+
<version>14.0.0</version>
2323
</dependency>
2424
```
2525

26+
- The 14.x versions require Java 11+,as the jakarta.xml binding requires Java 11+
2627
- The 13.x versions are now using the jakarta.xml binding stuff, to prevent problems with Java 11+
2728
No API changes have been made in v13, but at some places the XML stuff is exposed
2829
Which made it necessary to bump the major version number

nbactions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<displayName>Deploy</displayName>
66
<goals>
77
<goal>deploy</goal>
8+
<goal>-DskipTests</goal>
89
</goals>
910
</action>
1011
</actions>

pom.xml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,48 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.aarboard.nextcloud</groupId>
55
<artifactId>nextcloud-api</artifactId>
6-
<version>13.1.0</version>
6+
<version>14.0.1</version>
77
<packaging>jar</packaging>
88
<properties>
99
<!-- compile time dependencies -->
1010
<httpcore.version>4.4.16</httpcore.version>
1111
<httpasyncclient.version>4.1.5</httpasyncclient.version>
1212
<httpclient.version>4.5.14</httpclient.version>
13-
<slf4j-api.version>2.0.13</slf4j-api.version>
14-
<sardine.version>5.12</sardine.version>
15-
<commons-io.version>2.16.1</commons-io.version>
16-
<commons-lang3.version>3.18.0</commons-lang3.version>
17-
<commons-codec.version>1.17.0</commons-codec.version>
18-
<jackson.version>2.17.1</jackson.version>
19-
<jakarta.xml.bind-api.version>4.0.1</jakarta.xml.bind-api.version>
13+
<slf4j-api.version>2.0.17</slf4j-api.version>
14+
<sardine.version>5.13</sardine.version>
15+
<commons-io.version>2.20.0</commons-io.version>
16+
<commons-lang3.version>3.19.0</commons-lang3.version>
17+
<commons-codec.version>1.19.0</commons-codec.version>
18+
<jackson.version>2.20.0</jackson.version>
19+
<jakarta.xml.bind-api.version>4.0.4</jakarta.xml.bind-api.version>
2020
<jakarta-annotation-api.version>2.1.1</jakarta-annotation-api.version>
21-
<jaxb-impl.version>3.0.0</jaxb-impl.version>
21+
<jaxb-impl.version>3.0.2</jaxb-impl.version>
2222

2323
<!-- test dependencies versions -->
24+
<skipTests>true</skipTests>
2425
<slf4j-simple.version>${slf4j-api.version}</slf4j-simple.version>
25-
<jaxb-runtime.version>4.0.3</jaxb-runtime.version>
26+
<jaxb-runtime.version>4.0.6</jaxb-runtime.version>
2627
<junit.version>4.13.2</junit.version>
2728

2829
<!-- build environment versions -->
2930
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
30-
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
31-
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
32-
<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
31+
<maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
32+
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
33+
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
3334
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
34-
<buildnumber-maven-plugin.version>3.1.0</buildnumber-maven-plugin.version>
35+
<buildnumber-maven-plugin.version>3.2.1</buildnumber-maven-plugin.version>
3536
<templating-maven-plugin.version>1.0.0</templating-maven-plugin.version>
36-
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
37-
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
38-
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
39-
<maven-javadoc-plugin.version>3.6.0</maven-javadoc-plugin.version>
40-
<maven-scm-provider-gitexe.version>2.0.1</maven-scm-provider-gitexe.version>
41-
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
42-
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
43-
<cyclonedx-maven-plugin.version>2.7.9</cyclonedx-maven-plugin.version>
37+
<maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
38+
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
39+
<central-publishing-maven-plugin>0.9.0</central-publishing-maven-plugin>
40+
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
41+
<maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
42+
<maven-scm-provider-gitexe.version>2.2.1</maven-scm-provider-gitexe.version>
43+
<maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
44+
<cyclonedx-maven-plugin.version>2.9.1</cyclonedx-maven-plugin.version>
4445

45-
<maven.compiler.source>1.8</maven.compiler.source>
46-
<maven.compiler.target>1.8</maven.compiler.target>
46+
<maven.compiler.source>11</maven.compiler.source>
47+
<maven.compiler.target>11</maven.compiler.target>
4748
<netbeans.hint.license>gpl30</netbeans.hint.license>
4849
</properties>
4950
<name>NextCloud Java API library</name>
@@ -322,14 +323,12 @@
322323
</dependencies>
323324
</plugin>
324325
<plugin>
325-
<groupId>org.sonatype.plugins</groupId>
326-
<artifactId>nexus-staging-maven-plugin</artifactId>
327-
<version>${nexus-staging-maven-plugin.version}</version>
326+
<groupId>org.sonatype.central</groupId>
327+
<artifactId>central-publishing-maven-plugin</artifactId>
328+
<version>0.9.0</version>
328329
<extensions>true</extensions>
329330
<configuration>
330-
<serverId>ossrh</serverId>
331-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
332-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
331+
<publishingServerId>ossrh</publishingServerId>
333332
</configuration>
334333
</plugin>
335334
<plugin>
@@ -380,6 +379,9 @@
380379
<artifactId>maven-surefire-plugin</artifactId>
381380
<version>${maven-surefire-plugin.version}</version>
382381
<configuration>
382+
<configuration>
383+
<skipTests>${skipTests}</skipTests>
384+
</configuration>
383385
<systemProperties>
384386
<property>
385387
<name>nextcloud.api.test.servername</name>

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

Lines changed: 13 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.
@@ -970,6 +980,7 @@ public void uploadFile(File srcFile, String remotePath) {
970980
* (temp) file to upload the data, so the content length is known in advance
971981
* <a href="https://github.com/a-schild/nextcloud-java-api/issues/20">...</a>
972982
*/
983+
@Deprecated
973984
public void uploadFile(InputStream inputStream, String remotePath) {
974985
fl.uploadFile(inputStream, remotePath);
975986
}
@@ -989,6 +1000,7 @@ public void uploadFile(InputStream inputStream, String remotePath) {
9891000
* (temp) file to upload the data, so the content length is known in advance
9901001
* <a href="https://github.com/a-schild/nextcloud-java-api/issues/20">...</a>
9911002
*/
1003+
@Deprecated
9921004
public void uploadFile(InputStream inputStream, String remotePath, boolean continueHeader) {
9931005
fl.uploadFile(inputStream, remotePath, continueHeader);
9941006
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ public void setServerName(String serverName){
128128
}
129129

130130
/**
131-
* @deprecated Use getSubPathPrefix() instead
131+
* @deprecated Use getSubPathPrefix() instead
132132
* @return the configured subpath prefix
133133
*/
134+
@Deprecated
134135
public String getSubpathPrefix(){
135136
return getSubPathPrefix();
136137
}
@@ -143,9 +144,10 @@ public String getSubPathPrefix(){
143144
}
144145

145146
/**
146-
* @deprecated Use setSubPathPrefix() instead
147+
* @deprecated Use setSubPathPrefix() instead
147148
* @param subpathPrefix to apply
148149
*/
150+
@Deprecated
149151
public void setSubpathPrefix(String subpathPrefix){
150152
setSubPathPrefix(subpathPrefix);
151153
}

0 commit comments

Comments
 (0)