public DeltaSpikeResourceHandler(ResourceHandler resourceHandler) { super(); wrapped = resourceHandler; version = ClassUtils.getJarVersion(this.getClass()); activated = ClassDeactivationUtils.isActivated(this.getClass()); }
@Override public String getClientWindowHtml() { if (projectStage != ProjectStage.Development && clientWindowtml != null) { // use cached windowHandlerHtml except in Development return clientWindowtml; } InputStream is = ClassUtils.getClassLoader(null).getResourceAsStream(getClientWindowResourceLocation()); StringBuffer sb = new StringBuffer(); try { byte[] buf = new byte[16 * 1024]; int bytesRead; while ((bytesRead = is.read(buf)) != -1) { String sbuf = new String(buf, 0, bytesRead); sb.append(sbuf); } } catch (IOException e) { ExceptionUtils.throwAsRuntimeException(e); } finally { try { is.close(); } catch (IOException e) { // do nothing, all fine so far } } clientWindowtml = sb.toString(); return clientWindowtml; }