Revision 2720ea2c
Added by Andreas Müller about 3 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/abcd206/in/UnitAssociationParser.java | ||
---|---|---|
25 | 25 |
/** |
26 | 26 |
* @author pplitzner |
27 | 27 |
* @since 16.06.2015 |
28 |
* |
|
29 | 28 |
*/ |
30 | 29 |
public class UnitAssociationParser { |
31 | 30 |
|
... | ... | |
127 | 126 |
if(unitID!=null && datasetAccessPoint!=null){ |
128 | 127 |
BioCaseQueryServiceWrapper serviceWrapper = new BioCaseQueryServiceWrapper(); |
129 | 128 |
|
130 |
|
|
131 | 129 |
OccurenceQuery query = new OccurenceQuery(unitID); |
132 | 130 |
|
131 |
try { |
|
132 |
InputStream inputStream = serviceWrapper.querySiblings(query, datasetAccessPoint); |
|
133 | 133 |
|
134 |
InputStream inputStream; |
|
135 |
try { |
|
136 |
inputStream = serviceWrapper.querySiblings(query, datasetAccessPoint); |
|
137 |
|
|
138 |
if(inputStream!=null){ |
|
134 |
if(inputStream!=null){ |
|
139 | 135 |
UnitAssociationWrapper unitAssociationWrapper = null; |
140 | 136 |
try { |
141 | 137 |
unitAssociationWrapper = AbcdParseUtility.parseUnitsNodeList(inputStream, report); |
142 |
|
|
143 | 138 |
} catch (Exception e) { |
144 | 139 |
String exceptionMessage = "An exception occurred during parsing of associated units!"; |
145 | 140 |
logger.error(exceptionMessage, e); |
146 | 141 |
report.addException(exceptionMessage, e); |
147 | 142 |
} |
148 | 143 |
|
149 |
|
|
150 |
return unitAssociationWrapper; |
|
151 |
} |
|
152 |
else{ |
|
153 |
logger.error(unableToLoadMessage); |
|
154 |
report.addInfoMessage(unableToLoadMessage); |
|
155 |
} |
|
156 |
} catch (ClientProtocolException e1) { |
|
157 |
// TODO Auto-generated catch block |
|
158 |
e1.printStackTrace(); |
|
159 |
} catch (IOException e1) { |
|
160 |
// TODO Auto-generated catch block |
|
161 |
e1.printStackTrace(); |
|
144 |
return unitAssociationWrapper; |
|
145 |
}else{ |
|
146 |
logger.error(unableToLoadMessage); |
|
147 |
report.addInfoMessage(unableToLoadMessage); |
|
162 | 148 |
} |
163 |
|
|
164 |
} |
|
165 |
else{ |
|
166 |
report.addInfoMessage(unableToLoadMessage); |
|
149 |
} catch (ClientProtocolException e1) { |
|
150 |
// TODO Auto-generated catch block |
|
151 |
e1.printStackTrace(); |
|
152 |
} catch (IOException e1) { |
|
153 |
// TODO Auto-generated catch block |
|
154 |
e1.printStackTrace(); |
|
167 | 155 |
} |
156 |
}else{ |
|
157 |
report.addInfoMessage(unableToLoadMessage); |
|
158 |
} |
|
168 | 159 |
return null; |
169 | 160 |
} |
170 |
|
|
171 |
} |
|
161 |
} |
Also available in: Unified diff
cleanup