public String addInfoSet(String sourceId, InfoSet infoSet) throws ServiceException {
if ("somesource".equals(sourceId)) {
return "newid";
}
else if ("unknown".equals(sourceId)) {
throw new ServiceException("unknown source id", "anyhow");
}
else if ("resource".equals(sourceId)) {
InputStreamReader reader = new InputStreamReader(SourceServiceImpl.class.getResourceAsStream("infosetid.txt"));
BufferedReader buffered = new BufferedReader(reader);
try {
return buffered.readLine();
}
catch (IOException e) {
throw new ServiceException("unable to read", e.getMessage());
}
}
return "okay";
}