try{
SAXBuilder builder = new SAXBuilder("org.ccil.cowan.tagsoup.Parser");
InputStream inputStream = new StringInputStream(badEntry);
Document doc = builder.build(inputStream);
Element feed = doc.getRootElement();
for(Element entry: getNamedElements(feed, "entry")){
for(Element categoryElement: getNamedElements(entry, "category")){
Attribute term = categoryElement.getAttribute("term");
if(term != null){
Category category = new Category(null, term.getValue());
categoryList.add(category);
}
}
}
} catch(JDOMException e){
throw new DefaultShawRuntimeException(e);
}
There is no compiling problem when I use ant. However, when I use gradle to compile, I got below error message. Anybody got idea for that?
ProcessCommand.java:85: unreported exception java.io.IOException; must be caught or declared to be thrown
Document doc = builder.build(inputStream);
^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
FAILURE: Build failed with an exception.