Skip to content

Commit

Permalink
use toPath() instead of Paths.get(getPath))
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jan 21, 2025
1 parent c3d3057 commit c7c5447
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.DosFileAttributes;
Expand All @@ -41,7 +40,6 @@
import java.util.List;
import java.util.Set;

import lucee.commons.cli.Command;
import lucee.commons.io.IOUtil;
import lucee.commons.io.ModeUtil;
import lucee.commons.io.SystemUtil;
Expand Down Expand Up @@ -434,7 +432,7 @@ public int getMode() {
if (!exists()) return 0;
if (SystemUtil.isUnix()) {
try {
PosixFileAttributes attrs = Files.readAttributes(Paths.get(getPath()), PosixFileAttributes.class);
PosixFileAttributes attrs = Files.readAttributes(toPath(), PosixFileAttributes.class);
Set<PosixFilePermission> permissions = attrs.permissions();
return ModeUtil.toOctalMode(PosixFilePermissions.toString(permissions));
}
Expand Down Expand Up @@ -476,7 +474,7 @@ public void setMode(int mode) throws IOException {
try {
provider.lock(this);
// print.ln(ModeUtil.toStringMode(mode));
Files.setPosixFilePermissions(Paths.get(getPath()), PosixFilePermissions.fromString(ModeUtil.fromOctalMode(mode)));
Files.setPosixFilePermissions(toPath(), PosixFilePermissions.fromString(ModeUtil.fromOctalMode(mode)));
} catch (IOException e) {
throw new IOException("Interrupted setPosixFilePermissions [" + toString() + "]");
}
Expand Down Expand Up @@ -543,8 +541,7 @@ public boolean setWritable(boolean value) {

try {
provider.lock(this);
Path path = Paths.get(getPath());
Files.setAttribute(path, "dos:readonly", !value);
Files.setAttribute(toPath(), "dos:readonly", !value);
}
catch (IOException ioe) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.2.0.288-SNAPSHOT"/>
<property name="version" value="6.2.0.289-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.2.0.288-SNAPSHOT</version>
<version>6.2.0.289-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit c7c5447

Please sign in to comment.