cdm/src/main/java/ucar/nc2/util/DiskCache2.java
public File getCacheFile(String fileLocation) {
    if (neverUseCache)
      return null;

    if (!alwaysUseCache) {
      File f = new File(fileLocation);
      if (canWrite(f)) return f;
    }

    File f = new File(makeCachePath(fileLocation));
    //if (f.exists())
    // f.setLastModified( System.currentTimeMillis());

    if (cachePathPolicy == CachePathPolicy.NestedDirectory) {
      File dir = f.getParentFile();
      if (!dir.exists()) {
        boolean ret = dir.mkdirs();
        if (!ret) cacheLog.warn("Error creating dir: " + dir);
      }
    }

    return f;
  }
public File getCacheFile(String fileLocation) {
    if (neverUseCache)
      return null;

    if (!alwaysUseCache) {
      File f = new File(fileLocation);
      if (canWrite(f)) return f;
    }

    File f = new File(makeCachePath(fileLocation));
    //if (f.exists())
    // f.setLastModified( System.currentTimeMillis());

    if (cachePathPolicy == CachePathPolicy.NestedDirectory) {
      File dir = f.getParentFile();
      if (!dir.exists()) {
        boolean ret = dir.mkdirs();
        if (!ret) cacheLog.warn("Error creating dir: " + dir);
      }
    }

    return f;
  }
public File getCacheFile ( String fileLocation ) { if ( neverUseCache ) return null ; if ( ! alwaysUseCache ) { File f = new File ( fileLocation ) ; if ( canWrite ( f ) ) return f ; } File f = new File ( makeCachePath ( fileLocation ) ) ; //if (f.exists()) // f.setLastModified( System.currentTimeMillis()); if ( cachePathPolicy == CachePathPolicy . NestedDirectory ) { File dir = f . getParentFile ( ) ; if ( ! dir . exists ( ) ) { boolean ret = dir . mkdirs ( ) ; if ( ! ret ) cacheLog . warn ( "Error creating dir: " + dir ) ; } } return f ; }
Get a File in the cache, corresponding to the fileLocation.
File may or may not exist.
If fileLocation has "/" in it, and cachePathPolicy == NestedDirectory, the
nested directories will be created.

@param fileLocation logical file location
@return physical File in the cache.
Get a File in the cache corresponding to the fileLocation . File may or may not exist . If fileLocation has / in it and cachePathPolicy == NestedDirectory the nested directories will be created .