You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/03/24 10:41:51 UTC
[02/50] [abbrv] git commit: Removing unused class
Removing unused class
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/be73bf6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/tree/be73bf6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/diff/be73bf6d
Branch: refs/heads/master
Commit: be73bf6d330992b8911e65d95405a87854532672
Parents: 9c5b6fe
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Mar 20 13:02:40 2014 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Mar 20 13:02:40 2014 +0100
----------------------------------------------------------------------
.../request/retrieve/ObjectWrapper.java | 150 -------------------
.../core/it/v3/EntityRetrieveTestITCase.java | 3 +-
2 files changed, 1 insertion(+), 152 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/be73bf6d/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ObjectWrapper.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ObjectWrapper.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ObjectWrapper.java
deleted file mode 100644
index 0637619..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ObjectWrapper.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.communication.request.retrieve;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import org.apache.commons.io.IOUtils;
-import org.apache.olingo.client.api.data.ODataError;
-import org.apache.olingo.client.api.domain.ODataEntity;
-import org.apache.olingo.client.api.domain.ODataEntitySet;
-import org.apache.olingo.client.api.domain.ODataEntitySetIterator;
-import org.apache.olingo.client.api.domain.ODataLinkCollection;
-import org.apache.olingo.client.api.domain.ODataProperty;
-import org.apache.olingo.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.client.api.domain.ODataValue;
-import org.apache.olingo.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.client.api.op.ODataReader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ObjectWrapper {
-
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(ObjectWrapper.class);
-
- private final ODataReader reader;
-
- private final byte[] obj;
-
- private final String format;
-
- /**
- * Constructor.
- *
- * @param is source input stream.
- * @param format source format (<tt>ODataPubFormat</tt>, <tt>ODataFormat</tt>, <tt>ODataValueFormat</tt>,
- * <tt>ODataServiceDocumentFormat</tt>).
- */
- public ObjectWrapper(final ODataReader reader, final InputStream is, final String format) {
- this.reader = reader;
- try {
- this.obj = IOUtils.toByteArray(is);
- this.format = format;
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- /**
- * Parses stream as <tt>ODataEntitySetIterator</tt>.
- *
- * I
- *
- * @return <tt>ODataEntitySetIterator</tt> if success; null otherwise.
- */
- public ODataEntitySetIterator getODataEntitySetIterator() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataEntitySetIterator.class);
- }
-
- /**
- * Parses stream as <tt>ODataEntitySet</tt>.
- *
- * @return <tt>ODataEntitySet</tt> if success; null otherwise.
- */
- public ODataEntitySet getODataEntitySet() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataEntitySet.class);
- }
-
- /**
- * Parses stream as <tt>ODataEntity</tt>.
- *
- * @return <tt>ODataEntity</tt> if success; null otherwise.
- */
- public ODataEntity getODataEntity() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataEntity.class);
- }
-
- /**
- * Parses stream as <tt>ODataProperty</tt>.
- *
- * @return <tt>ODataProperty</tt> if success; null otherwise.
- */
- public ODataProperty getODataProperty() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataProperty.class);
- }
-
- /**
- * Parses stream as <tt>ODataLinkCollection</tt>.
- *
- * @return <tt>ODataLinkCollection</tt> if success; null otherwise.
- */
- public ODataLinkCollection getODataLinkCollection() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataLinkCollection.class);
- }
-
- /**
- * Parses stream as <tt>ODataValue</tt>.
- *
- * @return <tt>ODataValue</tt> if success; null otherwise.
- */
- public ODataValue getODataValue() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataValue.class);
- }
-
- /**
- * Parses stream as <tt>EdmMetadata</tt>.
- *
- * @return <tt>EdmMetadata</tt> if success; null otherwise.
- */
- public XMLMetadata getEdmMetadata() {
- return reader.read(new ByteArrayInputStream(obj), null, XMLMetadata.class);
- }
-
- /**
- * Parses stream as <tt>ODataServiceDocument</tt>.
- *
- * @return <tt>ODataServiceDocument</tt> if success; null otherwise.
- */
- public ODataServiceDocument getODataServiceDocument() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataServiceDocument.class);
- }
-
- /**
- * Parses stream as <tt>ODataError</tt>.
- *
- * @return <tt>ODataError</tt> if success; null otherwise.
- */
- public ODataError getODataError() {
- return reader.read(new ByteArrayInputStream(obj), null, ODataError.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/be73bf6d/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityRetrieveTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityRetrieveTestITCase.java
index 15c55a5..a05562b 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityRetrieveTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityRetrieveTestITCase.java
@@ -30,7 +30,6 @@ import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRe
import org.apache.olingo.client.api.communication.request.retrieve.ODataRawRequest;
import org.apache.olingo.client.api.communication.response.ODataRawResponse;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
-import org.apache.olingo.client.core.communication.request.retrieve.ObjectWrapper;
import org.apache.olingo.client.api.domain.ODataEntity;
import org.apache.olingo.client.api.domain.ODataEntitySet;
import org.apache.olingo.client.api.domain.ODataInlineEntity;
@@ -152,7 +151,7 @@ public class EntityRetrieveTestITCase extends AbstractV3TestITCase {
final ODataRawResponse res = req.execute();
assertNotNull(res);
-
+
final ODataEntitySet entitySet = res.getBodyAs(ODataEntitySet.class);
assertNull(entitySet);