/** * Returns the "version" (aka last modified timestamp) of the URI of interest * * @param uri The URI to check the last modified timestamp * * @return The last modified timestamp in ms of the URI in String format */ @Override public String getVersion(URI uri) { return StringUtils.format("%d", buildFileObject(uri).getLastModified()); }
/** * Return the "version" (aka last modified timestamp) of the URI * * @param uri The URI of interest * * @return The last modified timestamp of the uri in String format * * @throws IOException */ @Override public String getVersion(URI uri) throws IOException { try { return StringUtils.format("%d", buildFileObject(uri, config).getLastModified()); } catch (HdfsIOException ex) { throw ex.getIOException(); } }
@Override public long getLastModified() { return prodFileObject.getLastModified(); }
public long getLastModified() { return fileObject.getLastModified(); }
public long getLastModified() { return fileObject.getLastModified(); }
public long getLastModified() { return fileObject.getLastModified(); }
public long getLastModified() { return fileObject.getLastModified(); }
long getLastModified(FileObject filename) { long mod = 0; try { mod = filename.getLastModified(); } catch (SecurityException e) { throw new AssertionError("CRT: couldn't get source file modification date: " + e.getMessage()); } return mod; } }
long getLastModified(FileObject filename) { long mod = 0; try { mod = filename.getLastModified(); } catch (SecurityException e) { throw new AssertionError("CRT: couldn't get source file modification date: " + e.getMessage()); } return mod; } }
long getLastModified(FileObject filename) { long mod = 0; try { mod = filename.getLastModified(); } catch (SecurityException e) { throw new AssertionError("CRT: couldn't get source file modification date: " + e.getMessage()); } return mod; } }
long getLastModified(FileObject filename) { long mod = 0; try { mod = filename.getLastModified(); } catch (SecurityException e) { throw new AssertionError("CRT: couldn't get source file modification date: " + e.getMessage()); } return mod; } }
/** * Returns the "version" (aka last modified timestamp) of the URI of interest * * @param uri The URI to check the last modified timestamp * * @return The last modified timestamp in ms of the URI in String format */ @Override public String getVersion(URI uri) { return StringUtils.format("%d", buildFileObject(uri).getLastModified()); }
/** * Returns the "version" (aka last modified timestamp) of the URI of interest * * @param uri The URI to check the last modified timestamp * * @return The last modified timestamp in ms of the URI in String format */ @Override public String getVersion(URI uri) { return StringUtils.format("%d", buildFileObject(uri).getLastModified()); }
@Override public long getLastModified() { try { return clientFileObject.getLastModified(); } catch (ClientCodeException e) { throw e; } catch (RuntimeException e) { throw new ClientCodeException(e); } catch (Error e) { throw new ClientCodeException(e); } }
@Override public long getLastModified() { try { return clientFileObject.getLastModified(); } catch (ClientCodeException e) { throw e; } catch (RuntimeException e) { throw new ClientCodeException(e); } catch (Error e) { throw new ClientCodeException(e); } }
public FileObject getResource(JavaFileManager.Location location, Name pkg, CharSequence relativeName) { Key key = new Key(location, pkg, relativeName.toString()); String coordinates = "location=" + location + " pkg=" + pkg + " relativeName=" + relativeName; FileObject resource = resources != null ? resources.get(key) : null; if (resource == null) { resource = doGetResource(location, pkg, relativeName); if (resource != null) { debug("Resolved resolved resource " + coordinates + " from filer"); if (resource.getLastModified() > 0) { if (resources == null) { resources = new HashMap<Key, FileObject>(); } debug("Caching locally resolved resource " + coordinates + " from filer"); resources.put(key, resource); } else { resource = null; } } else { debug("Could not resolved resource " + coordinates + " from filer"); } } return resource; }
@Override public Timestamped<Resource> resolveResource(Path.Absolute path) { FileObject resource = owner.application.resolveResource(path); if (resource != null) { try { byte[] bytes = Tools.bytes(resource.openInputStream()); long lastModified = resource.getLastModified(); return new Timestamped<Resource>(lastModified, new Resource(bytes, Charset.defaultCharset())); } catch (Exception e) { env.info("Could not get resource content " + path.getCanonical(), e); } } return null; }
@Override public Timestamped<Resource> resolveResource(Path.Absolute path) { FileObject resource = owner.application.resolveResource(path); if (resource != null) { try { byte[] bytes = Tools.bytes(resource.openInputStream()); long lastModified = resource.getLastModified(); return new Timestamped<Resource>(lastModified, new Resource(bytes, Charset.defaultCharset())); } catch (Exception e) { env.info("Could not get resource content " + path.getCanonical(), e); } } return null; }
/** * Evict templates that are out of date. */ private void evictTemplates() { log.info("Synchronizing existing templates"); for (TemplateMetaModel template : templates.values()) { if (template.templateModel != null) { FileObject resource = application.resolveResource(template.getPath()); if (resource == null) { // That will generate a template not found error template.templateModel = null; log.info("Detected template removal " + template.getPath()); } else if (resource.getLastModified() > template.templateModel.getLastModified()) { // That will force the regeneration of the template template.templateModel = null; log.info("Detected stale template " + template.getPath()); } else { log.info("Template " + template.getPath() + " is valid"); } } } }
/** * Evict templates that are out of date. */ private void evictTemplates() { log.info("Synchronizing existing templates"); for (TemplateMetaModel template : templates.values()) { if (template.templateModel != null) { FileObject resource = application.resolveResource(template.getPath()); if (resource == null) { // That will generate a template not found error template.templateModel = null; log.info("Detected template removal " + template.getPath()); } else if (resource.getLastModified() > template.templateModel.getLastModified()) { // That will force the regeneration of the template template.templateModel = null; log.info("Detected stale template " + template.getPath()); } else { log.info("Template " + template.getPath() + " is valid"); } } } }