public static byte[] input(String fileName) { try { return input(Files.newInputStream(IO.path(fileName))); } catch (IOException e) { return Exceptions.handle(byte[].class, e); } }
private static List<String> listFromDefaultClassLoader(String s) { List<String> result = new ArrayList<>(); String newPath = s; final List<Path> resources = Classpaths.resources(IO.class, newPath); for (Path resourcePath : resources) { if (Files.isDirectory(resourcePath)) { result.addAll(IO.list(resourcePath)); } else { result.add(resourcePath.toString()); } } // for ( int index = 0; index < result.size(); index++ ) { // result.set( index, "classpath:" + result.get( index ) ); // } return result; }
public static void output(Path file, byte[] bytes) { IO.write(file, bytes); }
@Override public Path apply(String s) { return IO.path(s); }