olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [20/21] git commit: Cleanup
Date Thu, 20 Mar 2014 10:27:14 GMT
Cleanup


Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/commit/eae72e80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/tree/eae72e80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/diff/eae72e80

Branch: refs/heads/olingo200
Commit: eae72e80c512ba42062e5a0c193116ed6905d317
Parents: 7b91300
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Thu Mar 20 09:42:21 2014 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Thu Mar 20 09:42:21 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/olingo/fit/utils/FSManager.java |  4 ----
 .../olingo/client/core/data/AtomSerializer.java     | 16 ++++++++++------
 .../core/op/impl/AbstractODataDeserializer.java     |  7 ++++++-
 3 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/eae72e80/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
index d368da9..519b73d 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
@@ -70,7 +70,6 @@ public class FSManager {
   }
 
   public FileObject putInMemory(final InputStream is, final String path) throws IOException
{
-    System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA scrivo "+path);
     final FileObject memObject = fsManager.resolveFile(MEM_PREFIX + path);
 
     if (memObject.exists()) {
@@ -86,9 +85,6 @@ public class FSManager {
     IOUtils.closeQuietly(is);
     IOUtils.closeQuietly(os);
     
-    System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA inserito valore "+
-            IOUtils.toString(memObject.getContent().getInputStream()));
-
     return memObject;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/eae72e80/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AtomSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AtomSerializer.java
b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AtomSerializer.java
index 8f2a41c..3b66c60 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AtomSerializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AtomSerializer.java
@@ -131,9 +131,11 @@ public class AtomSerializer extends AbstractAtomDealer {
       writer.writeAttribute(XMLConstants.XML_NS_URI, Constants.ATTR_XML_BASE, entry.getBaseURI().toASCIIString());
     }
 
-    writer.writeStartElement(Constants.ATOM_ELEM_ID);
-    writer.writeCharacters(entry.getId());
-    writer.writeEndElement();
+    if (StringUtils.isNotBlank(entry.getId())) {
+      writer.writeStartElement(Constants.ATOM_ELEM_ID);
+      writer.writeCharacters(entry.getId());
+      writer.writeEndElement();
+    }
 
     writer.writeStartElement(Constants.ATOM_ELEM_CATEGORY);
     writer.writeAttribute(Constants.ATOM_ATTR_SCHEME, version.getNamespaceMap().get(ODataServiceVersion.NS_SCHEME));
@@ -193,9 +195,11 @@ public class AtomSerializer extends AbstractAtomDealer {
       writer.writeEndElement();
     }
 
-    writer.writeStartElement(Constants.ATOM_ELEM_ID);
-    writer.writeCharacters(feed.getId());
-    writer.writeEndElement();
+    if (StringUtils.isNotBlank(feed.getId())) {
+      writer.writeStartElement(Constants.ATOM_ELEM_ID);
+      writer.writeCharacters(feed.getId());
+      writer.writeEndElement();
+    }
 
     if (feed instanceof AbstractAtomObject) {
       common(writer, (AbstractAtomObject) feed);

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/eae72e80/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java
b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java
index 14357cb..fdbd07d 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java
@@ -18,7 +18,9 @@
  */
 package org.apache.olingo.client.core.op.impl;
 
+import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.data.Entry;
 import org.apache.olingo.client.api.data.Error;
@@ -108,7 +110,10 @@ public abstract class AbstractODataDeserializer extends AbstractJacksonTool
impl
 
   protected <T> T json(final InputStream input, final Class<T> reference) {
     try {
-      return getObjectMapper().readValue(input, reference);
+      String maz = IOUtils.toString(input);
+      ByteArrayInputStream bais = new ByteArrayInputStream(maz.getBytes());
+    System.out.println("KKKKKKKKKKKKKKKKKK\n" + maz);
+      return getObjectMapper().readValue(bais, reference);
     } catch (Exception e) {
       throw new IllegalArgumentException("While deserializing " + reference.getName(), e);
     }


Mime
View raw message