src/main/java/guru/nidi/loader/use/raml/RamlCache.java
public RamlModelResult loadRaml(String name) {
        final File file = new File(CACHE_DIR, escaped(loader.config()) + "-" + escaped(simpleName(name)) + ".braml");
        if (!file.exists()) {
            return parseAndSave(loader, name, file);
        }
        final InputStream in = loader.fetchResource(name, file.lastModified());
        if (in != null) {
            final byte[] data = loadedData(name, in);
            return parseAndSave(new PreloadedLoader(loader, name, data), name, file);
        }
        try {
            return load(file);
        } catch (IOException | ClassNotFoundException e) {
            return parseAndSave(loader, name, file);
        }
    }
public RamlModelResult loadRaml(String name) {
        final File file = new File(CACHE_DIR, escaped(loader.config()) + "-" + escaped(simpleName(name)) + ".braml");
        if (!file.exists()) {
            return parseAndSave(loader, name, file);
        }
        final InputStream in = loader.fetchResource(name, file.lastModified());
        if (in != null) {
            final byte[] data = loadedData(name, in);
            return parseAndSave(new PreloadedLoader(loader, name, data), name, file);
        }
        try {
            return load(file);
        } catch (IOException | ClassNotFoundException e) {
            return parseAndSave(loader, name, file);
        }
    }
public RamlModelResult loadRaml ( String name ) { final File file = new File ( CACHE_DIR , escaped ( loader . config ( ) ) + "-" + escaped ( simpleName ( name ) ) + ".braml" ) ; if ( ! file . exists ( ) ) { return parseAndSave ( loader , name , file ) ; } final InputStream in = loader . fetchResource ( name , file . lastModified ( ) ) ; if ( in != null ) { final byte [ ] data = loadedData ( name , in ) ; return parseAndSave ( new PreloadedLoader ( loader , name , data ) , name , file ) ; } try { return load ( file ) ; } catch ( IOException | ClassNotFoundException e ) { return parseAndSave ( loader , name , file ) ; } }
TODO save all included ramls of a raml. when any of them changes, reparse!
TODO save all included ramls of a raml . when any of them changes reparse!