public void init() {
            AssetInfo info = assetManager.locateAsset(new AssetKey<Shader>(fileName));
            if (info != null && info instanceof UrlAssetInfo) {
                try {
                    Field f = info.getClass().getDeclaredField("url");
                    f.setAccessible(true);
                    URL url = (URL) f.get(info);
                    file = new File(url.getFile());
                    fileLastM = file.lastModified();

                } catch (NoSuchFieldException
                        | SecurityException
                        | IllegalArgumentException
                        | IllegalAccessException ex) {
                    Logger.getLogger(MaterialDebugAppState.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
Will reload the spatial's materials whenever the shader file is changed
on the hard drive
@param shaderName the shader name (relative path to the asset folder or 
to a registered asset path)
@param spat the spatial to reload
jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java