@Test void convert() throws IOException { final Path resolved = jarLocation(SVG2PngTest.class).toPath().resolve("test/icons"); final Path expected = resolved.resolve("logo_icon32.png"); if (Files.exists(expected)) { Files.delete(expected); } new SVG2Png(resolved, true, log).run(); assertTrue(Files.exists(expected)); }
@Override public void run() { try { Files.walkFileTree(iconsFolder, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { final String fileName = file.getFileName().toString(); if (fileName.endsWith(".svg")) { final Path svg = file .getParent() .resolve(fileName.substring(0, fileName.length() - ".svg".length()) + "_icon32.png"); if (!Files.exists(svg)) { createPng(file, svg); log.info("Created " + svg); } } return super.visitFile(file, attrs); } }); } catch (final IOException e) { throw new IllegalStateException(e); } }
SVG2Png implements Runnable { @Override public void run() { try { Files.walkFileTree(iconsFolder, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { final String fileName = file.getFileName().toString(); if (fileName.endsWith(".svg")) { final Path svg = file .getParent() .resolve(fileName.substring(0, fileName.length() - ".svg".length()) + "_icon32.png"); if (!Files.exists(svg)) { createPng(file, svg); log.info("Created " + svg); } } return super.visitFile(file, attrs); } }); } catch (final IOException e) { throw new IllegalStateException(e); } } }
SVG2Png implements Runnable { @Override public void run() { try { Files.walkFileTree(iconsFolder, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { final String fileName = file.getFileName().toString(); if (fileName.endsWith(".svg")) { final Path svg = file .getParent() .resolve(fileName.substring(0, fileName.length() - ".svg".length()) + "_icon32.png"); if (!Files.exists(svg)) { createPng(file, svg); log.info("Created " + svg); } } return super.visitFile(file, attrs); } }); } catch (final IOException e) { throw new IllegalStateException(e); } } SVG2Png(final Path iconsFolder, final boolean activeWorkarounds, final Object log); }
SVG2Png implements Runnable { @Override public void run() { try { Files.walkFileTree(iconsFolder, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { final String fileName = file.getFileName().toString(); if (fileName.endsWith(".svg")) { final Path svg = file .getParent() .resolve(fileName.substring(0, fileName.length() - ".svg".length()) + "_icon32.png"); if (!Files.exists(svg)) { createPng(file, svg); log.info("Created " + svg); } } return super.visitFile(file, attrs); } }); } catch (final IOException e) { throw new IllegalStateException(e); } } SVG2Png(final Path iconsFolder, final boolean activeWorkarounds, final Object log); @Override void run(); }
SVG2Png implements Runnable { @Override public void run() { try { Files.walkFileTree(iconsFolder, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { final String fileName = file.getFileName().toString(); if (fileName.endsWith(".svg")) { final Path svg = file .getParent() .resolve(fileName.substring(0, fileName.length() - ".svg".length()) + "_icon32.png"); if (!Files.exists(svg)) { createPng(file, svg); log.info("Created " + svg); } } return super.visitFile(file, attrs); } }); } catch (final IOException e) { throw new IllegalStateException(e); } } SVG2Png(final Path iconsFolder, final boolean activeWorkarounds, final Object log); @Override void run();  }