|
|
@ -1,19 +1,19 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* This file is part of Transdroid <http://www.transdroid.org>
|
|
|
|
* This file is part of Transdroid <http://www.transdroid.org>
|
|
|
|
* |
|
|
|
* |
|
|
|
* Transdroid is free software: you can redistribute it and/or modify |
|
|
|
* Transdroid is free software: you can redistribute it and/or modify |
|
|
|
* it under the terms of the GNU General Public License as published by |
|
|
|
* it under the terms of the GNU General Public License as published by |
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
|
|
|
* (at your option) any later version. |
|
|
|
* (at your option) any later version. |
|
|
|
* |
|
|
|
* |
|
|
|
* Transdroid is distributed in the hope that it will be useful, |
|
|
|
* Transdroid is distributed in the hope that it will be useful, |
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
* GNU General Public License for more details. |
|
|
|
* GNU General Public License for more details. |
|
|
|
* |
|
|
|
* |
|
|
|
* You should have received a copy of the GNU General Public License |
|
|
|
* You should have received a copy of the GNU General Public License |
|
|
|
* along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.transdroid.daemon.Vuze; |
|
|
|
package org.transdroid.daemon.Vuze; |
|
|
|
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; |
|
|
|
import org.apache.http.params.HttpConnectionParams; |
|
|
|
import org.apache.http.params.HttpConnectionParams; |
|
|
|
import org.apache.http.params.HttpParams; |
|
|
|
import org.apache.http.params.HttpParams; |
|
|
|
import org.apache.http.params.HttpProtocolParams; |
|
|
|
import org.apache.http.params.HttpProtocolParams; |
|
|
|
import org.base64.android.Base64; |
|
|
|
import net.iharder.Base64; |
|
|
|
import org.transdroid.daemon.DaemonException; |
|
|
|
import org.transdroid.daemon.DaemonException; |
|
|
|
import org.transdroid.daemon.DaemonSettings; |
|
|
|
import org.transdroid.daemon.DaemonSettings; |
|
|
|
import org.transdroid.daemon.DaemonException.ExceptionType; |
|
|
|
import org.transdroid.daemon.DaemonException.ExceptionType; |
|
|
@ -56,16 +56,16 @@ import org.xmlpull.v1.XmlSerializer; |
|
|
|
import android.util.Xml; |
|
|
|
import android.util.Xml; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Implements an XML-RPC-like client that build and parses XML following |
|
|
|
* Implements an XML-RPC-like client that build and parses XML following |
|
|
|
* Vuze's XML over HTTP plug-in (which unfortunately is incompatible with |
|
|
|
* Vuze's XML over HTTP plug-in (which unfortunately is incompatible with |
|
|
|
* the default XML-RPC protocol). |
|
|
|
* the default XML-RPC protocol). |
|
|
|
* |
|
|
|
* |
|
|
|
* The documentation can be found at http://azureus.sourceforge.net/plugin_details.php?plugin=xml_http_if&docu=1#1
|
|
|
|
* The documentation can be found at http://azureus.sourceforge.net/plugin_details.php?plugin=xml_http_if&docu=1#1
|
|
|
|
* and some stuff is at http://wiki.vuze.com/index.php/XML_over_HTTP
|
|
|
|
* and some stuff is at http://wiki.vuze.com/index.php/XML_over_HTTP
|
|
|
|
* |
|
|
|
* |
|
|
|
* A lot of it is copied from the org.xmlrpc.android library's XMLRPCClient |
|
|
|
* A lot of it is copied from the org.xmlrpc.android library's XMLRPCClient |
|
|
|
* as can be found at http://code.google.com/p/android-xmlrpc
|
|
|
|
* as can be found at http://code.google.com/p/android-xmlrpc
|
|
|
|
* |
|
|
|
* |
|
|
|
* @author erickok |
|
|
|
* @author erickok |
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -87,7 +87,7 @@ public class VuzeXmlOverHttpClient { |
|
|
|
private final static String TAG_ANNOUNCE = "announce_result"; |
|
|
|
private final static String TAG_ANNOUNCE = "announce_result"; |
|
|
|
private final static String TAG_SCRAPE = "scrape_result"; |
|
|
|
private final static String TAG_SCRAPE = "scrape_result"; |
|
|
|
private final static String TAG_CACHED_PROPERTY_NAMES = "cached_property_names"; |
|
|
|
private final static String TAG_CACHED_PROPERTY_NAMES = "cached_property_names"; |
|
|
|
|
|
|
|
|
|
|
|
private DefaultHttpClient client; |
|
|
|
private DefaultHttpClient client; |
|
|
|
private HttpPost postMethod; |
|
|
|
private HttpPost postMethod; |
|
|
|
private Random random; |
|
|
|
private Random random; |
|
|
@ -105,14 +105,14 @@ public class VuzeXmlOverHttpClient { |
|
|
|
postMethod.addHeader("Content-Type", "text/xml"); |
|
|
|
postMethod.addHeader("Content-Type", "text/xml"); |
|
|
|
|
|
|
|
|
|
|
|
// WARNING
|
|
|
|
// WARNING
|
|
|
|
// I had to disable "Expect: 100-Continue" header since I had
|
|
|
|
// I had to disable "Expect: 100-Continue" header since I had
|
|
|
|
// two second delay between sending http POST request and POST body
|
|
|
|
// two second delay between sending http POST request and POST body
|
|
|
|
HttpParams httpParams = postMethod.getParams(); |
|
|
|
HttpParams httpParams = postMethod.getParams(); |
|
|
|
HttpProtocolParams.setUseExpectContinue(httpParams, false); |
|
|
|
HttpProtocolParams.setUseExpectContinue(httpParams, false); |
|
|
|
|
|
|
|
|
|
|
|
HttpConnectionParams.setConnectionTimeout(httpParams, settings.getTimeoutInMilliseconds()); |
|
|
|
HttpConnectionParams.setConnectionTimeout(httpParams, settings.getTimeoutInMilliseconds()); |
|
|
|
HttpConnectionParams.setSoTimeout(httpParams, settings.getTimeoutInMilliseconds()); |
|
|
|
HttpConnectionParams.setSoTimeout(httpParams, settings.getTimeoutInMilliseconds()); |
|
|
|
|
|
|
|
|
|
|
|
SchemeRegistry registry = new SchemeRegistry(); |
|
|
|
SchemeRegistry registry = new SchemeRegistry(); |
|
|
|
SocketFactory httpsSocketFactory; |
|
|
|
SocketFactory httpsSocketFactory; |
|
|
|
if (settings.getSslTrustKey() != null) { |
|
|
|
if (settings.getSslTrustKey() != null) { |
|
|
@ -124,7 +124,7 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} |
|
|
|
} |
|
|
|
registry.register(new Scheme("http", new PlainSocketFactory(), 80)); |
|
|
|
registry.register(new Scheme("http", new PlainSocketFactory(), 80)); |
|
|
|
registry.register(new Scheme("https", httpsSocketFactory, 443)); |
|
|
|
registry.register(new Scheme("https", httpsSocketFactory, 443)); |
|
|
|
|
|
|
|
|
|
|
|
client = new DefaultHttpClient(new ThreadSafeClientConnManager(httpParams, registry), httpParams); |
|
|
|
client = new DefaultHttpClient(new ThreadSafeClientConnManager(httpParams, registry), httpParams); |
|
|
|
if (settings.shouldUseAuthentication()) { |
|
|
|
if (settings.shouldUseAuthentication()) { |
|
|
|
if (settings.getUsername() == null || settings.getPassword() == null) { |
|
|
|
if (settings.getUsername() == null || settings.getPassword() == null) { |
|
|
@ -137,11 +137,11 @@ public class VuzeXmlOverHttpClient { |
|
|
|
new UsernamePasswordCredentials(username, password)); |
|
|
|
new UsernamePasswordCredentials(username, password)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
random = new Random(); |
|
|
|
random = new Random(); |
|
|
|
random.nextInt(); |
|
|
|
random.nextInt(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Convenience constructor. Creates new instance based on server String address |
|
|
|
* Convenience constructor. Creates new instance based on server String address |
|
|
|
* @param settings The server connection settings |
|
|
|
* @param settings The server connection settings |
|
|
@ -151,23 +151,23 @@ public class VuzeXmlOverHttpClient { |
|
|
|
public VuzeXmlOverHttpClient(DaemonSettings settings, String url) throws DaemonException { |
|
|
|
public VuzeXmlOverHttpClient(DaemonSettings settings, String url) throws DaemonException { |
|
|
|
this(settings, URI.create(url)); |
|
|
|
this(settings, URI.create(url)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Map<String, Object> callXMLRPC(Long object, String method, Object[] params, Long connectionID, boolean paramsAreVuzeObjects) throws DaemonException { |
|
|
|
protected Map<String, Object> callXMLRPC(Long object, String method, Object[] params, Long connectionID, boolean paramsAreVuzeObjects) throws DaemonException { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
// prepare POST body
|
|
|
|
// prepare POST body
|
|
|
|
XmlSerializer serializer = Xml.newSerializer(); |
|
|
|
XmlSerializer serializer = Xml.newSerializer(); |
|
|
|
StringWriter bodyWriter = new StringWriter(); |
|
|
|
StringWriter bodyWriter = new StringWriter(); |
|
|
|
serializer.setOutput(bodyWriter); |
|
|
|
serializer.setOutput(bodyWriter); |
|
|
|
serializer.startDocument(null, null); |
|
|
|
serializer.startDocument(null, null); |
|
|
|
serializer.startTag(null, TAG_REQUEST); |
|
|
|
serializer.startTag(null, TAG_REQUEST); |
|
|
|
|
|
|
|
|
|
|
|
// set object
|
|
|
|
// set object
|
|
|
|
if (object != null) { |
|
|
|
if (object != null) { |
|
|
|
serializer.startTag(null, TAG_OBJECT).startTag(null, TAG_OBJECT_ID) |
|
|
|
serializer.startTag(null, TAG_OBJECT).startTag(null, TAG_OBJECT_ID) |
|
|
|
.text(object.toString()).endTag(null, TAG_OBJECT_ID).endTag(null, TAG_OBJECT); |
|
|
|
.text(object.toString()).endTag(null, TAG_OBJECT_ID).endTag(null, TAG_OBJECT); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// set method
|
|
|
|
// set method
|
|
|
|
serializer.startTag(null, TAG_METHOD).text(method).endTag(null, TAG_METHOD); |
|
|
|
serializer.startTag(null, TAG_METHOD).text(method).endTag(null, TAG_METHOD); |
|
|
|
if (params != null && params.length != 0) { |
|
|
|
if (params != null && params.length != 0) { |
|
|
@ -188,7 +188,7 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} |
|
|
|
} |
|
|
|
serializer.endTag(null, TAG_PARAMS); |
|
|
|
serializer.endTag(null, TAG_PARAMS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// set connection id
|
|
|
|
// set connection id
|
|
|
|
if (connectionID != null) { |
|
|
|
if (connectionID != null) { |
|
|
|
serializer.startTag(null, TAG_CONNECTION_ID).text(connectionID.toString()).endTag(null, TAG_CONNECTION_ID); |
|
|
|
serializer.startTag(null, TAG_CONNECTION_ID).text(connectionID.toString()).endTag(null, TAG_CONNECTION_ID); |
|
|
@ -199,16 +199,16 @@ public class VuzeXmlOverHttpClient { |
|
|
|
|
|
|
|
|
|
|
|
serializer.endTag(null, TAG_REQUEST); |
|
|
|
serializer.endTag(null, TAG_REQUEST); |
|
|
|
serializer.endDocument(); |
|
|
|
serializer.endDocument(); |
|
|
|
|
|
|
|
|
|
|
|
// set POST body
|
|
|
|
// set POST body
|
|
|
|
HttpEntity entity = new StringEntity(bodyWriter.toString()); |
|
|
|
HttpEntity entity = new StringEntity(bodyWriter.toString()); |
|
|
|
postMethod.setEntity(entity); |
|
|
|
postMethod.setEntity(entity); |
|
|
|
|
|
|
|
|
|
|
|
// Force preemptive authentication
|
|
|
|
// Force preemptive authentication
|
|
|
|
// This makes sure there is an 'Authentication: ' header being send before trying and failing and retrying
|
|
|
|
// This makes sure there is an 'Authentication: ' header being send before trying and failing and retrying
|
|
|
|
// by the basic authentication mechanism of DefaultHttpClient
|
|
|
|
// by the basic authentication mechanism of DefaultHttpClient
|
|
|
|
postMethod.addHeader("Authorization", "Basic " + Base64.encodeBytes((username + ":" + password).getBytes())); |
|
|
|
postMethod.addHeader("Authorization", "Basic " + Base64.encodeBytes((username + ":" + password).getBytes())); |
|
|
|
|
|
|
|
|
|
|
|
// execute HTTP POST request
|
|
|
|
// execute HTTP POST request
|
|
|
|
HttpResponse response = client.execute(postMethod); |
|
|
|
HttpResponse response = client.execute(postMethod); |
|
|
|
|
|
|
|
|
|
|
@ -225,33 +225,33 @@ public class VuzeXmlOverHttpClient { |
|
|
|
// setup pull parser
|
|
|
|
// setup pull parser
|
|
|
|
XmlPullParser pullParser = XmlPullParserFactory.newInstance().newPullParser(); |
|
|
|
XmlPullParser pullParser = XmlPullParserFactory.newInstance().newPullParser(); |
|
|
|
entity = response.getEntity(); |
|
|
|
entity = response.getEntity(); |
|
|
|
//String temp = HttpHelper.ConvertStreamToString(entity.getContent());
|
|
|
|
//String temp = HttpHelper.ConvertStreamToString(entity.getContent());
|
|
|
|
//Reader reader = new StringReader(temp);
|
|
|
|
//Reader reader = new StringReader(temp);
|
|
|
|
Reader reader = new InputStreamReader(entity.getContent()); |
|
|
|
Reader reader = new InputStreamReader(entity.getContent()); |
|
|
|
pullParser.setInput(reader); |
|
|
|
pullParser.setInput(reader); |
|
|
|
|
|
|
|
|
|
|
|
// lets start pulling...
|
|
|
|
// lets start pulling...
|
|
|
|
pullParser.nextTag(); |
|
|
|
pullParser.nextTag(); |
|
|
|
pullParser.require(XmlPullParser.START_TAG, null, TAG_RESPONSE); |
|
|
|
pullParser.require(XmlPullParser.START_TAG, null, TAG_RESPONSE); |
|
|
|
|
|
|
|
|
|
|
|
// build list of returned values
|
|
|
|
// build list of returned values
|
|
|
|
int next = pullParser.nextTag(); // skip to first start tag in list
|
|
|
|
int next = pullParser.nextTag(); // skip to first start tag in list
|
|
|
|
String name = pullParser.getName(); // get name of the first start tag
|
|
|
|
String name = pullParser.getName(); // get name of the first start tag
|
|
|
|
|
|
|
|
|
|
|
|
// Empty response?
|
|
|
|
// Empty response?
|
|
|
|
if (next == XmlPullParser.END_TAG && name.equals(TAG_RESPONSE)) { |
|
|
|
if (next == XmlPullParser.END_TAG && name.equals(TAG_RESPONSE)) { |
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
} else if (name.equals(TAG_ERROR)) { |
|
|
|
} else if (name.equals(TAG_ERROR)) { |
|
|
|
|
|
|
|
|
|
|
|
// Error
|
|
|
|
// Error
|
|
|
|
String errorText = pullParser.nextText(); // the value of the ERROR
|
|
|
|
String errorText = pullParser.nextText(); // the value of the ERROR
|
|
|
|
entity.consumeContent(); |
|
|
|
entity.consumeContent(); |
|
|
|
throw new DaemonException(ExceptionType.ConnectionError, errorText); |
|
|
|
throw new DaemonException(ExceptionType.ConnectionError, errorText); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
// Consume a list of ENTRYs?
|
|
|
|
// Consume a list of ENTRYs?
|
|
|
|
if (name.equals(TAG_ENTRY)) { |
|
|
|
if (name.equals(TAG_ENTRY)) { |
|
|
|
|
|
|
|
|
|
|
@ -262,15 +262,15 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} |
|
|
|
} |
|
|
|
entity.consumeContent(); |
|
|
|
entity.consumeContent(); |
|
|
|
return entries; |
|
|
|
return entries; |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
// Only a single object was returned, not an entry listing
|
|
|
|
// Only a single object was returned, not an entry listing
|
|
|
|
return consumeObject(pullParser); |
|
|
|
return consumeObject(pullParser); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
throw new DaemonException(ExceptionType.ConnectionError, e.toString()); |
|
|
|
throw new DaemonException(ExceptionType.ConnectionError, e.toString()); |
|
|
|
} catch (XmlPullParserException e) { |
|
|
|
} catch (XmlPullParserException e) { |
|
|
@ -282,11 +282,11 @@ public class VuzeXmlOverHttpClient { |
|
|
|
|
|
|
|
|
|
|
|
int next = pullParser.nextTag(); |
|
|
|
int next = pullParser.nextTag(); |
|
|
|
String name = pullParser.getName(); |
|
|
|
String name = pullParser.getName(); |
|
|
|
|
|
|
|
|
|
|
|
// Consume the ENTRY objects
|
|
|
|
// Consume the ENTRY objects
|
|
|
|
Map<String, Object> returnValues = new HashMap<String, Object>(); |
|
|
|
Map<String, Object> returnValues = new HashMap<String, Object>(); |
|
|
|
while (next == XmlPullParser.START_TAG) { |
|
|
|
while (next == XmlPullParser.START_TAG) { |
|
|
|
|
|
|
|
|
|
|
|
if (name.equals(TAG_TORRENT) || name.equals(TAG_ANNOUNCE) || name.equals(TAG_SCRAPE) || name.equals(TAG_STATS)) { |
|
|
|
if (name.equals(TAG_TORRENT) || name.equals(TAG_ANNOUNCE) || name.equals(TAG_SCRAPE) || name.equals(TAG_STATS)) { |
|
|
|
// One of the objects contained inside an entry
|
|
|
|
// One of the objects contained inside an entry
|
|
|
|
pullParser.nextTag(); |
|
|
|
pullParser.nextTag(); |
|
|
@ -297,21 +297,21 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} |
|
|
|
} |
|
|
|
next = pullParser.nextTag(); // skip to next start tag
|
|
|
|
next = pullParser.nextTag(); // skip to next start tag
|
|
|
|
name = pullParser.getName(); // get name of the new start tag
|
|
|
|
name = pullParser.getName(); // get name of the new start tag
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Consume ENTRY ending
|
|
|
|
// Consume ENTRY ending
|
|
|
|
pullParser.nextTag(); |
|
|
|
pullParser.nextTag(); |
|
|
|
|
|
|
|
|
|
|
|
return returnValues; |
|
|
|
return returnValues; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Map<String, Object> consumeObject(XmlPullParser pullParser) throws XmlPullParserException, IOException { |
|
|
|
private Map<String, Object> consumeObject(XmlPullParser pullParser) throws XmlPullParserException, IOException { |
|
|
|
|
|
|
|
|
|
|
|
int next = XmlPullParser.START_TAG; |
|
|
|
int next = XmlPullParser.START_TAG; |
|
|
|
String name = pullParser.getName(); |
|
|
|
String name = pullParser.getName(); |
|
|
|
|
|
|
|
|
|
|
|
// Consume bottom-level (contains no objects of its own) object
|
|
|
|
// Consume bottom-level (contains no objects of its own) object
|
|
|
|
Map<String, Object> returnValues = new HashMap<String, Object>(); |
|
|
|
Map<String, Object> returnValues = new HashMap<String, Object>(); |
|
|
|
while (next == XmlPullParser.START_TAG && !(name.equals(TAG_CACHED_PROPERTY_NAMES))) { |
|
|
|
while (next == XmlPullParser.START_TAG && !(name.equals(TAG_CACHED_PROPERTY_NAMES))) { |
|
|
@ -326,11 +326,11 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} |
|
|
|
} |
|
|
|
next = pullParser.nextTag(); // skip to next start tag
|
|
|
|
next = pullParser.nextTag(); // skip to next start tag
|
|
|
|
name = pullParser.getName(); // get name of the new start tag
|
|
|
|
name = pullParser.getName(); // get name of the new start tag
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return returnValues; |
|
|
|
return returnValues; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String serialize(Object value) { |
|
|
|
private String serialize(Object value) { |
|
|
@ -344,7 +344,7 @@ public class VuzeXmlOverHttpClient { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* For now cast all integers as Long; this prevents casting problems later on when |
|
|
|
/* For now cast all integers as Long; this prevents casting problems later on when |
|
|
|
* we know it's a long but the value was small so it is casted to an Integer here |
|
|
|
* we know it's a long but the value was small so it is casted to an Integer here |
|
|
|
// Integer?
|
|
|
|
// Integer?
|
|
|
|
try { |
|
|
|
try { |
|
|
@ -353,7 +353,7 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
// Just continue trying the next type
|
|
|
|
// Just continue trying the next type
|
|
|
|
}*/ |
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
// Long?
|
|
|
|
// Long?
|
|
|
|
try { |
|
|
|
try { |
|
|
|
Long longnum = Long.parseLong(rawText); |
|
|
|
Long longnum = Long.parseLong(rawText); |
|
|
@ -361,7 +361,7 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
// Just continue trying the next type
|
|
|
|
// Just continue trying the next type
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Double?
|
|
|
|
// Double?
|
|
|
|
try { |
|
|
|
try { |
|
|
|
Double doublenum = Double.parseDouble(rawText); |
|
|
|
Double doublenum = Double.parseDouble(rawText); |
|
|
@ -369,9 +369,9 @@ public class VuzeXmlOverHttpClient { |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
// Just continue trying the next type
|
|
|
|
// Just continue trying the next type
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// String otherwise
|
|
|
|
// String otherwise
|
|
|
|
return rawText; |
|
|
|
return rawText; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|