Skip to content

Commit 3221acb

Browse files
committed
Merge branch 'develop'
2 parents 445dc56 + 12a58fd commit 3221acb

File tree

92 files changed

+2975
-1183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2975
-1183
lines changed

.github/workflows/java8-maven.yml

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
java: [ 8, 11 ]
10+
java: [ 8, 17 ]
1111
os: [ ubuntu-latest, macOS-latest, windows-latest ]
1212
experimental: [ false ]
1313
include:
14-
- java: '>11'
14+
- java: '-ea'
1515
os: ubuntu-latest
1616
experimental: true
1717

@@ -24,18 +24,14 @@ jobs:
2424
uses: actions/checkout@v2
2525
with:
2626
submodules: true
27+
fetch-depth: 0
2728

2829
- name: Setup Java
29-
uses: actions/setup-java@v1
30+
uses: actions/setup-java@v2
3031
with:
32+
distribution: 'temurin'
3133
java-version: ${{ matrix.java }}
32-
33-
- name: Setup Maven cache
34-
uses: actions/cache@v1
35-
with:
36-
path: ~/.m2
37-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
38-
restore-keys: ${{ runner.os }}-m2
34+
cache: 'maven'
3935

4036
- name: Build and (headless) test with Maven
4137
uses: GabrielBB/xvfb-action@v1
@@ -47,7 +43,7 @@ jobs:
4743
if: startsWith(github.repository, 'nbbrd/') && startsWith(github.ref, 'refs/heads/develop')
4844
strategy:
4945
matrix:
50-
java: [ 11 ]
46+
java: [ 17 ]
5147
os: [ ubuntu-latest ]
5248

5349
name: Snapshot on develop
@@ -58,18 +54,14 @@ jobs:
5854
uses: actions/checkout@v2
5955
with:
6056
submodules: true
57+
fetch-depth: 0
6158

6259
- name: Setup Java
63-
uses: actions/setup-java@v1
60+
uses: actions/setup-java@v2
6461
with:
62+
distribution: 'temurin'
6563
java-version: ${{ matrix.java }}
66-
67-
- name: Setup Maven cache
68-
uses: actions/cache@v1
69-
with:
70-
path: ~/.m2
71-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
72-
restore-keys: ${{ runner.os }}-m2
64+
cache: 'maven'
7365

7466
- name: Deploy snapshot with Maven if settings defined
7567
run: test ! -f ci.settings.xml || mvn -B -ntp deploy -DskipTests=true -s ci.settings.xml -P base-deploy,snapshot-deploy,!non-deployable-modules
@@ -84,7 +76,7 @@ jobs:
8476
if: startsWith(github.repository, 'nbbrd/') && startsWith(github.ref, 'refs/tags/v')
8577
strategy:
8678
matrix:
87-
java: [ 11 ]
79+
java: [ 17 ]
8880
os: [ ubuntu-latest ]
8981

9082
name: Release on tag
@@ -95,18 +87,14 @@ jobs:
9587
uses: actions/checkout@v2
9688
with:
9789
submodules: true
90+
fetch-depth: 0
9891

9992
- name: Setup Java
100-
uses: actions/setup-java@v1
93+
uses: actions/setup-java@v2
10194
with:
95+
distribution: 'temurin'
10296
java-version: ${{ matrix.java }}
103-
104-
- name: Setup Maven cache
105-
uses: actions/cache@v1
106-
with:
107-
path: ~/.m2
108-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
109-
restore-keys: ${{ runner.os }}-m2
97+
cache: 'maven'
11098

11199
- name: Deploy with Maven if settings defined
112100
run: test ! -f ci.settings.xml || mvn -B -ntp deploy -DskipTests=true -s ci.settings.xml -P base-deploy,release-deploy,!non-deployable-modules
@@ -115,6 +103,8 @@ jobs:
115103
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
116104
SIGN_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
117105
SIGN_KEY_PASS: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
106+
# Fix https://issues.sonatype.org/browse/OSSRH-66257
107+
MAVEN_OPTS: "--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
118108

119109
- name: Build assets with Maven
120110
run: mvn -B -ntp install -DskipTests=true -P base-deploy

