public static boolean isGrass ( String path ) { File file = new File ( path ) ; File cellFolderFile = file . getParentFile ( ) ; File mapsetFile = cellFolderFile . getParentFile ( ) ; File windFile = new File ( mapsetFile , "WIND" ) ; return cellFolderFile . getName ( ) . toLowerCase ( ) . equals ( "cell" ) && windFile . exists ( ) ; }
Checks if the given path is a GRASS raster file .