BUG-2352: Remove RestMessageTools 75/16475/2
authorRobert Varga <rovarga@cisco.com>
Fri, 13 Mar 2015 11:03:35 +0000 (12:03 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 13 Mar 2015 11:13:02 +0000 (12:13 +0100)
This is a prototype implementation, whose sole method never worked.

Change-Id: Id7fa10ac7e541bac80173c40af3fd2b00e1586ab
Signed-off-by: Robert Varga <rovarga@cisco.com>
restconf/restconf-util/pom.xml
restconf/restconf-util/src/main/java/org/opendaylight/yangtools/restconf/utils/RestMessageTools.java [deleted file]

index eba3e4380ea75d138bd32154908da54618fa2f45..ffc1956c4bfb69da1775569ea6ba997311b5af0a 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-model-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
diff --git a/restconf/restconf-util/src/main/java/org/opendaylight/yangtools/restconf/utils/RestMessageTools.java b/restconf/restconf-util/src/main/java/org/opendaylight/yangtools/restconf/utils/RestMessageTools.java
deleted file mode 100644 (file)
index c0d6af5..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.restconf.utils;
-
-import com.sun.jersey.api.client.ClientResponse;
-import java.io.IOException;
-import java.io.StringWriter;
-import org.apache.commons.io.IOUtils;
-import org.opendaylight.yangtools.draft.Draft01;
-import org.opendaylight.yangtools.draft.Draft02;
-import org.opendaylight.yangtools.restconf.client.api.RestMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class RestMessageTools {
-
-    public static final String XML = "+xml";
-    public static final String JSON = "+json";
-    private static final Logger logger = LoggerFactory.getLogger(RestMessageTools.class.toString());
-
-    public RestMessage extractMessage(ClientResponse response){
-        RestMessage restMessage = null;
-        if (response.getType().equals(Draft01.MediaTypes.API+JSON) ||
-                response.getType().equals(Draft02.MediaTypes.API+JSON)){
-            //to be implemented
-        }
-        if (response.getType().equals(Draft01.MediaTypes.API+XML) ||
-                response.getType().equals(Draft02.MediaTypes.API+XML)){
-            StringWriter writer = new StringWriter();
-            try {
-                IOUtils.copy(response.getEntityInputStream(), writer, "UTF-8");
-            } catch (IOException e) {
-                logger.info("Error parsing XML file from response.");
-            }
-        }
-        return restMessage;
-    }
-}