@SuppressWarnings("unchecked")
    private void loadConfigFromFile(File file) {
        String name = file.getName();

        InputStream inputStream = null;
        Map<String, Object> map = null;
        try {
            inputStream = FileUtils.openInputStream(file);
            if (FilenameUtils.isExtension(name, "json")) {
                if (objectMapper == null) {
                    objectMapper = new ObjectMapper();
                }
                map = objectMapper.readValue(inputStream, Map.class);
            } else {
                //yaml is not thread safe, so create new instance
                map = new Yaml().loadAs(inputStream, Map.class);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            IOUtils.closeQuietly(inputStream);
        }

        if (map != null) {
            log.debug("Config loaded: {}", map);
            putAll(map);
        }
    }
@ SuppressWarnings ( "unchecked" ) private void loadConfigFromFile ( File file ) { String name = file . getName ( ) ; InputStream inputStream = null ; Map < String , Object > map = null ; try { inputStream = FileUtils . openInputStream ( file ) ; if ( FilenameUtils . isExtension ( name , "json" ) ) { if ( objectMapper == null ) { objectMapper = new ObjectMapper ( ) ; } map = objectMapper . readValue ( inputStream , Map . class ) ; } else { map = new Yaml ( ) . loadAs ( inputStream , Map . class ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } finally { IOUtils . closeQuietly ( inputStream ) ; } if ( map != null ) { log . debug ( "Config loaded: {}" , map ) ; putAll ( map ) ; } }
@param file