Skip to content

Commit

Permalink
Merge branch 'develop' into feature/xattr
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Sep 6, 2023
2 parents 0dc5847 + 70f9ac2 commit ff3a721
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
32 changes: 32 additions & 0 deletions src/main/java/org/cryptomator/frontend/fuse/OS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.cryptomator.frontend.fuse;

enum OS {
LINUX,
MAC,
WINDOWS,
UNKNOWN;

private static String osName() {
class Holder {
private static final String OS_NAME = System.getProperty("os.name", "").toLowerCase();
}
return Holder.OS_NAME;
}

public static OS current() {
var name = osName();
if (name.contains("linux")) {
return LINUX;
} else if (name.contains("mac")) {
return MAC;
} else if (name.contains("windows")) {
return WINDOWS;
} else {
return UNKNOWN;
}
}

public boolean isCurrent() {
return equals(OS.current());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public int chmod(String path, int mode, FileInfo fi) {
LOG.warn("chmod {} failed, file not found.", path);
return -errno.enoent();
} catch (UnsupportedOperationException e) {
if (!WindowsUtil.IS_RUNNING_OS) { //prevent spamming warnings
if (OS.WINDOWS.isCurrent()) { //prevent spamming warnings
LOG.warn("Setting posix permissions not supported by underlying file system.");
}
return -errno.enosys();
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java

This file was deleted.

0 comments on commit ff3a721

Please sign in to comment.