Skip to content

Commit 6847b42

Browse files
committed
Issue #490
1 parent 278bbc5 commit 6847b42

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageContainerServiceImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@
77
import static org.openstack4j.model.storage.object.SwiftHeaders.CONTAINER_METADATA_PREFIX;
88
import static org.openstack4j.model.storage.object.SwiftHeaders.CONTAINER_REMOVE_METADATA_PREFIX;
99

10-
import java.io.ByteArrayInputStream;
1110
import java.util.List;
1211
import java.util.Map;
1312

1413
import org.openstack4j.api.Apis;
1514
import org.openstack4j.api.storage.ObjectStorageContainerService;
1615
import org.openstack4j.api.storage.ObjectStorageObjectService;
1716
import org.openstack4j.core.transport.HttpResponse;
18-
import org.openstack4j.model.common.Payload;
19-
import org.openstack4j.model.common.Payloads;
2017
import org.openstack4j.model.compute.ActionResponse;
2118
import org.openstack4j.model.storage.object.SwiftContainer;
2219
import org.openstack4j.model.storage.object.options.ContainerListOptions;
@@ -77,8 +74,7 @@ public ActionResponse create(String name, CreateUpdateContainerOptions options)
7774
public String createPath(String containerName, String path) {
7875
checkNotNull(containerName);
7976
checkNotNull(path);
80-
Payload<?> pl = Payloads.create(new ByteArrayInputStream(new byte[]{}));
81-
return Apis.get(ObjectStorageObjectService.class).put(containerName, path, pl,
77+
return Apis.get(ObjectStorageObjectService.class).put(containerName, path, null,
8278
ObjectPutOptions.create().contentType(CONTENT_TYPE_DIRECTORY));
8379
}
8480

core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ public String put(String containerName, String name, Payload<?> payload) {
111111
@Override
112112
public String put(String containerName, String name, Payload<?> payload, ObjectPutOptions options) {
113113
checkNotNull(containerName);
114-
checkNotNull(payload);
115114
checkNotNull(options);
116115

117-
if (FilePayload.class.isAssignableFrom(payload.getClass()) && name == null)
116+
if (payload != null && FilePayload.class.isAssignableFrom(payload.getClass()) && name == null)
118117
name = FilePayload.class.cast(payload).getRaw().getName();
119118
else
120119
checkNotNull(name);

0 commit comments

Comments
 (0)