public static boolean canOpen(Object source){
  if (!gdalIsAvailable.get()) {
    return false;
  }
  File file=(null != source) ? WWIO.getFileForLocalAddress(source) : null;
  if (null == file) {
    return false;
  }
  Dataset ds=null;
  boolean canOpen=false;
  try {
    gdal.PushErrorHandler("CPLQuietErrorHandler");
    if (file.exists() && file.canRead()) {
      ds=gdal.Open(file.getAbsolutePath(),gdalconst.GA_ReadOnly);
      canOpen=!(ds == null);
    }
  }
 catch (  Throwable t) {
  }
 finally {
    if (null != ds) {
      ds.delete();
    }
    gdal.PopErrorHandler();
  }
  return canOpen;
}

public static boolean canOpen ( Object source ) { if ( ! gdalIsAvailable . get ( ) ) { return false ; } File file = ( null != source ) ? WWIO . getFileForLocalAddress ( source ) : null ; if ( null == file ) { return false ; } Dataset ds = null ; boolean canOpen = false ; try { gdal . PushErrorHandler ( "CPLQuietErrorHandler" ) ; if ( file . exists ( ) && file . canRead ( ) ) { ds = gdal . Open ( file . getAbsolutePath ( ) , gdalconst . GA_ReadOnly ) ; canOpen = ! ( ds == null ) ; } } catch ( Throwable t ) { } finally { if ( null != ds ) { ds . delete ( ) ; } gdal . PopErrorHandler ( ) ; } return canOpen ; }
checks if a data raster can is readable
