private DesignDocument.View loadViewFromFile( Map<String, DesignDocument.View> views, View input, Class<?> repositoryClass) { try { InputStream in = repositoryClass.getResourceAsStream(input.file()); if (in == null) { throw new FileNotFoundException("Could not load view file with path: " + input.file()); } String json = IOUtils.toString(in, "UTF-8"); return mapper().readValue(json.replaceAll("\n", ""), DesignDocument.View.class); } catch (Exception e) { throw Exceptions.propagate(e); } }