Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java @ 34:25fdec8b4c69
Added Global Errorhandling to the GNV-Client
gnv/trunk@170 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 02 Oct 2009 08:38:57 +0000 |
parents | 0f4362d75e9e |
children | 4405f31bbc30 |
comparison
equal
deleted
inserted
replaced
33:32ffff3f67aa | 34:25fdec8b4c69 |
---|---|
161 | 161 |
162 /** | 162 /** |
163 * @throws IOException | 163 * @throws IOException |
164 */ | 164 */ |
165 private InputStream doPostRequest(String requestUrl, Document requestBody) throws IOException { | 165 private InputStream doPostRequest(String requestUrl, Document requestBody) throws IOException { |
166 log.debug("##################################################"); | |
167 log.debug(new XMLUtils().writeDocument2String(requestBody)); | |
168 log.debug("##################################################"); | |
166 Client client = new Client(Protocol.HTTP); | 169 Client client = new Client(Protocol.HTTP); |
167 Request request = new Request(Method.POST, requestUrl); | 170 Request request = new Request(Method.POST, requestUrl); |
168 String documentBody = new XMLUtils().writeDocument2String(requestBody); | 171 String documentBody = new XMLUtils().writeDocument2String(requestBody); |
169 Representation representation = new StringRepresentation(documentBody); | 172 Representation representation = new StringRepresentation(documentBody); |
170 request.setEntity(representation); | 173 request.setEntity(representation); |
460 Collection<InputParameter> inputParameter) | 463 Collection<InputParameter> inputParameter) |
461 throws ArtifactDatabaseClientException { | 464 throws ArtifactDatabaseClientException { |
462 try { | 465 try { |
463 XMLUtils xmlUtils = new XMLUtils(); | 466 XMLUtils xmlUtils = new XMLUtils(); |
464 Document requestBody = this.createOutRequestBody(currentArtifact, targetName, mimeType, inputParameter); | 467 Document requestBody = this.createOutRequestBody(currentArtifact, targetName, mimeType, inputParameter); |
465 log.debug(xmlUtils.writeDocument2String(requestBody)); | |
466 | 468 |
467 String requestUrl = this.getArtifactUrl(artifactFactory, currentArtifact)+"/"+targetName; | 469 String requestUrl = this.getArtifactUrl(artifactFactory, currentArtifact)+"/"+targetName; |
468 InputStream is = this.doPostRequest( requestUrl, requestBody); | 470 InputStream is = this.doPostRequest( requestUrl, requestBody); |
469 | 471 |
470 byte[] b = new byte[4096]; | 472 byte[] b = new byte[4096]; |