Skip to content

Commit 457b062

Browse files
committed
[refactor] Improve the provenance of our EXPath Pkg Repo fork dependency
1 parent a4c74ab commit 457b062

File tree

10 files changed

+16
-15
lines changed

10 files changed

+16
-15
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<classpathentry kind="lib" path="lib/core/lz4-java-1.5.0.jar"/>
2727
<classpathentry kind="lib" path="lib/core/icu4j-59_1.jar"/>
2828
<classpathentry kind="lib" path="lib/core/icu4j-localespi-59_1.jar"/>
29-
<classpathentry kind="lib" path="lib/core/pkg-java-fork.jar"/>
29+
<classpathentry kind="lib" path="lib/core/pkg-java-1.1.jar"/>
3030
<classpathentry kind="lib" path="lib/core/caffeine-2.6.2.jar"/>
3131
<classpathentry kind="lib" path="lib/core/jctools-core-2.1.2.jar"/>
3232
<classpathentry kind="lib" path="lib/core/jsr305-3.0.2.jar"/>

extensions/modules/src/org/exist/xquery/modules/expathrepo/InstallFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public Sequence eval(Sequence[] args, Sequence contextSequence)
104104
final DocumentImpl doc = lockedDoc.getDocument();
105105
Path file = ((NativeBroker)context.getBroker()).getCollectionBinaryFileFsPath(doc.getURI());
106106
LOG.debug("Installing file: " + file.toAbsolutePath().toString());
107-
pkg = parent_repo.installPackage(file, force, interact);
107+
pkg = parent_repo.installPackage(new XarFileSource(file), force, interact);
108108
repo.get().reportAction(ExistRepository.Action.INSTALL, pkg.getName());
109109
}
110110
}

lib/core/pkg-java-1.1.jar

85.9 KB
Binary file not shown.

lib/core/pkg-java-fork.jar

-156 KB
Binary file not shown.

nbproject/project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ file.reference.lucene-queries-4.10.4.jar=extensions/indexes/lucene/lib/lucene-qu
3535
file.reference.lucene-queryparser-4.10.4.jar=extensions/indexes/lucene/lib/lucene-queryparser-4.10.4.jar
3636
file.reference.nekohtml-1.9.22.jar=lib/user/nekohtml-1.9.22.jar
3737
file.reference.objenesis-2.2.jar=lib/test/objenesis-2.2.jar
38-
file.reference.pkg-java-fork.jar=lib/core/pkg-java-fork.jar
38+
file.reference.pkg-java-1.1.jar=lib/core/pkg-java-1.1.jar
3939
file.reference.quartz-2.3.0.jar=lib/core/quartz-2.3.0.jar
4040
file.reference.Saxon-HE-9.8.0-12.jar=lib/endorsed/Saxon-HE-9.8.0-12.jar
4141
file.reference.slf4j-api-1.7.25.jar=lib/core/slf4j-api-1.7.25.jar
@@ -400,7 +400,7 @@ javac.classpath=\
400400
${file.reference.wrapper.jar}:\
401401
${file.reference.wrapperApp.jar}:\
402402
${file.reference.jargo-0.4.14.jar}:\
403-
${file.reference.pkg-java-fork.jar}:\
403+
${file.reference.pkg-java-1.1.jar}:\
404404
${file.reference.jna-4.2.2.jar}:\
405405
${file.reference.jna-platform-4.2.2.jar}
406406
javadoc.additionalparam=-J-Xmx320m

src/org/exist/repo/ClasspathHelper.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
*/
2121
package org.exist.repo;
2222

