@Test public void testHadoopFsListAsArray() { try { String tmpFileName1 = "/tmp/testHadoopFsListAsArray1"; String tmpFileName2 = "/tmp/testHadoopFsListAsArray2"; File tmpFile1 = new File(tmpFileName1); File tmpFile2 = new File(tmpFileName2); tmpFile1.createNewFile(); tmpFile2.createNewFile(); Assert.assertTrue(TempletonUtils.hadoopFsListAsArray(null, null, null) == null); Assert.assertTrue(TempletonUtils.hadoopFsListAsArray(tmpFileName1 + "," + tmpFileName2, null, null) == null); String[] tmp2 = TempletonUtils.hadoopFsListAsArray(tmpFileName1 + "," + tmpFileName2, new Configuration(), null); Assert.assertEquals("file:" + tmpFileName1, tmp2[0]); Assert.assertEquals("file:" + tmpFileName2, tmp2[1]); tmpFile1.delete(); tmpFile2.delete(); } catch (FileNotFoundException e) { Assert.fail("Couldn't find name for " + tmpFile.toURI().toString()); } catch (Exception e) { e.printStackTrace(); } try { TempletonUtils.hadoopFsListAsArray("/scoobydoo/teddybear,joe", new Configuration(), null); Assert.fail("Should not have found /scoobydoo/teddybear"); } catch (FileNotFoundException e) { } catch (Exception e) { e.printStackTrace(); } }
public static String[] hadoopFsListAsArray(String files, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { if (files == null || conf == null) { return null; } String[] dirty = files.split(","); String[] clean = new String[dirty.length]; for (int i = 0; i < dirty.length; ++i) clean[i] = hadoopFsFilename(dirty[i], conf, user); return clean; }
TempletonUtils { public static String[] hadoopFsListAsArray(String files, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { if (files == null || conf == null) { return null; } String[] dirty = files.split(","); String[] clean = new String[dirty.length]; for (int i = 0; i < dirty.length; ++i) clean[i] = hadoopFsFilename(dirty[i], conf, user); return clean; } }
TempletonUtils { public static String[] hadoopFsListAsArray(String files, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { if (files == null || conf == null) { return null; } String[] dirty = files.split(","); String[] clean = new String[dirty.length]; for (int i = 0; i < dirty.length; ++i) clean[i] = hadoopFsFilename(dirty[i], conf, user); return clean; }  }
TempletonUtils { public static String[] hadoopFsListAsArray(String files, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { if (files == null || conf == null) { return null; } String[] dirty = files.split(","); String[] clean = new String[dirty.length]; for (int i = 0; i < dirty.length; ++i) clean[i] = hadoopFsFilename(dirty[i], conf, user); return clean; }  static boolean isset(String s); static boolean isset(char ch); static boolean isset(T[] a); static boolean isset(Collection<T> col); static boolean isset(Map<K, V> col); static String extractPercentComplete(String line); static String extractChildJobId(String line); static String encodeArray(String[] plain); static String encodeArray(List<String> list); static String[] decodeArray(String s); static String[] hadoopFsListAsArray(String files, Configuration conf,
                         String user); static String hadoopFsListAsString(String files, Configuration conf,
                        String user); static String hadoopFsFilename(String fname, Configuration conf, String user); static boolean hadoopFsIsMissing(FileSystem fs, Path p); static String addUserHomeDirectoryIfApplicable(String origPathStr, String user); static Path hadoopFsPath(String fname, final Configuration conf, String user); static int fetchUrl(URL url); static Map<String, String> hadoopUserEnv(String user,
                          String overrideClasspath); static String quoteForWindows(String param); static void addCmdForWindows(ArrayList<String> args); }
TempletonUtils { public static String[] hadoopFsListAsArray(String files, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { if (files == null || conf == null) { return null; } String[] dirty = files.split(","); String[] clean = new String[dirty.length]; for (int i = 0; i < dirty.length; ++i) clean[i] = hadoopFsFilename(dirty[i], conf, user); return clean; }  static boolean isset(String s); static boolean isset(char ch); static boolean isset(T[] a); static boolean isset(Collection<T> col); static boolean isset(Map<K, V> col); static String extractPercentComplete(String line); static String extractChildJobId(String line); static String encodeArray(String[] plain); static String encodeArray(List<String> list); static String[] decodeArray(String s); static String[] hadoopFsListAsArray(String files, Configuration conf,
                         String user); static String hadoopFsListAsString(String files, Configuration conf,
                        String user); static String hadoopFsFilename(String fname, Configuration conf, String user); static boolean hadoopFsIsMissing(FileSystem fs, Path p); static String addUserHomeDirectoryIfApplicable(String origPathStr, String user); static Path hadoopFsPath(String fname, final Configuration conf, String user); static int fetchUrl(URL url); static Map<String, String> hadoopUserEnv(String user,
                          String overrideClasspath); static String quoteForWindows(String param); static void addCmdForWindows(ArrayList<String> args); static final Pattern JAR_COMPLETE; static final Pattern PIG_COMPLETE; static final Pattern JAR_ID; static final Pattern PIG_ID; static final Pattern[] ID_PATTERNS; }