input stream fix

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@152662 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2017-09-05 10:15:51 +00:00
parent 095d3cde2c
commit 65fca70e19
1 changed files with 5 additions and 5 deletions

View File

@ -444,19 +444,19 @@ public class GeonetworkResolver extends HttpServlet{
for (String fileId : fileIdentifiers) {
String own = GetResponseRecordFilter.getMetaOwnerNameByFileIdentifier(fileId, config.getGeoNetworkEndpoint(),config.getAdminAccount().getUser(), config.getAdminAccount().getPassword());
if(own.compareTo(theOwner)!=0){
logger.debug("Owner of fileIdentifiers "+fileId+" not matching the owner passed: "+theOwner+", removing it..");
logger.debug("Owner of file Identifier "+fileId+" not matching the owner passed: "+theOwner+", removing it..");
noMatchingOwner.add(fileId);
}
}
if(noMatchingOwner.size()>0){
logger.debug("Removing "+noMatchingOwner.size()+" layer/s not macthing the owner: "+theOwner);
in = GetResponseRecordFilter.overrideResponseIdsByListIds(in, noMatchingOwner, "Replaced UUID owned by anothoer user, please ignore");
in = GetResponseRecordFilter.overrideResponseIdsByListIds(reus, noMatchingOwner, "Replaced UUID owned by another user, please ignore");
}
}
ReusableInputStream reus = new ReusableInputStream(in);
int bytes = IOUtils.copy(reus, out);
logger.trace("POST - RETURN : "+IOUtils.toString(reus));
ReusableInputStream reusIs = new ReusableInputStream(in);
int bytes = IOUtils.copy(reusIs, out);
logger.trace("POST - RETURN : "+IOUtils.toString(reusIs));
if(bytes==0)
logger.warn("ResponseBody is empty, returning empty resp");