Utility { public static String join(String[] args, String delimiter) { return join(Arrays.asList(args), delimiter); }  static StepInformation getSorter(Order sortOrder); static StepInformation getSorter(Order sortOrder, CompressionType c); static StepInformation getSorter(Order sortOrder, Class<?> reducerClass, CompressionType c); static int getFreePort(); static boolean isInteger(String s); static String strip(String source, String suffix); static String[] subarray(String[] master, int index); static String join(String[] args, String delimiter); static String join(List<String> args, String delimiter); static String join(String[] args); static String join(Object[] args, String delimiter); static String join(double[] numbers); static String join(double[] numbers, String delimiter); static String join(int[] numbers); static String join(int[] numbers, String delimiter); static String join(short[] numbers); static String join(short[] numbers, String delimiter); @Deprecated static void copyStringToFile(String s, File file); static BufferedReader utf8Reader(String file); static BufferedReader utf8Reader(File fp); static HashSet<String> readStreamToStringSet(InputStream stream); static HashSet<String> readFileToStringSet(File file); static String readFileToString(File file); static short toShort(byte[] key); static byte[] fromShort(short key); static boolean isInt(byte[] key); static int toInt(byte[] key); static byte[] fromInt(int key); static boolean isLong(byte[] value); static long toLong(byte[] key); static byte[] fromLong(long key); static boolean isBoolean(byte[] key); static boolean toBoolean(byte[] key); static byte[] fromBoolean(boolean key); static boolean isDouble(byte[] value); static double toDouble(byte[] value); static byte[] fromDouble(double value); static final double log2; static final double loge_base2; static final double tinyLogProbScore; }
@Test public void testMakeParentDirectories() throws IOException { File f = null; File bbb = null; try { f = FileUtility.createTemporary(); bbb = new File(f.getParent(), "bbb"); String parent = f.getParent() + File.separator + Utility.join(new String[]{"bbb", "b", "c", "d"}, File.separator); String path = parent + File.separator + "e"; FSUtil.makeParentDirectories(path); assertTrue(new File(parent).isDirectory()); assertFalse(new File(path).exists()); } finally { if (f != null) { Assert.assertTrue(f.delete()); } if (bbb != null) { FSUtil.deleteDirectory(bbb); } } }