Cache xattr values so that metadata works as expected at least for the current session even if xattr is not supported by the filesystem and thus metadata can't be persisted
This commit is contained in:
parent
d70e82401e
commit
8d35a67d71
|
@ -54,8 +54,7 @@ public class XattrMetaInfo {
|
|||
|
||||
public synchronized Object getMetaInfo(File file) {
|
||||
return getCachedValue(xattrMetaInfoCache, file, key -> {
|
||||
Object metadata = xattr(file).getObject();
|
||||
return isMetaInfo(metadata) ? metadata : null;
|
||||
return xattr(file).getObject();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -108,12 +107,15 @@ public class XattrMetaInfo {
|
|||
try {
|
||||
if (isMetaInfo(model)) {
|
||||
xattrMetaInfoCache.put(file, model);
|
||||
|
||||
if (useExtendedFileAttributes) {
|
||||
xattr.get().setObject(model);
|
||||
}
|
||||
}
|
||||
|
||||
if (original != null && original.length() > 0 && getOriginalName(file) == null) {
|
||||
xattrOriginalNameCache.put(file, original);
|
||||
|
||||
if (useExtendedFileAttributes) {
|
||||
xattr.get().setOriginalName(original);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue