Package org.vertx.java.core.file

Examples of org.vertx.java.core.file.FileProps.lastModifiedTime()


        final FileSystem fileSystem = vertx.fileSystem();

        try {
            FileProps fileProps = fileSystem.propsSync(filename);
            LRUCache.CacheEntry<String, T> cacheEntry = cache.get(filename);
            final Date lastModified = fileProps.lastModifiedTime();

            if (cacheEntry == null) {
                return false;
            }
            if (cacheEntry.isFresh(lastModified)) {
View Full Code Here


    private void loadToCache(final String filename) {
        final FileSystem fileSystem = vertx.fileSystem();

        if (fileSystem.existsSync(filename)) {
            FileProps fileProps = fileSystem.propsSync(filename);
            final Date lastModified = fileProps.lastModifiedTime();
            // load from the file system
            Buffer content = fileSystem.readFileSync(filename);
            // cache the result
            cache.put(filename, new LRUCache.CacheEntry<String, T>(lastModified, content.toString(contentEncoding())));
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.