mirror of https://github.com/apache/jclouds.git
JCLOUDS-1218: filesystem get blob without xattrs
Some filesystems, notably Docker and Mac OS X, do not support xattr which causes an IOException when getting a blob.
This commit is contained in:
parent
f76c09cbe6
commit
f210283cac
|
@ -346,6 +346,7 @@ public class FilesystemStorageStrategyImpl implements LocalStorageStrategy {
|
|||
|
||||
UserDefinedFileAttributeView view = getUserDefinedFileAttributeView(file.toPath());
|
||||
if (view != null) {
|
||||
try {
|
||||
Set<String> attributes = ImmutableSet.copyOf(view.list());
|
||||
|
||||
cacheControl = readStringAttributeIfPresent(view, attributes, XATTR_CACHE_CONTROL);
|
||||
|
@ -374,6 +375,9 @@ public class FilesystemStorageStrategyImpl implements LocalStorageStrategy {
|
|||
String value = readStringAttributeIfPresent(view, attributes, attribute);
|
||||
userMetadata.put(attribute.substring(XATTR_USER_METADATA_PREFIX.length()), value);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.debug("xattrs not supported on %s", file.toPath());
|
||||
}
|
||||
|
||||
builder.payload(byteSource)
|
||||
.cacheControl(cacheControl)
|
||||
|
|
Loading…
Reference in New Issue