@Test public void getContentWhenFileDoesNotExist() throws Exception { LESSSkinFileResourceReference lessSkinFileResourceReference = new LESSSkinFileResourceReference("not-existing-file.less", templateManager, skinManager); LESSCompilerException caughtException = null; try { lessSkinFileResourceReference.getContent("skin"); } catch (LESSCompilerException e) { caughtException = e; } assertNotNull(caughtException); assertEquals("The template [not-existing-file.less] does not exists.", caughtException.getMessage()); }
@Override public String getContent(String skin) throws LESSCompilerException { Template template = templateManager.getTemplate("less/" + fileName, skinManager.getSkin(skin)); if (template == null) { throw new LESSCompilerException(String.format("The template [%s] does not exists.", fileName)); } try { return template.getContent().getContent(); } catch (Exception e) { throw new LESSCompilerException( String.format("Failed to get the content of the template [%s].", fileName), e); } }
LESSSkinFileResourceReference implements LESSResourceReference { @Override public String getContent(String skin) throws LESSCompilerException { Template template = templateManager.getTemplate("less/" + fileName, skinManager.getSkin(skin)); if (template == null) { throw new LESSCompilerException(String.format("The template [%s] does not exists.", fileName)); } try { return template.getContent().getContent(); } catch (Exception e) { throw new LESSCompilerException( String.format("Failed to get the content of the template [%s].", fileName), e); } } }
LESSSkinFileResourceReference implements LESSResourceReference { @Override public String getContent(String skin) throws LESSCompilerException { Template template = templateManager.getTemplate("less/" + fileName, skinManager.getSkin(skin)); if (template == null) { throw new LESSCompilerException(String.format("The template [%s] does not exists.", fileName)); } try { return template.getContent().getContent(); } catch (Exception e) { throw new LESSCompilerException( String.format("Failed to get the content of the template [%s].", fileName), e); } } LESSSkinFileResourceReference(String fileName, TemplateManager templateManager, SkinManager skinManager); }
LESSSkinFileResourceReference implements LESSResourceReference { @Override public String getContent(String skin) throws LESSCompilerException { Template template = templateManager.getTemplate("less/" + fileName, skinManager.getSkin(skin)); if (template == null) { throw new LESSCompilerException(String.format("The template [%s] does not exists.", fileName)); } try { return template.getContent().getContent(); } catch (Exception e) { throw new LESSCompilerException( String.format("Failed to get the content of the template [%s].", fileName), e); } } LESSSkinFileResourceReference(String fileName, TemplateManager templateManager, SkinManager skinManager); @Override boolean equals(Object o); @Override int hashCode(); @Override String getContent(String skin); @Override String serialize(); @Override String toString(); }
LESSSkinFileResourceReference implements LESSResourceReference { @Override public String getContent(String skin) throws LESSCompilerException { Template template = templateManager.getTemplate("less/" + fileName, skinManager.getSkin(skin)); if (template == null) { throw new LESSCompilerException(String.format("The template [%s] does not exists.", fileName)); } try { return template.getContent().getContent(); } catch (Exception e) { throw new LESSCompilerException( String.format("Failed to get the content of the template [%s].", fileName), e); } } LESSSkinFileResourceReference(String fileName, TemplateManager templateManager, SkinManager skinManager); @Override boolean equals(Object o); @Override int hashCode(); @Override String getContent(String skin); @Override String serialize(); @Override String toString();  }