test_class.declarator: fs
test_class.modifier: private
test_class.original_string: private FileSystem fs;
test_class.type: FileSystem
test_class.var_name: fs
test_class.declarator: preFrom
test_class.modifier: private
test_class.original_string: private String preFrom;
test_class.type: String
test_class.var_name: preFrom
test_class.declarator: from
test_class.modifier: private
test_class.original_string: private String from;
test_class.type: String
test_class.var_name: from
test_class.declarator: to
test_class.modifier: private
test_class.original_string: private String to;
test_class.type: String
test_class.var_name: to
test_class.file: imhotep-archive/src/test/java/com/indeed/imhotep/archive/TestCopyDirectoryToLocal.java
test_class.identifier: TestCopyDirectoryToLocal
test_class.superclass: extends TestCase
test_case.body: @Test
      public void testCopy() throws IOException {
          final List<String> dirs = Lists.newArrayList();
          final List<String> rawDirs = Lists.newArrayList();
          Random rand = new Random();
          byte[] bytes = new byte[1000];
          for (int i = 0; i < 5; ++i) {
              dirs.add(UUID.randomUUID().toString());
              rawDirs.add(dirs.get(dirs.size() - 1));
              File dir = new File(preFrom, dirs.get(dirs.size() - 1));
              dir.mkdir();
              for (int j = 0; j < 5; ++j) {
                  OutputStream os = new FileOutputStream(new File(dir, Integer.toString(j)));
                  rand.nextBytes(bytes);
                  os.write(bytes);
                  os.close();
              }
          }
  
          for (int i = 0; i < 5; ++i) {
              dirs.add(UUID.randomUUID().toString());
              rawDirs.add(dirs.get(dirs.size() - 1) + ".sqar");
              File dir = new File(preFrom, rawDirs.get(rawDirs.size() - 1));
              dir.mkdir();
              for (int j = 0; j < 5; ++j) {
                  OutputStream os = new FileOutputStream(new File(dir, Integer.toString(j)));
                  rand.nextBytes(bytes);
                  os.write(bytes);
                  os.close();
              }
          }
  
          for (File file : new File(preFrom).listFiles()) {
              CopyFromLocal.copy(fs, file, new Path(from, file.getName()), false);
          }
          CopyDirectoryToLocal.copy(fs, new Path(from), new File(to));
  
          for (int i = 0; i < dirs.size(); ++i) {
              File d1 = new File(preFrom, rawDirs.get(i));
              File d2 = new File(to, dirs.get(i));
              for (int j = 0; j < 5; ++j) {
                  assertTrue(Files.equal(new File(d1, Integer.toString(j)), new File(d2, Integer.toString(j))));
              }
          }
      }
test_case.class_method_signature: TestCopyDirectoryToLocal.testCopy()
test_case.full_signature: @Test public void testCopy()
test_case.identifier: testCopy
test_case.invocations: newArrayList newArrayList add toString randomUUID add get size get size mkdir toString nextBytes write close add toString randomUUID add get size get size mkdir toString nextBytes write close listFiles copy getName copy size get get assertTrue equal toString toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCopy()
focal_class.file: imhotep-archive/src/main/java/com/indeed/imhotep/archive/CopyDirectoryToLocal.java
focal_class.identifier: CopyDirectoryToLocal
focal_class.class_method_signature: CopyDirectoryToLocal.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_class.class_method_signature: CopyDirectoryToLocal.copy(Path from, File to)
focal_class.full_signature: public static void copy(Path from, File to)
focal_class.identifier: copy
focal_class.modifiers: public static
focal_class.parameters: (Path from, File to)
focal_class.return: void
focal_class.signature: void copy(Path from, File to)
focal_class.class_method_signature: CopyDirectoryToLocal.copy(FileSystem fs, Path from, File to)
focal_class.full_signature: public static void copy(FileSystem fs, Path from, File to)
focal_class.identifier: copy
focal_class.modifiers: public static
focal_class.parameters: (FileSystem fs, Path from, File to)
focal_class.return: void
focal_class.signature: void copy(FileSystem fs, Path from, File to)
focal_method.body: public static void copy(Path from, File to) throws IOException {
          copy(from.getFileSystem(new Configuration()), from, to);
      }
focal_method.class_method_signature: CopyDirectoryToLocal.copy(Path from, File to)
focal_method.full_signature: public static void copy(Path from, File to)
focal_method.identifier: copy
focal_method.invocations: copy getFileSystem
focal_method.modifiers: public static
focal_method.parameters: (Path from, File to)
focal_method.return: void
focal_method.signature: void copy(Path from, File to)