mirror of https://github.com/apache/jclouds.git
don't remove directory if it's a blob
the filesystem blob store was always removing a/ when a/b was removed, even if the client explicitly created a/. this patch fixes that
This commit is contained in:
parent
2dd231b02b
commit
ca70d44143
|
@ -794,6 +794,16 @@ public class FilesystemStorageStrategyImpl implements LocalStorageStrategy {
|
||||||
if (!isNullOrEmpty(parentPath)) {
|
if (!isNullOrEmpty(parentPath)) {
|
||||||
// remove parent directory only it's empty
|
// remove parent directory only it's empty
|
||||||
File directory = new File(buildPathStartingFromBaseDir(container, parentPath));
|
File directory = new File(buildPathStartingFromBaseDir(container, parentPath));
|
||||||
|
// don't delete directory if it's a directory blob
|
||||||
|
try {
|
||||||
|
UserDefinedFileAttributeView view = getUserDefinedFileAttributeView(directory.toPath());
|
||||||
|
if (!view.list().isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.debug("Could not look for attributes from %s: %s", directory, e);
|
||||||
|
}
|
||||||
|
|
||||||
String[] children = directory.list();
|
String[] children = directory.list();
|
||||||
if (null == children || children.length == 0) {
|
if (null == children || children.length == 0) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue