1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Refactor and modularize xattr read/write access

This commit is contained in:
Reinhard Pointner 2018-12-27 19:00:42 +07:00
parent 5cdf6e4311
commit 61b551a37b
2 changed files with 2 additions and 7 deletions

View File

@ -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 {

View File

@ -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<String> list() throws IOException {
if (Files.isDirectory(folder)) {