if (!frameParsed) {
String framePath = config.getString(FRAME_KEY);
String framePlaceholder = config.getString(FRAMEPLACEHOLDER_KEY);
if (framePath != null && !framePath.equals("") && framePlaceholder != null && !framePlaceholder.equals("")) {
try {
JCS cache = JCS.getInstance(VelocityContentRepository.class.getSimpleName() + ".famecache");
footer = (String) cache.get(framePath + FOOTER_CACHE_KEY_SUFFIX);
header = (String) cache.get(framePath + HEADER_CACHE_KEY_SUFFIX);
if (header == null || footer == null) {
URL frameURL = new URL(framePath);
URLConnection conn = frameURL.openConnection();
Object content = conn.getContent();
if (content instanceof InputStream) {
header = StringUtils.readUntil((InputStream) content, framePlaceholder);
footer = StringUtils.streamToString((InputStream) content);
} else {
logger.error(
"Error reading frame source" + framePath,
new CRException("Unknown response type (" + content.getClass() + ")"));
}
cache.put(framePath + HEADER_CACHE_KEY_SUFFIX, header);
cache.put(framePath + FOOTER_CACHE_KEY_SUFFIX, footer);
}
} catch (MalformedURLException e) {
logger.error("Error reading frame source " + framePath, e);
} catch (IOException e) {