public FaviconHandler() throws IOException { favicon = ResourceUtil.getResourceAsBytes("org/ujmp/jetty/favicon.ico"); }
public HomeHandler() throws IOException { header = ResourceUtil.getResourceAsString("org/ujmp/jetty/header.html"); footer = ResourceUtil.getResourceAsString("org/ujmp/jetty/footer.html"); }
public Preloader() { super(); try { ImageIcon icon = ResourceUtil.loadImageIcon("org/ujmp/gui/preloader.gif"); setIcon(icon); } catch (IOException e) { setText("loading..."); } setHorizontalAlignment(JLabel.CENTER); setVerticalAlignment(JLabel.CENTER); }
@Test public void testImportPDFFile() throws Exception { File file = File.createTempFile("test", ".pdf"); ResourceUtil.copyToFile(PDFRESOURCE, file); assertTrue(file.exists()); Matrix m = Matrix.Factory.importFrom().file(file).asPDF(); String s = m.getAsString(0, 0); assertEquals("test", s.trim()); file.delete(); assertFalse(file.exists()); }
@Test public void testImportPDFStream() throws Exception { InputStream is = ResourceUtil.getResourceAsStream(PDFRESOURCE); Matrix m = Matrix.Factory.importFrom().stream(is).asPDF(); String s = m.getAsString(0, 0); assertEquals("test", s.trim()); } }
public static ImageIcon loadImageIcon(String url) throws IOException { byte[] data = getResourceAsBytes(url); ImageIcon icon = new ImageIcon(data); return icon; }
public StylesheetHandler() throws IOException { stylesheet = ResourceUtil.getResourceAsString("org/ujmp/jetty/style.css"); }
public RobotsHandler() throws IOException { robots = ResourceUtil.getResourceAsString("org/ujmp/jetty/robots.txt"); }