Skip to content

Commit

Permalink
fix: native image
Browse files Browse the repository at this point in the history
  • Loading branch information
4e6 committed Jul 9, 2024
1 parent bf177bf commit 536515b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 1 addition & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -1107,10 +1107,7 @@ lazy val `project-manager` = (project in file("lib/scala/project-manager"))
staticOnLinux = true,
initializeAtRuntime = Seq(
"scala.util.Random",
"sun.awt",
"sun.java2d",
"sun.font",
"java.awt",
"com.sun.jna",
"zio.internal.ZScheduler$$anon$4",
"zio.Runtime$",
"zio.FiberRef$"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
package org.enso.desktopenvironment;

import com.sun.jna.platform.FileUtils;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import com.sun.jna.platform.FileUtils;

final class JnaTrash implements Trash {

private static final FileUtils fileUtils = FileUtils.getInstance();

@Override
public boolean isSupported() {
return fileUtils.hasTrash();
return FileUtils.getInstance().hasTrash();
}

@Override
public boolean moveToTrash(Path path) {
if (Files.exists(path) && isSupported()) {
try {
fileUtils.moveToTrash(path.toFile());
FileUtils.getInstance().moveToTrash(path.toFile());

return true;
} catch (IOException ignored) {
Expand Down

0 comments on commit 536515b

Please sign in to comment.