private File toFile ( File rootDir , String location ) { File locationFile = rootDir ; if ( location != null ) { URI locationURI = URI . create ( location ) ; locationFile = new File ( locationURI . getPath ( ) ) ; if ( locationURI . getScheme ( ) == null ) { locationFile = new File ( rootDir , location ) ; } else if ( ! "file" . equals ( locationURI . getScheme ( ) ) ) { throw new IllegalArgumentException ( "Unexpected resources directory: " + location ) ; } } return locationFile ; }
Converts a location in the gateway configuration file into a file relative to a specified root directory .