static public void main4(String[] args) { String url = "http://whoopee:8080/thredds/dodsC/test/2005052412_NAM.wmo.dods?Best_4-layer_lifted_index"; String filenameOut = "C:/temp/tempFile4.compress"; File f = new File(filenameOut); long start = System.currentTimeMillis(); String result = readURLtoFile(url, f); double took = .001 * (System.currentTimeMillis() - start); System.out.println(result); System.out.println(" that took = " + took + "sec"); System.out.println(" file size = " + f.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 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()); }
static public void testRead() { String baseUrl = "http://moca.virtual.museum/legac/legac01.htm"; String baseDir = ""; File dir = new File(baseDir); dir.mkdirs(); for (int i = 1; i < 159; i++) { String n = StringUtil2.padZero(i, 3); String filename = n + ".jpg"; System.out.println("Open " + baseDir + filename); File file = new File(baseDir + filename); readURLtoFile(baseUrl + filename, file); } }
private void showGetCoverage(String url, String grid, String time, String vert, String bb) throws IOException { String getURL = url+"?request=GetCoverage&version=1.0.0&service=WCS&format=NetCDF3&coverage="+grid; if (time != null) getURL = getURL + "&time="+time; if (vert != null) getURL = getURL + "&vertical="+vert; if (bb != null) getURL = getURL + "&bbox="+bb; File file = new File("C:/TEMP/"+grid+"3.nc"); IO.readURLtoFile(getURL, file); System.out.println(" copied contents to "+file.getPath()); }