private String loadResource(final String url) { try { return StreamUtil.getTextResource(url); } catch (IOException e) { log.error("Can't read comments template." + e); return "Error during load resources " + url; } }
@Override public void loadDefaultSite() { try { byte[] file = StreamUtil.getBytesResource(DEFAULT_SITE); getBusiness().getSystemService().getCache().putBlob(DEFAULT_SITE, file); getMessageQueue() .publish(new ImportMessage.Builder().setStart(1).setFilename(DEFAULT_SITE).create()); } catch (IOException e) { log.error("Can't load default site: " + e.getMessage()); } }
public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String msg = request.getParameter("message"); if (msg == null) { logger.error("Message is null"); return; } try { Message message = (Message) StreamUtil.toObject(Base64.decodeBase64(request.getParameter("message"))); VosaoContext.getInstance().setUser(UserHelper.ADMIN); getMessageQueue().execute(message); } catch (Exception e) { logger.error(e.getMessage()); e.printStackTrace(); } }