public HashMap readFileFromCRAFT ( String arg0 ) { HashMap brMap ; try { File dir = new File ( arg0 ) ; // Data frin CRAFT with DSSAT format if ( dir . isDirectory ( ) ) { List < File > files = new ArrayList ( ) ; for ( File f : dir . listFiles ( ) ) { String name = f . getName ( ) . toUpperCase ( ) ; // XFile folder if ( name . equals ( "FILEX" ) ) { for ( File exp : f . listFiles ( ) ) { if ( exp . isFile ( ) ) { String expName = exp . getName ( ) . toUpperCase ( ) ; if ( expName . matches ( ".+\\.\\w{2}X" ) ) { files . add ( exp ) ; } } } } // Weather folder else if ( name . equals ( "WEATHER" ) ) { for ( File wth : f . listFiles ( ) ) { if ( wth . isFile ( ) ) { String wthName = wth . getName ( ) . toUpperCase ( ) ; if ( wthName . endsWith ( ".WTH" ) ) { files . add ( wth ) ; } } } } // Soil file else if ( f . isFile ( ) && name . endsWith ( ".SOL" ) ) { files . add ( f ) ; } } brMap = getBufferReader ( files ) ; } else { LOG . error ( "You need to provide the CRAFT working folder used for generating DSSAT files." ) ; return new HashMap ( ) ; } } catch ( IOException e ) { LOG . error ( Functions . getStackTrace ( e ) ) ; return new HashMap ( ) ; } return read ( brMap ) ; }
All DSSAT Data input method specially used for DSSAT files generated by CRAFT