From 61b551a37bdfd93f4e0d3d423905d7805b9801b9 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 27 Dec 2018 19:00:42 +0700 Subject: [PATCH] Refactor and modularize xattr read/write access --- source/net/filebot/platform/bsd/ExtAttrView.java | 3 +-- source/net/filebot/util/PlainFileXattrView.java | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/source/net/filebot/platform/bsd/ExtAttrView.java b/source/net/filebot/platform/bsd/ExtAttrView.java index 8d5a6d2c..df09399d 100644 --- a/source/net/filebot/platform/bsd/ExtAttrView.java +++ b/source/net/filebot/platform/bsd/ExtAttrView.java @@ -30,9 +30,8 @@ public class ExtAttrView implements XattrView { try { return execute("getextattr", "-q", "user", key, path).toString().trim(); } catch (IOException e) { - debug.finest(e::getMessage); + return null; } - return null; } public void write(String key, String value) throws IOException { diff --git a/source/net/filebot/util/PlainFileXattrView.java b/source/net/filebot/util/PlainFileXattrView.java index f3d7a685..94f4766b 100644 --- a/source/net/filebot/util/PlainFileXattrView.java +++ b/source/net/filebot/util/PlainFileXattrView.java @@ -12,7 +12,7 @@ import java.util.List; public class PlainFileXattrView implements XattrView { - public static final String XATTR_FOLDER = System.getProperty("net.filebot.xattr.store", ".xattr"); + private static final String XATTR_FOLDER = System.getProperty("net.filebot.xattr.store", ".xattr"); private final Path folder; @@ -20,10 +20,6 @@ public class PlainFileXattrView implements XattrView { folder = path.getParent().resolve(XATTR_FOLDER).resolve(path.getFileName()); } - public PlainFileXattrView(Path store, Path path) throws IOException { - folder = store.resolve(path); - } - @Override public List list() throws IOException { if (Files.isDirectory(folder)) {