public Config parse ( File file , Config ... overrides ) throws IOException { if ( file == null || file . getPath ( ) . trim ( ) . length ( ) == 0 ) { throw new MorphlineCompilationException ( "Missing morphlineFile parameter" , null ) ; } if ( ! file . exists ( ) ) { throw new FileNotFoundException ( "File not found: " + file ) ; } if ( ! file . canRead ( ) ) { throw new IOException ( "Insufficient permissions to read file: " + file ) ; } Config config = ConfigFactory . parseFile ( file ) ; for ( Config override : overrides ) { config = override . withFallback ( config ) ; } synchronized ( LOCK ) { ConfigFactory . invalidateCaches ( ) ; config = ConfigFactory . load ( config ) ; config . checkValid ( ConfigFactory . defaultReference ( ) ) ; // eagerly validate aspects of tree config } return config ; }
Loads the given config file from the local file system