CHANGELOG.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
6+
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.0.16] - 2022-02-01
9+
10+
### Added
11+
12+
- Add Maven BOM
13+
- Add `DoubleProperty`
14+
- Add URI parser and formatter
15+
- Add `TextResource` as reader/writer utilities
16+
- Add bridge from `Text*` to `File*` utilities
17+
- Add functional factories to `Text*` and `File*` utilities
18+
- Add gzip factory to `File*` utilities
19+
20+
## [0.0.15] - 2021-10-01
21+
22+
### Changed
23+
24+
- **Breaking change** : move Jaxb to its own module
25+
26+
## [0.0.14] - 2021-07-08
27+
28+
### Fixed
29+
30+
- Fix closed inputstream on Stax stream flow
31+
32+
## [0.0.13] - 2021-07-07
33+
34+
### Added
35+
36+
- Add property API
37+
- Add enum and failsafe parser/formatter
38+
39+
### Fixed
40+
41+
- Fix raw use of parameterized class
42+
43+
## [0.0.12] - 2021-03-19
44+
45+
### Changed
46+
47+
- Migration to Maven-Central
48+
- Maven groupId is now `com.github.nbbrd.java-io-util`
49+
50+
## [0.0.11] - 2021-01-25
51+
52+
### Added
53+
54+
- Add support of error stream in ProcessReader
55+
- Add URL parser and formatter
56+
57+
## [0.0.10] - 2021-01-18
58+
59+
### Added
60+
61+
- Add system utils
62+
63+
## [0.0.9] - 2021-01-12
64+
65+
### Added
66+
67+
- Add char buffer utils
68+
69+
## [0.0.8] - 2020-10-30
70+
71+
### Added
72+
73+
- Add file parser/formatter
74+
- Add text parser/formatter
75+
76+
### Fixed
77+
78+
- Fix XML encoding
79+
80+
## [0.0.7] - 2020-08-25
81+
82+
### Added
83+
84+
- Add lenient parsing of Locale
85+
86+
### Fixed
87+
88+
- Fix transitive requirement of nbbrd.io.xml module
89+
90+
## [0.0.6] - 2020-02-26
91+
92+
### Added
93+
94+
- Add char parser/formatter API
95+
96+
## [0.0.5] - 2020-02-17
97+
98+
### Added
99+
100+
- Add IOIterator
101+
- Add IOUnaryOperator
102+
- Add Resource#process(URI, IOConsumer<Path)
103+
104+
### Changed
105+
106+
- Big refactoring to split project
107+
108+
### Removed
109+
110+
- Remove Stream utilities
111+
112+
## [0.0.4] - 2019-08-13
113+
114+
### Added
115+
116+
- Add support of JPMS
117+
118+
## [0.0.3] - 2019-05-29
119+
120+
### Added
121+
122+
- Add formatting in XML API
123+
- Add parsing of class loader resources in XML API
124+
- Add withers alongside builders in XML API
125+
- Add composing functions in XML API
126+
127+
### Changed
128+
129+
- Improve reporting of null pointer exceptions in XML API
130+
- Improve reporting of missing resources in XML API
131+
132+
## [0.0.2] - 2018-11-27
133+
134+
### Changed
135+
136+
- Improve XXE desambiguation
137+
- Improve XML error reporting
138+
139+
### Fixed
140+
141+
- Fix JDK11 cleanup
142+
143+
## [0.0.1] - 2018-03-01
144+
145+
### Added
146+
147+
- Initial release
148+
149+
[Unreleased]: https://github.com/nbbrd/java-io-util/compare/v0.0.16...HEAD
150+
[0.0.16]: https://github.com/nbbrd/java-io-util/compare/v0.0.15...v0.0.16
151+
[0.0.15]: https://github.com/nbbrd/java-io-util/compare/v0.0.14...v0.0.15
152+
[0.0.14]: https://github.com/nbbrd/java-io-util/compare/v0.0.13...v0.0.14
153+
[0.0.13]: https://github.com/nbbrd/java-io-util/compare/v0.0.12...v0.0.13
154+
[0.0.12]: https://github.com/nbbrd/java-io-util/compare/v0.0.11...v0.0.12
155+
[0.0.11]: https://github.com/nbbrd/java-io-util/compare/v0.0.10...v0.0.11
156+
[0.0.10]: https://github.com/nbbrd/java-io-util/compare/v0.0.9...v0.0.10
157+
[0.0.9]: https://github.com/nbbrd/java-io-util/compare/v0.0.8...v0.0.9
158+
[0.0.8]: https://github.com/nbbrd/java-io-util/compare/v0.0.7...v0.0.8
159+
[0.0.7]: https://github.com/nbbrd/java-io-util/compare/v0.0.6...v0.0.7
160+
[0.0.6]: https://github.com/nbbrd/java-io-util/compare/v0.0.5...v0.0.6
161+
[0.0.5]: https://github.com/nbbrd/java-io-util/compare/v0.0.4...v0.0.5
162+
[0.0.4]: https://github.com/nbbrd/java-io-util/compare/v0.0.3...v0.0.4
163+
[0.0.3]: https://github.com/nbbrd/java-io-util/compare/v0.0.2...v0.0.3
164+
[0.0.2]: https://github.com/nbbrd/java-io-util/compare/v0.0.1...v0.0.2
165+
[0.0.1]: https://github.com/nbbrd/java-io-util/releases/tag/v0.0.1

