Exemple #1
0
 public static byte[] input(String fileName) {
   try {
     return input(Files.newInputStream(IO.path(fileName)));
   } catch (IOException e) {
     return Exceptions.handle(byte[].class, e);
   }
 }
Exemple #2
0
  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;
  }
Exemple #3
0
 public static void output(Path file, byte[] bytes) {
   IO.write(file, bytes);
 }
Exemple #4
0
 @Override
 public Path apply(String s) {
   return IO.path(s);
 }