36
36
import org .bson .types .ObjectId ;
37
37
import org .exist .Namespaces ;
38
38
import org .exist .dom .QName ;
39
- import org .exist .dom .memtree .DocumentImpl ;
40
39
import org .exist .dom .memtree .SAXAdapter ;
41
40
import org .exist .mongodb .shared .Constants ;
42
41
import static org .exist .mongodb .shared .Constants .EXIST_COMPRESSION ;
@@ -129,9 +128,7 @@ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathExce
129
128
throw new XPathException (this , GridfsModule .GRFS0004 , String .format ("Document '%s' could not be found." , documentId ));
130
129
}
131
130
132
- Sequence retVal = get (gfsFile , forceBinary );
133
-
134
- return retVal ;
131
+ return get (gfsFile , forceBinary );
135
132
136
133
} catch (XPathException ex ) {
137
134
LOG .error (ex .getMessage (), ex );
@@ -178,10 +175,11 @@ Sequence get(GridFSDBFile gfsFile, boolean forceBinary) throws IOException, XPat
178
175
}
179
176
180
177
/**
181
- * Parse an byte-array containing (compressed) XML data into an eXist-db
178
+ * Parse an byte-stream containing (compressed) XML data into an eXist-db
182
179
* document.
183
180
*
184
- * @param data Byte array containing the XML data.
181
+ * @param xqueryContext Xquery context
182
+ * @param is Byte stream containing the XML data.
185
183
* @return Sequence containing the XML as DocumentImpl
186
184
*
187
185
* @throws XPathException Something bad happened.
@@ -208,7 +206,7 @@ private Sequence processXML(XQueryContext xqueryContext, InputStream is) throws
208
206
IOUtils .closeQuietly (is );
209
207
210
208
if (validationReport .isValid ()) {
211
- content = ( DocumentImpl ) adapter .getDocument ();
209
+ content = adapter .getDocument ();
212
210
} else {
213
211
String txt = String .format ("Received document is not valid: %s" , validationReport .toString ());
214
212
LOG .debug (txt );
0 commit comments