@Test public void loadIconSet() throws Exception { Reader content = new InputStreamReader(getClass().getResourceAsStream("/test.iconset")); IconSet result = iconSetLoader.loadIconSet(content, "FontAwesome"); verifies(result); assertEquals("FontAwesome", result.getName()); }
@Override public IconSet loadIconSet(DocumentReference iconSetReference) throws IconException { try { DocumentModelBridge doc = documentAccessBridge.getDocumentInstance(iconSetReference); String content = doc.getContent(); DocumentReference iconClassRef = new DocumentReference(wikiDescriptorManager.getCurrentWikiId(), "IconThemesCode", "IconThemeClass"); String name = (String) documentAccessBridge.getProperty(iconSetReference, iconClassRef, "name"); return loadIconSet(new StringReader(content), name); } catch (Exception e) { throw new IconException(String.format(ERROR_MSG, iconSetReference), e); } }
DefaultIconSetLoader implements IconSetLoader { @Override public IconSet loadIconSet(DocumentReference iconSetReference) throws IconException { try { DocumentModelBridge doc = documentAccessBridge.getDocumentInstance(iconSetReference); String content = doc.getContent(); DocumentReference iconClassRef = new DocumentReference(wikiDescriptorManager.getCurrentWikiId(), "IconThemesCode", "IconThemeClass"); String name = (String) documentAccessBridge.getProperty(iconSetReference, iconClassRef, "name"); return loadIconSet(new StringReader(content), name); } catch (Exception e) { throw new IconException(String.format(ERROR_MSG, iconSetReference), e); } } }
DefaultIconSetLoader implements IconSetLoader { @Override public IconSet loadIconSet(DocumentReference iconSetReference) throws IconException { try { DocumentModelBridge doc = documentAccessBridge.getDocumentInstance(iconSetReference); String content = doc.getContent(); DocumentReference iconClassRef = new DocumentReference(wikiDescriptorManager.getCurrentWikiId(), "IconThemesCode", "IconThemeClass"); String name = (String) documentAccessBridge.getProperty(iconSetReference, iconClassRef, "name"); return loadIconSet(new StringReader(content), name); } catch (Exception e) { throw new IconException(String.format(ERROR_MSG, iconSetReference), e); } }  }
DefaultIconSetLoader implements IconSetLoader { @Override public IconSet loadIconSet(DocumentReference iconSetReference) throws IconException { try { DocumentModelBridge doc = documentAccessBridge.getDocumentInstance(iconSetReference); String content = doc.getContent(); DocumentReference iconClassRef = new DocumentReference(wikiDescriptorManager.getCurrentWikiId(), "IconThemesCode", "IconThemeClass"); String name = (String) documentAccessBridge.getProperty(iconSetReference, iconClassRef, "name"); return loadIconSet(new StringReader(content), name); } catch (Exception e) { throw new IconException(String.format(ERROR_MSG, iconSetReference), e); } }  @Override IconSet loadIconSet(DocumentReference iconSetReference); @Override IconSet loadIconSet(Reader input, String name); }
DefaultIconSetLoader implements IconSetLoader { @Override public IconSet loadIconSet(DocumentReference iconSetReference) throws IconException { try { DocumentModelBridge doc = documentAccessBridge.getDocumentInstance(iconSetReference); String content = doc.getContent(); DocumentReference iconClassRef = new DocumentReference(wikiDescriptorManager.getCurrentWikiId(), "IconThemesCode", "IconThemeClass"); String name = (String) documentAccessBridge.getProperty(iconSetReference, iconClassRef, "name"); return loadIconSet(new StringReader(content), name); } catch (Exception e) { throw new IconException(String.format(ERROR_MSG, iconSetReference), e); } }  @Override IconSet loadIconSet(DocumentReference iconSetReference); @Override IconSet loadIconSet(Reader input, String name);  }