/** * Remove files if needed to make cache have less than maxBytes bytes file sizes. * This will remove oldest files first. * * @param maxBytes max number of bytes in cache. * @param sbuff write results here, null is ok. */ static public void cleanCache(long maxBytes, StringBuilder sbuff) { cleanCache(maxBytes, new FileAgeComparator(), sbuff); }
/** * Escape special characters in a netcdf short name when * it is intended for use in CDL. * * @param vname the name * @return escaped version of it */ public static String makeValidCDLName(String vname) { return EscapeStrings.backslashEscape(vname, reservedCdl); }
/** * read the contents from the named URL, write to a file. * * @param urlString the URL to read from. * @param file write to this file * @return status or error message. * @throws IOException if failure */ static public String readURLtoFileWithExceptions(String urlString, File file) throws IOException { return readURLtoFileWithExceptions(urlString, file, default_socket_buffersize); }
private boolean checkAttributes(Variable v, List<Attribute> list1, List<Attribute> list2, ObjFilter filter) { boolean ok = true; for (Attribute att1 : list1) { if (filter == null || filter.attOk(v, att1)) ok &= checkEach(att1, "file1", list1, "file2", list2, null); } for (Attribute att2 : list2) { if (filter == null || filter.attOk(v, att2)) ok &= checkEach(att2, "file2", list2, "file1", list1, null); } return ok; }
/** * Unescape any escaped characters in a name. * * @param vname the escaped name * @return unescaped version of it */ public static String makeNameUnescaped(String vname) { return EscapeStrings.backslashUnescape(vname); }
public boolean equals2(Object oo) { if (this == oo) return true; if (!(oo instanceof LevelCoord)) return false; LevelCoord other = (LevelCoord) oo; return (ucar.nc2.util.Misc.nearlyEquals(value1, other.value1) && ucar.nc2.util.Misc.nearlyEquals(value2, other.value2)); }
@Override public int compareTo(Tracker o) { return Misc.compare(hit+miss, o.hit+o.miss); } }
@Override public void removeEventListener(TriggerListener l) { if (lm != null) lm.removeListener(l); }
@Override public String toString() { if (cancel) return "was canceled"; if (isError()) return "error= "+error; if (success) return "success"; return "finished="+done; } }
protected void createListenerManager() { lm = new ListenerManager( "thredds.inventory.CollectionManager$TriggerListener", "thredds.inventory.CollectionManager$TriggerEvent", "handleCollectionEvent"); }
/** * @deprecated use setCachePathPolicy(CachePathPolicy cachePathPolicy, String cachePathPolicyParam) */ public void setCachePathPolicy(int cachePathPolicy, String cachePathPolicyParam) { setPolicy(cachePathPolicy); this.cachePathPolicyParam = cachePathPolicyParam; }
/** * Remove files if needed to make cache have less than maxBytes bytes file sizes. * This will remove oldest files first. * * @param maxBytes max number of bytes in cache. * @param sbuff write results here, null is ok. */ static public void cleanCache(long maxBytes, StringBuilder sbuff) { cleanCache(maxBytes, new FileAgeComparator(), sbuff); }
/** * Escape special characters in a netcdf short name when * it is intended for use in a fullname * * @param vname the name * @return escaped version of it */ public static String makeValidPathName(String vname) { return EscapeStrings.backslashEscape(vname, reservedFullName); }
/** * Remove files if needed to make cache have less than maxBytes bytes file sizes. * This will remove oldest files first. * * @param maxBytes max number of bytes in cache. * @param sbuff write results here, null is ok. */ static public void cleanCache(long maxBytes, StringBuilder sbuff) { cleanCache(maxBytes, new FileAgeComparator(), sbuff); }
/** * Escape special characters in a netcdf short name when * it is intended for use in a sectionSpec * * @param vname the name * @return escaped version of it */ public static String makeValidSectionSpecName(String vname) { return EscapeStrings.backslashEscape(vname, reservedSectionSpec); }