Skip to content

Commit 9fd858b

Browse files
committed
Fixes
1 parent d1bdcd7 commit 9fd858b

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ jobs:
1010
runs-on: ubuntu-20.04
1111
steps:
1212
- name: Git checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414

1515
- name: Set up GraalVM
1616
uses: graalvm/setup-graalvm@v1
1717
with:
1818
version: '21.3.0'
1919
java-version: '17'
2020

21-
- name: Verify Gradle Wrapper
22-
uses: gradle/wrapper-validation-action@v1
23-
2421
- name: Publish
2522
run: ./gradlew publish
2623
env:
@@ -30,7 +27,7 @@ jobs:
3027
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
3128

3229
- name: Upload artifact
33-
uses: actions/upload-artifact@v2
30+
uses: actions/upload-artifact@v4
3431
with:
3532
name: modulefs
3633
path: modulefs/build/libs
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

modulefs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'signing'
55
}
66

7-
version '0.1.5'
7+
version '0.1.6'
88
group 'io.xpipe'
99
archivesBaseName = 'modulefs'
1010

modulefs/src/main/java/io/xpipe/modulefs/JarModuleFileSystem.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ static Optional<JarModuleFileSystem> create(
2323
if (openFsCounts.containsKey(modFilePath)) {
2424
jarFs = FileSystems.getFileSystem(fsUri);
2525
} else {
26-
boolean isWritable = modFilePath.toFile().canWrite();
27-
if (isWritable && !modFilePath.toFile().setWritable(false)) {
28-
throw new IOException("Unable to make file " + modFilePath + " not writable");
29-
}
3026
jarFs = FileSystems.newFileSystem(fsUri, Map.of());
31-
if (isWritable) {
32-
if (!modFilePath.toFile().setWritable(true)) {
33-
throw new IOException("Unable to make file " + modFilePath + " writable");
34-
}
27+
try {
28+
var m = jarFs.getClass().getDeclaredMethod("setReadOnly");
29+
m.invoke(jarFs);
30+
} catch (IllegalAccessException ignored) {
31+
} catch (Exception e) {
32+
throw new RuntimeException("Unable to make file " + modFilePath + " read-only", e);
3533
}
3634
}
3735
return Optional.of(new JarModuleFileSystem(module, jarFs.getPath("/"), modFilePath, provider));

0 commit comments

Comments
 (0)