From c3a9b2d15cd955e10ad752513f15fcc2dda520fe Mon Sep 17 00:00:00 2001 From: lresende Date: Fri, 31 Oct 2008 23:27:42 +0000 Subject: Removing unnecessary abdera dependency. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@709599 13f79535-47bb-0310-9956-ffa450edef68 --- .../binding-gdata-runtime/META-INF/MANIFEST.MF | 1 - .../modules/binding-gdata-runtime/pom.xml | 6 --- .../provider/GdataBindingListenerServlet.java | 47 ++++++++-------------- 3 files changed, 17 insertions(+), 37 deletions(-) diff --git a/branches/sca-equinox/modules/binding-gdata-runtime/META-INF/MANIFEST.MF b/branches/sca-equinox/modules/binding-gdata-runtime/META-INF/MANIFEST.MF index dd0504b051..2d026b6b5f 100644 --- a/branches/sca-equinox/modules/binding-gdata-runtime/META-INF/MANIFEST.MF +++ b/branches/sca-equinox/modules/binding-gdata-runtime/META-INF/MANIFEST.MF @@ -22,7 +22,6 @@ Import-Package: com.google.gdata.client, javax.servlet.http, javax.xml.namespace, junit.framework;resolution:=optional, - org.apache.abdera.parser, org.apache.commons.codec.binary, org.apache.commons.httpclient, org.apache.commons.httpclient.auth, diff --git a/branches/sca-equinox/modules/binding-gdata-runtime/pom.xml b/branches/sca-equinox/modules/binding-gdata-runtime/pom.xml index 04af5aad39..221b007988 100644 --- a/branches/sca-equinox/modules/binding-gdata-runtime/pom.xml +++ b/branches/sca-equinox/modules/binding-gdata-runtime/pom.xml @@ -72,12 +72,6 @@ 1.4-SNAPSHOT - - org.apache.abdera - abdera-core - 0.4.0-incubating - - commons-httpclient commons-httpclient diff --git a/branches/sca-equinox/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java b/branches/sca-equinox/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java index 5259df15b8..4fa89fc634 100644 --- a/branches/sca-equinox/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java +++ b/branches/sca-equinox/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java @@ -38,8 +38,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.namespace.QName; -import org.apache.abdera.parser.ParseException; - import org.apache.commons.codec.binary.Base64; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.databinding.Mediator; @@ -56,6 +54,7 @@ import org.apache.tuscany.sca.runtime.RuntimeWire; import com.google.gdata.data.ExtensionProfile; import com.google.gdata.data.ParseSource; import com.google.gdata.data.PlainTextConstruct; +import com.google.gdata.util.ParseException; import com.google.gdata.util.ServiceException; @@ -414,14 +413,10 @@ class GdataBindingListenerServlet extends HttpServlet { try { ParseSource source = new ParseSource(request.getReader()); feedEntry = com.google.gdata.data.Entry.readEntry(source, com.google.gdata.data.Entry.class, null); - } catch (ParseException pe) { + } catch (com.google.gdata.util.ParseException pe) { throw new ServletException(pe); - } catch (com.google.gdata.util.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); } catch (ServiceException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + throw new ServletException(e); } // Let the component implementation create it @@ -486,26 +481,21 @@ class GdataBindingListenerServlet extends HttpServlet { // Write the created Atom entry response.setStatus(HttpServletResponse.SC_CREATED); response.setContentType("application/atom+xml; charset=utf-8"); - try { - - // Generate the corresponding Atom representation of the - // feed - StringWriter stringWriter = new StringWriter(); - com.google.gdata.util.common.xml.XmlWriter w = - new com.google.gdata.util.common.xml.XmlWriter(stringWriter); - createdFeedEntry.generateAtom(w, new ExtensionProfile()); - w.flush(); - // Write the Atom representation(XML) into Http response - // content - OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream()); - PrintWriter out = new PrintWriter(response.getOutputStream()); - out.println(stringWriter.toString()); - out.close(); + // Generate the corresponding Atom representation of the + // feed + StringWriter stringWriter = new StringWriter(); + com.google.gdata.util.common.xml.XmlWriter w = + new com.google.gdata.util.common.xml.XmlWriter(stringWriter); + createdFeedEntry.generateAtom(w, new ExtensionProfile()); + w.flush(); - } catch (ParseException pe) { - throw new ServletException(pe); - } + // Write the Atom representation(XML) into Http response + // content + OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream()); + PrintWriter out = new PrintWriter(response.getOutputStream()); + out.println(stringWriter.toString()); + out.close(); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND); @@ -551,11 +541,8 @@ class GdataBindingListenerServlet extends HttpServlet { feedEntry = com.google.gdata.data.Entry.readEntry(source, com.google.gdata.data.Entry.class, null); System.out.println("[Debug Info] localServlet doPut --- feedEntry title: " + feedEntry.getTitle().getPlainText()); - } catch (ParseException pe) { + } catch (com.google.gdata.util.ParseException pe) { throw new ServletException(pe); - } catch (com.google.gdata.util.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); -- cgit v1.2.3