mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Refactor and modularize xattr read/write access
This commit is contained in:
parent
5cdf6e4311
commit
61b551a37b
@ -30,10 +30,9 @@ public class ExtAttrView implements XattrView {
|
||||
try {
|
||||
return execute("getextattr", "-q", "user", key, path).toString().trim();
|
||||
} catch (IOException e) {
|
||||
debug.finest(e::getMessage);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void write(String key, String value) throws IOException {
|
||||
execute("setextattr", "-q", "user", key, value, path);
|
||||
|
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user