@Test public void testMain() throws IOException { final File jsdFile = Files.createTempFile("jsd", null).toFile(); jsdFile.deleteOnExit(); Converter.main(new String[] {"src/test/resources/account.jsdx", jsdFile.getAbsolutePath()}); final String jsd1 = new String(Files.readAllBytes(jsdFile.toPath())); final String jsdx = Converter.convert(jsdFile.toURI().toURL()); final URL jsdxUrl = MemoryURLStreamHandler.createURL(jsdx.getBytes()); assertEquals(jsd1, Converter.convert(jsdxUrl)); final File jsdxFile = Files.createTempFile("jsdx", null).toFile(); jsdxFile.deleteOnExit(); Converter.main(new String[] {jsdFile.getAbsolutePath(), jsdxFile.getAbsolutePath()}); final String jsdx1 = new String(Files.readAllBytes(jsdxFile.toPath())); final String jsd = Converter.convert(jsdxFile.toURI().toURL()); final URL jsdUrl = MemoryURLStreamHandler.createURL(jsd.getBytes()); assertEquals(jsdx1, Converter.convert(jsdUrl)); }
public static void main(final String[] args) throws IOException { if (args.length != 1 && args.length != 2) trapPrintUsage(); final String converted = convert(new File(args[0]).getAbsoluteFile().toURI().toURL()); if (args.length == 1) { System.out.println(converted); } else { final File destFile = new File(args[1]); destFile.getParentFile().mkdirs(); Files.write(destFile.toPath(), converted.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } }
Converter { public static void main(final String[] args) throws IOException { if (args.length != 1 && args.length != 2) trapPrintUsage(); final String converted = convert(new File(args[0]).getAbsoluteFile().toURI().toURL()); if (args.length == 1) { System.out.println(converted); } else { final File destFile = new File(args[1]); destFile.getParentFile().mkdirs(); Files.write(destFile.toPath(), converted.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } } }
Converter { public static void main(final String[] args) throws IOException { if (args.length != 1 && args.length != 2) trapPrintUsage(); final String converted = convert(new File(args[0]).getAbsoluteFile().toURI().toURL()); if (args.length == 1) { System.out.println(converted); } else { final File destFile = new File(args[1]); destFile.getParentFile().mkdirs(); Files.write(destFile.toPath(), converted.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } } private  Converter(); }
Converter { public static void main(final String[] args) throws IOException { if (args.length != 1 && args.length != 2) trapPrintUsage(); final String converted = convert(new File(args[0]).getAbsoluteFile().toURI().toURL()); if (args.length == 1) { System.out.println(converted); } else { final File destFile = new File(args[1]); destFile.getParentFile().mkdirs(); Files.write(destFile.toPath(), converted.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } } private  Converter(); static void main(final String[] args); static String jsdToJsdx(final URL url); static String jsdxToJsd(final URL url); static String convert(final URL url); }
Converter { public static void main(final String[] args) throws IOException { if (args.length != 1 && args.length != 2) trapPrintUsage(); final String converted = convert(new File(args[0]).getAbsoluteFile().toURI().toURL()); if (args.length == 1) { System.out.println(converted); } else { final File destFile = new File(args[1]); destFile.getParentFile().mkdirs(); Files.write(destFile.toPath(), converted.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } } private  Converter(); static void main(final String[] args); static String jsdToJsdx(final URL url); static String jsdxToJsd(final URL url); static String convert(final URL url);  }