java-io-base/pom.xml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.github.nbbrd.java-io-util</groupId>
77
<artifactId>java-io-parent</artifactId>
8-
<version>0.0.15</version>
8+
<version>0.0.16</version>
99
</parent>
1010

1111
<artifactId>java-io-base</artifactId>
@@ -35,8 +35,8 @@
3535

3636
<!-- test libraries -->
3737
<dependency>
38-
<groupId>junit</groupId>
39-
<artifactId>junit</artifactId>
38+
<groupId>org.junit.jupiter</groupId>
39+
<artifactId>junit-jupiter</artifactId>
4040
<scope>test</scope>
4141
</dependency>
4242
<dependency>
@@ -50,4 +50,25 @@
5050
<scope>test</scope>
5151
</dependency>
5252
</dependencies>
53+
54+
<build>
55+
<plugins>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-jar-plugin</artifactId>
59+
<executions>
60+
<execution>
61+
<goals>
62+
<goal>test-jar</goal>
63+
</goals>
64+
<configuration>
65+
<includes>
66+
<include>_test/**</include>
67+
</includes>
68+
</configuration>
69+
</execution>
70+
</executions>
71+
</plugin>
72+
</plugins>
73+
</build>
5374
</project>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package internal.io;
2+
3+
import nbbrd.io.FileParser;
4+
import nbbrd.io.function.IOSupplier;
5+
import nbbrd.io.function.IOUnaryOperator;
6+
import org.checkerframework.checker.nullness.qual.NonNull;
7+
8+
import java.io.File;
9+
import java.io.IOException;
10+
import java.io.InputStream;
11+
import java.nio.file.Path;
12+
import java.util.Objects;
13+
14+
@lombok.RequiredArgsConstructor
15+
public final class DecodingFileFormatter<T> implements FileParser<T> {
16+
17+
@lombok.NonNull
18+
final FileParser<T> parser;
19+
20+
@lombok.NonNull
21+
final IOUnaryOperator<InputStream> decoder;
22+
23+
@Override
24+
public @NonNull T parseFile(@NonNull File source) throws IOException {
25+
// force use of default impl
26+
return FileParser.super.parseFile(source);
27+
}
28+
29+
@Override
30+
public @NonNull T parsePath(@NonNull Path source) throws IOException {
31+
// force use of default impl
32+
return FileParser.super.parsePath(source);
33+
}
34+
35+
@Override
36+
public @NonNull T parseResource(@NonNull Class<?> type, @NonNull String name) throws IOException {
37+
// force use of default impl
38+
return FileParser.super.parseResource(type, name);
39+
}
40+
41+
@Override
42+
public @NonNull T parseStream(IOSupplier<? extends InputStream> source) throws IOException {
43+
// force use of default impl
44+
return FileParser.super.parseStream(source);
45+
}
46+
47+
@Override
48+
public @NonNull T parseStream(@NonNull InputStream resource) throws IOException {
49+
Objects.requireNonNull(resource, "resource");
50+
return parser.parseStream(decoder.applyWithIO(resource));
51+
}
52+
}

0 commit comments

Comments
 (0)