public abstract class TileFinder
{
/** URL prefix for all tiles */
- private static final String URL_PREFIX = "http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/";
+ private static final String URL_PREFIX = "https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/";
/** Directory names for each continent */
private static final String[] CONTINENTS = {"", "Eurasia", "North_America", "Australia",
"Islands", "South_America", "Africa"};
*/
private static byte[] readDatFile()
{
+ InputStream in = null;
try
{
// Need absolute path to dat file
- InputStream in = TileFinder.class.getResourceAsStream("/tim/prune/function/srtm/srtmtiles.dat");
+ in = TileFinder.class.getResourceAsStream("/tim/prune/function/srtm/srtmtiles.dat");
if (in != null)
{
byte[] buffer = new byte[in.available()];
catch (java.io.IOException e) {
System.err.println("Exception trying to read srtmtiles.dat : " + e.getMessage());
}
+ finally
+ {
+ try {
+ in.close();
+ }
+ catch (Exception e) {} // ignore
+ }
return null;
}
}