r6988 - dumbhippo/trunk/server/src/com/dumbhippo/web/servlets
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r6988 - dumbhippo/trunk/server/src/com/dumbhippo/web/servlets
- Date: Fri, 7 Dec 2007 14:27:09 -0600 (CST)
Author: marinaz
Date: 2007-12-07 14:27:04 -0600 (Fri, 07 Dec 2007)
New Revision: 6988
Modified:
dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java
Log:
Change the call to DocumentBuilder.parse() to take an InputStream instead of a String.
The constructor that takes a String expects it to be a URI.
Modified: dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java 2007-12-07 01:22:21 UTC (rev 6987)
+++ dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java 2007-12-07 20:27:04 UTC (rev 6988)
@@ -1,5 +1,6 @@
package com.dumbhippo.web.servlets;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -148,7 +149,7 @@
if (entry.getKey().equals(ExternalAccountType.FLICKR)) {
XmlBuilder xmlForFlickr = new XmlBuilder();
httpMethods.doFindFlickrAccount(xmlForFlickr, userViewpoint, entryValue);
- Document doc = factory.newDocumentBuilder().parse(xmlForFlickr.toString());
+ Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(xmlForFlickr.getBytes()));
XPath xpath = XPathFactory.newInstance().newXPath();
String nsid = xpath.evaluate("/flickrUser/nsid", doc, XPathConstants.NODE).toString();
logger.debug("Got nsid {} when setting Flickr account", nsid);
@@ -160,7 +161,7 @@
// we have messages telling the user about certain limitations of their account
// for MySpace, Twitter, Reddit, and Amazon
try {
- Document doc = factory.newDocumentBuilder().parse(resultXml.toString());
+ Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(resultXml.getBytes()));
XPath xpath = XPathFactory.newInstance().newXPath();
String message = xpath.evaluate("/message", doc, XPathConstants.NODE).toString();
if (message.trim().length() > 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]