Permalink
Browse files

Merge branch 'develop' of https://github.com/eXist-db/exist into develop

  • Loading branch information...
2 parents 8845e3a + 9c73044 commit 72d9731ee5c75e5e5574b946f2ef985f7fbf506a @wolfgangmm wolfgangmm committed Feb 9, 2014
@@ -133,10 +133,8 @@ protected Sequence extractRequestBody(final HttpRequest request) throws RestXqSe
//first, get the content of the request
is = new CloseShieldInputStream(request.getInputStream());
-
- //if the content length is unknown or 0, return
- final int contentLength = request.getContentLength();
- if(contentLength == -1 || contentLength == 0) {
+
+ if(is.available() <= 0) {
return null;
}
@@ -162,18 +160,7 @@ public String getCacheClass() {
try {
//was there any POST content?
-
-
- /**
- * There is a bug in HttpInput.available() in Jetty 7.2.2.v20101205
- * This has been filed as Bug 333415 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=333415
- * It is expected to be fixed in the Jetty 7.3.0 release
- */
-
- //TODO reinstate call to .available() when Jetty 7.3.0 is released, use of .getContentLength() is not reliable because of http mechanics
- //if(is != null && is.available() > 0) {
- final int contentLength = request.getContentLength();
- if(is != null && contentLength > 0) {
+ if(is != null && is.available() > 0) {
String contentType = request.getContentType();
// 1) determine if exists mime database considers this binary data
if(contentType != null) {
@@ -227,6 +214,8 @@ public String getCacheClass() {
}
}
}
+ } catch (IOException e) {
+ throw new RestXqServiceException(e.getMessage());
} finally {
if(cache != null) {
@@ -26,8 +26,8 @@
import org.w3c.dom.DocumentType;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
-
import org.exist.Namespaces;
import org.exist.collections.Collection;
import org.exist.collections.IndexInfo;
@@ -45,7 +45,6 @@
import org.exist.xquery.value.DateTimeValue;
import java.net.URISyntaxException;
-
import java.util.Calendar;
import java.util.Date;
import java.util.Observable;
@@ -54,9 +53,9 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+
import org.apache.log4j.Logger;
import org.exist.backup.BackupDescriptor;
-import org.exist.backup.RestoreHandler;
import org.exist.backup.restore.listener.RestoreListener;
import org.exist.security.ACLPermission.ACE_ACCESS_TYPE;
import org.exist.security.ACLPermission.ACE_TARGET;
@@ -274,6 +273,8 @@ private void restoreSubCollectionEntry(Attributes atts) throws SAXException {
reader.setContentHandler(handler);
reader.parse(is);
+ } catch(final SAXParseException e) {
+ throw new SAXException("Could not process collection: " + descriptor.getSymbolicPath(name, false), e);
} catch(final ParserConfigurationException pce) {
throw new SAXException("Could not initalise SAXParser for processing sub-collection: " + descriptor.getSymbolicPath(name, false), pce);
} catch(final IOException ioe) {
@@ -138,6 +138,7 @@ private void cache() {
}
} else {
props.put(name, child.getNodeValue());
+ names.add(name);
}
}
}
@@ -190,10 +191,12 @@ public String getProperty(String name, String default_property) {
@Override
public Map<String, String> getPropertyMap(String name) {
- if (props.containsKey(name))
- return null;
-
final Map<String, String> map = new HashMap<String, String>();
+
+ if (hasProperty(name)) {
+ map.put(name, getProperty(name));
+ return map;
+ }
Node child = getFirstChild();
while (child != null) {

0 comments on commit 72d9731

Please sign in to comment.