23-
import java.io.*;
23+
import java.io.BufferedReader;
24+
import java.io.IOException;
2425
import java.nio.file.Files;
2526
import java.nio.file.Path;
2627
import java.util.Collection;
@@ -70,7 +71,7 @@ public static void updateClasspath(BrokerPool pool, org.expath.pkg.repo.Package
7071
return;
7172
}
7273
final FileSystemStorage.FileSystemResolver resolver = (FileSystemStorage.FileSystemResolver) pkg.getResolver();
73-
final File packageDir = resolver.resolveResourceAsFile(".");
74+
final Path packageDir = resolver.resolveResourceAsFile(".");
7475
final Classpath cp = new Classpath();
7576
try {
7677
scanPackageDir(cp, packageDir);
@@ -92,7 +93,7 @@ private static void scanPackages(BrokerPool pool, Classpath classpath) {
9293
} else {
9394
try {
9495
final FileSystemStorage.FileSystemResolver resolver = (FileSystemStorage.FileSystemResolver) pkg.getResolver();
95-
final File packageDir = resolver.resolveResourceAsFile(".");
96+
final Path packageDir = resolver.resolveResourceAsFile(".");
9697
scanPackageDir(classpath, packageDir);
9798
} catch (final IOException e) {
9899
LOG.warn("An error occurred while updating classpath for package " + pkg.getName(), e);
@@ -125,8 +126,8 @@ private static boolean isCompatible(Package pkg) throws PackageException {
125126
return processorVersion.getDependencyVersion().isCompatible(procVersion);
126127
}
127128

128-
private static void scanPackageDir(Classpath classpath, File module) throws IOException {
129-
final Path dotExist = module.toPath().resolve(".exist");
129+
private static void scanPackageDir(Classpath classpath, Path module) throws IOException {
130+
final Path dotExist = module.resolve(".exist");
130131
if (Files.exists(dotExist)) {
131132
if (!Files.isDirectory(dotExist)) {
132133
throw new IOException("The .exist config dir is not a dir: " + dotExist);

src/org/exist/repo/Deployment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected Optional<Path> getPackageDir(final String pkgName, final Optional<Exis
126126

127127
protected Path getPackageDir(final Package pkg) {
128128
final FileSystemStorage.FileSystemResolver resolver = (FileSystemStorage.FileSystemResolver) pkg.getResolver();
129-
return resolver.resolveResourceAsFile("").toPath();
129+
return resolver.resolveResourceAsFile("");
130130
}
131131

132132
protected Optional<org.expath.pkg.repo.Package> getPackage(final String pkgName, final Optional<ExistRepository> repo) throws PackageException {
@@ -263,7 +263,7 @@ public Optional<String> installAndDeploy(final DBBroker broker, final Txn transa
263263
// installing the xar into the expath repo
264264
LOG.info("Installing package " + xar.toAbsolutePath().toString());
265265
final UserInteractionStrategy interact = new BatchUserInteraction();
266-
final org.expath.pkg.repo.Package pkg = repo.get().getParentRepo().installPackage(xar, true, interact);
266+
final org.expath.pkg.repo.Package pkg = repo.get().getParentRepo().installPackage(new XarFileSource(xar), true, interact);
267267
final ExistPkgInfo info = (ExistPkgInfo) pkg.getInfo("exist");
268268
if (info != null && !info.getJars().isEmpty()) {
269269
ClasspathHelper.updateClasspath(broker.getBrokerPool(), pkg);

src/org/exist/repo/ExistPkgExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private void setupPackage(Package pkg, ExistPkgInfo info)
135135
// TODO: FIXME: Bad, BAD design! But will be resolved naturally by moving the
136136
// install code within the storage class (because we are writing on disk)...
137137
final FileSystemResolver res = (FileSystemResolver) pkg.getResolver();
138-
final Path classpath = res.resolveResourceAsFile(".exist/classpath.txt").toPath();
138+
final Path classpath = res.resolveResourceAsFile(".exist/classpath.txt");
139139

140140
// create [pkg_dir]/.exist/classpath.txt if not already
141141
final Path exist = classpath.getParent();

src/org/exist/repo/ExistRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void prepare(final BrokerPool brokerPool) throws BrokerPoolServiceExcepti
8585
LOG.info("Using directory " + expathDir.toAbsolutePath().toString() + " for expath package repository");
8686

8787
try {
88-
final FileSystemStorage storage = new FileSystemStorage(expathDir.toFile());
88+
final FileSystemStorage storage = new FileSystemStorage(expathDir);
8989
storage.setErrorIfNoContentDir(false);
9090
this.myParent = new Repository(storage);
9191
myParent.registerExtension(new ExistPkgExtension());
@@ -197,7 +197,7 @@ public Path resolveXQueryModule(final String namespace) throws XPathException {
197197
if (info != null) {
198198
final String f = info.getXQuery(uri);
199199
if (f != null) {
200-
return resolver.resolveComponentAsFile(f).toPath();
200+
return resolver.resolveComponentAsFile(f);
201201
}
202202
}
203203
String sysid = null; // declared here to be used in catch

src/org/exist/start/start.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ lib/core/log4j-jul-%latest%.jar always
5555
lib/core/log4j-slf4j-impl-%latest%.jar always
5656
lib/core/multilock-%latest%.jar always
5757
lib/core/slf4j-api-%latest%.jar always
58-
lib/core/pkg-java-fork.jar always
58+
lib/core/pkg-java-%latest%.jar always
5959
lib/core/quartz-%latest%.jar always
6060
lib/core/ws-commons-util-%latest%.jar always
6161
lib/core/xmldb-api-%latest%.jar always

0 commit comments

Comments
 (0)