Permalink
Browse files

bf

  • Loading branch information...
1 parent 4fe3190 commit 5aa21d207c557b4faf0ea9aa869570af83088221 @woorea committed Jul 26, 2012
View
@@ -16,4 +16,5 @@ openstack-ui/src/main/webapp/ui/
openstack-ui/src/main/webapp/WEB-INF/lib/
openstack-ui/.gwt/
openstack-ui/deploy.sh
-test-output/
+test-output/
+bin
@@ -1,7 +1,6 @@
package org.openstack.nova.model;
import java.io.Serializable;
-import java.util.Calendar;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonRootName;
View
@@ -15,5 +15,10 @@
<artifactId>openstack-client</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.openstack</groupId>
+ <artifactId>swift-model</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
@@ -1,29 +1,29 @@
-package org.openstack.swift.api;
-
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.openstack.swift.SwiftCommand;
-import org.openstack.swift.model.ObjectForUpload;
-
-public class UploadObject implements SwiftCommand<Response>{
-
- private ObjectForUpload objectForUpload;
-
- public UploadObject(ObjectForUpload objectForUpload) {
- this.objectForUpload = objectForUpload;
- }
-
- @Override
- public Response execute(WebTarget target) {
- Invocation.Builder invocationBuilder = target.path(objectForUpload.getContainer()).path(objectForUpload.getName()).request(MediaType.APPLICATION_JSON);
- for(String key : objectForUpload.getProperties().keySet()) {
- invocationBuilder.header("x-object-meta-" + key, objectForUpload.getProperties().get(key));
- }
- return invocationBuilder.put(Entity.entity(objectForUpload.getInputStream(), MediaType.APPLICATION_OCTET_STREAM), Response.class);
- }
-
-}
+//package org.openstack.swift.api;
+//
+//import javax.ws.rs.client.Entity;
+//import javax.ws.rs.client.Invocation;
+//import javax.ws.rs.client.WebTarget;
+//import javax.ws.rs.core.MediaType;
+//import javax.ws.rs.core.Response;
+//
+//import org.openstack.swift.SwiftCommand;
+//import org.openstack.swift.model.ObjectForUpload;
+//
+//public class UploadObject implements SwiftCommand<Response>{
+//
+// private ObjectForUpload objectForUpload;
+//
+// public UploadObject(ObjectForUpload objectForUpload) {
+// this.objectForUpload = objectForUpload;
+// }
+//
+// @Override
+// public Response execute(WebTarget target) {
+// Invocation.Builder invocationBuilder = target.path(objectForUpload.getContainer()).path(objectForUpload.getName()).request(MediaType.APPLICATION_JSON);
+// for(String key : objectForUpload.getProperties().keySet()) {
+// invocationBuilder.header("x-object-meta-" + key, objectForUpload.getProperties().get(key));
+// }
+// return invocationBuilder.put(Entity.entity(objectForUpload.getInputStream(), MediaType.APPLICATION_OCTET_STREAM), Response.class);
+// }
+//
+//}
@@ -1,71 +0,0 @@
-package org.openstack.swift.model;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ObjectForUpload {
-
- private String container;
-
- private String name;
-
- private Map<String, Object> properties;
-
- private InputStream inputStream;
-
- /**
- * @return the container
- */
- public String getContainer() {
- return container;
- }
-
- /**
- * @param container the container to set
- */
- public void setContainer(String container) {
- this.container = container;
- }
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return the properties
- */
- public Map<String, Object> getProperties() {
- if(properties == null) {
- properties = new HashMap<String, Object>();
- }
- return properties;
- }
-
- /**
- * @return the inputStream
- */
- public InputStream getInputStream() {
- return inputStream;
- }
-
- /**
- * @param inputStream the inputStream to set
- */
- public void setInputStream(InputStream inputStream) {
- this.inputStream = inputStream;
- }
-
-
-
-}
@@ -5,6 +5,7 @@
import org.codehaus.jackson.annotate.JsonProperty;
+
public class Object implements Serializable {
private String subdir;
@@ -3,6 +3,7 @@
import java.io.InputStream;
+
public class ObjectDownload {
private Object object;
@@ -0,0 +1,72 @@
+//package org.openstack.swift.model;
+//
+//import java.io.InputStream;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//
+//public class ObjectForUpload {
+//
+// private String container;
+//
+// private String name;
+//
+// private Map<String, java.lang.Object> properties;
+//
+// private InputStream inputStream;
+//
+// /**
+// * @return the container
+// */
+// public String getContainer() {
+// return container;
+// }
+//
+// /**
+// * @param container the container to set
+// */
+// public void setContainer(String container) {
+// this.container = container;
+// }
+//
+// /**
+// * @return the name
+// */
+// public String getName() {
+// return name;
+// }
+//
+// /**
+// * @param name the name to set
+// */
+// public void setName(String name) {
+// this.name = name;
+// }
+//
+// /**
+// * @return the properties
+// */
+// public Map<String, java.lang.Object> getProperties() {
+// if(properties == null) {
+// properties = new HashMap<String, java.lang.Object>();
+// }
+// return properties;
+// }
+//
+// /**
+// * @return the inputStream
+// */
+// public InputStream getInputStream() {
+// return inputStream;
+// }
+//
+// /**
+// * @param inputStream the inputStream to set
+// */
+// public void setInputStream(InputStream inputStream) {
+// this.inputStream = inputStream;
+// }
+//
+//
+//
+//}

0 comments on commit 5aa21d2

Please sign in to comment.