public long trackResource(Resource resource) { if (tracker == null) { return fixedLastModifiedTime; } return tracker.add(resource.toURL()); }
public DynamicTemplate parseTemplate(Resource resource) { DynamicTemplate result = cache.get(resource); if (result == null) { result = doParse(resource); cache.put(resource, result); tracker.add(resource.toURL()); } return result; }
private void trackClassFileChanges(String className) { if (isInnerClassName(className)) { return; } String path = PlasticInternalUtils.toClassPath(className); URL url = baseClassLoader.getResource(path); if (isFileURL(url)) { changeTracker.add(url); } }
private void trackClassFileChanges(String className) { if (isInnerClassName(className)) { return; } String path = PlasticInternalUtils.toClassPath(className); URL url = baseClassLoader.getResource(path); if (isFileURL(url)) { changeTracker.add(url); } }
/** * Creates and returns a new map that contains properties read from the properties file. */ private Map<String, String> readProperties(Resource resource) { if (!resource.exists()) return emptyMap; if (tracker != null) { tracker.add(resource.toURL()); } try { return propertiesFileParser.parsePropertiesFile(resource); } catch (Exception ex) { throw new RuntimeException(String.format("Unable to read message catalog from %s: %s", resource, ex), ex); } }
private ComponentTemplate parseTemplate(Resource r) { // In a race condition, we may parse the same template more than once. This will likely add // the resource to the tracker multiple times. Not likely this will cause a big issue. if (!r.exists()) return missingTemplate; tracker.add(r.toURL()); return parser.parseTemplate(r); }
.toClassPath(className)); changeTracker.add(baseResource.toURL());