com.woorea.openstack.swift.api.ContainerResource Maven / Gradle / Ivy
package com.woorea.openstack.swift.api;
import java.util.Map;
import com.woorea.openstack.base.client.OpenStackClient;
import com.woorea.openstack.base.client.OpenStackRequest;
import com.woorea.openstack.base.client.OpenStackResponse;
import com.woorea.openstack.swift.model.ObjectDownload;
import com.woorea.openstack.swift.model.ObjectForUpload;
public class ContainerResource {
private final OpenStackClient CLIENT;
private String container;
public ContainerResource(OpenStackClient client, String container) {
CLIENT = client;
this.container = container;
}
public List list() {
return new List(container, null);
}
public CreateDirectory createDirectory(String path) {
return new CreateDirectory(container, path);
}
public Show show(String path) {
return new Show(container, path);
}
public Upload upload(ObjectForUpload objectForUpload) {
return new Upload(objectForUpload);
}
public Download download(String path) {
return new Download(container, path);
}
public Delete delete(String path) {
return new Delete(container, path);
}
public class List extends OpenStackRequest> {
private String containerName;
private Map filters;
public List(String containerName, Map filters) {
this.containerName = containerName;
this.filters = filters;
//returnType(new TypeToken>(){});
// target = target.path(containerName);
// for(String filter : new String[]{"prefix","delimiter","path","marker"}) {
// if(filters.get(filter) != null) {
// target = target.queryParam(filter, filters.get(filter));
// }
// }
// return target.request(MediaType.APPLICATION_JSON).get(new GenericType>(){});
}
}
public class CreateDirectory extends OpenStackRequest {
private String container;
private String path;
public CreateDirectory(String container, String path) {
this.container = container;
this.path = path;
// endpoint.path(container).path(path).request().put(Entity.entity(new byte[1],"application/directory"));
}
}
public class Show extends OpenStackRequest
© 2015 - 2025 Weber Informatics LLC | Privacy Policy