Code example for URL

Methods: toURI

0
public class TestL3ProductMaker { 
 
    public static NetcdfFile readL3GridsSetup() throws IOException, URISyntaxException { 
        final URL url = TestL3ProductMaker.class.getResource(
                "20100701000000-ESACCI-L3U_GHRSST-SSTskin-AATSR-LT-v02.0-fv01.0.nc"); 
        final URI uri = url.toURI();
        final File file = new File(uri);
 
        return NetcdfFile.open(file.getPath());
    } 
 
    public static NetcdfFile readL4GridsSetup() throws IOException, URISyntaxException { 
        final URL url = TestL3ProductMaker.class.getResource(
                "20100701000000-ESACCI-L4_GHRSST-SSTdepth-OSTIA-LT-v02.0-fv01.1.nc"); 
        final URI uri = url.toURI();
        final File file = new File(uri);
 
        return NetcdfFile.open(file.getPath());
    } 
}