use of org.geotoolkit.csw.xml.GetRecordById in project geotoolkit by Geomatys.
the class AbstractGetRecordById method getResponseStream.
/**
* {@inheritDoc}
*/
@Override
public InputStream getResponseStream() throws IOException {
final URL url = getURL();
URLConnection conec = url.openConnection();
conec = security.secure(conec);
conec.setDoOutput(true);
conec.setRequestProperty("Content-Type", "text/xml");
OutputStream stream = conec.getOutputStream();
stream = security.encrypt(stream);
try {
final Marshaller marsh = POOL.acquireMarshaller();
final ElementSetName set = CswXmlFactory.createElementSetName(version, elementSetName);
final GetRecordById recordByIdXml = CswXmlFactory.createGetRecordById(version, "CSW", set, outputFormat, outputSchema, Arrays.asList(ids));
marsh.marshal(recordByIdXml, stream);
POOL.recycle(marsh);
} catch (JAXBException ex) {
throw new IOException(ex);
}
stream.close();
return security.decrypt(conec.getInputStream());
}
Aggregations