Skip to content

Commit 4e843be

Browse files
committed
[refactor] Java11: Use Files.read/writeString
1 parent 7d7eeda commit 4e843be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

exist-core/src/main/java/org/exist/source/FileSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public InputStream getInputStream() throws IOException {
103103
@Override
104104
public String getContent() throws IOException {
105105
checkEncoding();
106-
return new String(Files.readAllBytes(path), encoding);
106+
return Files.readString(path, encoding);
107107
}
108108

109109
@Override

exist-core/src/main/java/org/exist/storage/NativeBroker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ private XmldbURI prepend(final XmldbURI uri) {
722722
.map(h -> h.resolve("etc").resolve(INIT_COLLECTION_CONFIG))
723723
.orElse(Paths.get("etc").resolve(INIT_COLLECTION_CONFIG));
724724
if (Files.exists(fInitCollectionConfig)) {
725-
return new String(Files.readAllBytes(fInitCollectionConfig), UTF_8);
725+
return Files.readString(fInitCollectionConfig);
726726
}
727727

728728
// 2) fallback to attempting to load from classpath

0 commit comments

Comments
 (0)