private String unescapeAttributeStringValues(String value) { return StringUtil2.substitute(value, substAttributeStrings, escapeAttributeStrings); }
public static void addAlias(String aliasKey, String actual) { alias.put(aliasKey, StringUtil2.substitute(actual, "\\", "/")); }
private void appendQueryFromTemplate( StringBuffer sbuff, ArrayList choices) { StringBuilder templateBuff = new StringBuilder( template); for (int i=0; i<choices.size(); i+=2) { StringUtil2.substitute(templateBuff, choices.get(i).toString(), choices.get(i + 1).toString()); } sbuff.append( templateBuff.toString()); }
private void appendQueryFromTemplate( StringBuffer sbuff, ArrayList choices) { StringBuilder templateBuff = new StringBuilder( template); for (int i=0; i<choices.size(); i+=2) { StringUtil2.substitute(templateBuff, choices.get(i).toString(), choices.get(i + 1).toString()); } sbuff.append( templateBuff.toString()); }
private void appendQueryFromTemplate( StringBuffer sbuff, ArrayList choices) { StringBuilder templateBuff = new StringBuilder( template); for (int i=0; i<choices.size(); i+=2) { StringUtil2.substitute(templateBuff, choices.get(i).toString(), choices.get(i + 1).toString()); } sbuff.append( templateBuff.toString()); }
private void transfer(String url, String copyToDir) { String new_url = StringUtil2.substitute(url, "dodsC", "fileServer"); int pos = url.lastIndexOf('/'); String filename = url.substring(pos + 1); File file = new File(copyToDir, filename); IO.readURLtoFile(new_url, file); System.out.println(" **copied to " + file.getPath() + " size=" + file.length()); }
private void transfer(String url, String copyToDir) { String new_url = StringUtil2.substitute(url, "dodsC", "fileServer"); int pos = url.lastIndexOf('/'); String filename = url.substring(pos + 1); File file = new File(copyToDir, filename); IO.readURLtoFile(new_url, file); System.out.println(" **copied to " + file.getPath() + " size=" + file.length()); }
private void transfer(String url, String copyToDir) { String new_url = StringUtil2.substitute(url, "dodsC", "fileServer"); int pos = url.lastIndexOf('/'); String filename = url.substring(pos + 1); File file = new File(copyToDir, filename); IO.readURLtoFile(new_url, file); System.out.println(" **copied to " + file.getPath() + " size=" + file.length()); }
private String normalize(String units) { if (units.equals("/second")) units = "1/sec"; if (units.equals("degrees K")) units = "K"; else { units = StringUtil2.substitute(units, "**", "^"); units = StringUtil2.remove(units, ')'); units = StringUtil2.remove(units, '('); } return units; }
static public void makeReadOnlyCacheManager(String cacheDir, String cacheName) { String configString = StringUtil2.substitute(configReadOnly, "${cacheDir}", cacheDir); configString = StringUtil2.substitute(configString, "${cacheName}", cacheName); if (debugConfig) System.out.printf("CacheManager readonly =%n %s %n", configString); cacheManager = new net.sf.ehcache.CacheManager(new StringBufferInputStream(configString)); }
public ConfigCatalog getFromAbsolutePath(String catalogFullPath) throws IOException { catalogFullPath = StringUtil2.substitute(catalogFullPath, "\\", "/"); // nasty microsnot if (catalogFullPath.startsWith(rootPath)) { String catKey = catalogFullPath.substring(rootPath.length()); // if (catKey.startsWith("/")) catKey = catKey.substring(1); return get(catKey); } return readCatalog(catalogFullPath); }
private String normalize(String units) { if (units.equals("fraction")) units = ""; else if (units.equals("dimensionless")) units = ""; else if (units.equals("NA")) units = ""; else if (units.equals("-")) units = ""; else { units = StringUtil2.substitute(units, "**", "^"); units = StringUtil2.remove(units, '}'); units = StringUtil2.remove(units, '{'); } return units; } /////////////////////////////////////////////////////////////////////////
private String normalize(String units) { if (units.equals("/second")) units = "1/sec"; if (units.equals("degrees K")) units = "K"; else { units = StringUtil2.substitute(units, "**", "^"); units = StringUtil2.remove(units, ')'); units = StringUtil2.remove(units, '('); } return units; }
private String normalize(String units) { if (units.equals("/second")) units = "1/sec"; if (units.equals("degrees K")) units = "K"; else { units = StringUtil2.substitute(units, "**", "^"); units = StringUtil2.remove(units, ')'); units = StringUtil2.remove(units, '('); } return units; }
static public void makeTestCacheManager(String cacheDir) { String configString = StringUtil2.substitute(config, "${cacheDir}", cacheDir); if (debugConfig) System.out.printf("CacheManager test=%n %s %n", configString); cacheManager = new net.sf.ehcache.CacheManager(new StringBufferInputStream(configString)); }
static public String cleanupUnits(String unit) { if (unit == null) return null; if (unit.equalsIgnoreCase("-")) unit = ""; else { if (unit.startsWith("/")) unit = "1" + unit; unit = unit.trim(); unit = StringUtil2.remove(unit, "**"); StringBuilder sb = new StringBuilder(unit); StringUtil2.remove(sb, "^[]"); StringUtil2.substitute(sb, " / ", "/"); StringUtil2.replace(sb, ' ', "."); StringUtil2.replace(sb, '*', "."); unit = sb.toString(); } return unit; }
static public void makeStandardCacheManager(String configFile, String cacheDir) throws IOException { String config = IO.readFile(configFile); String configString = StringUtil2.substitute(config, "${cacheDir}", cacheDir); cacheLog.info("thredds.filesystem.CacheManager configuraton " + configString); cacheManager = new net.sf.ehcache.CacheManager(new StringBufferInputStream(configString)); }
@Test public void problem() throws IOException { String problemFile = TestDir.cdmUnitTestDir + "formats/gempak/ndfd_20100913.gem"; String name = StringUtil2.substitute(problemFile.substring(TestCdmRemoteCompareHeadersP.contentRoot.length()), "\\", "/"); String remote = TestOnLocalServer.withHttpPath(TestCdmRemoteCompareHeadersP.urlPath + name); TestCdmRemoteCompareHeadersP.compareDatasets(problemFile, remote, false); }
@Test public void doOne() throws IOException { String name = StringUtil2.substitute(filename.substring(contentRoot.length()), "\\", "/"); String remote = TestOnLocalServer.withHttpPath(urlPath + name); total++; success += compareDatasets(filename, remote, true); }
@Test public void doOne() throws IOException { String name = StringUtil2.substitute(filename.substring(contentRoot.length()), "\\", "/"); String remote = TestOnLocalServer.withHttpPath(urlPath + name); total++; success += compareDatasets(filename, remote, false); }