test_class.declarator: folder = new TemporaryFolder()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder folder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: folder
test_class.file: restx-common/src/test/java/restx/common/MoreFilesTest.java
test_class.identifier: MoreFilesTest
test_case.body: @Test
      public void should_copy_directories() throws Exception {
          File source = folder.newFolder("source");
          Files.write("test", new File(source, "test"), Charsets.UTF_8);
          File subfolder = new File(source, "subfolder");
          subfolder.mkdirs();
          Files.write("test2", new File(subfolder, "test2"), Charsets.UTF_8);
  
          Path targetDir = folder.getRoot().toPath().resolve("target");
          MoreFiles.copyDir(source.toPath(), targetDir);
  
          assertThat(targetDir.toFile()).exists();
          assertThat(targetDir.resolve("test").toFile()).exists().hasContent("test");
          assertThat(targetDir.resolve("subfolder/test2").toFile()).exists().hasContent("test2");
      }
test_case.class_method_signature: MoreFilesTest.should_copy_directories()
test_case.full_signature: @Test public void should_copy_directories()
test_case.identifier: should_copy_directories
test_case.invocations: newFolder write mkdirs write resolve toPath getRoot copyDir toPath exists assertThat toFile hasContent exists assertThat toFile resolve hasContent exists assertThat toFile resolve
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_copy_directories()
focal_class.declarator: pathToFile = new Function<Path, File>() {
          @Override
          public File apply(Path input) {
              return input.toFile();
          }
      }
focal_class.modifier: public static final
focal_class.original_string: public static final Function<? super Path, ? extends File> pathToFile = new Function<Path, File>() {
          @Override
          public File apply(Path input) {
              return input.toFile();
          }
      };
focal_class.type: Function<? super Path, ? extends File>
focal_class.var_name: pathToFile
focal_class.declarator: strToPath = new Function<String, Path>() {
          @Override
          public Path apply(String input) {
              return FileSystems.getDefault().getPath(input);
          }
      }
focal_class.modifier: public static final
focal_class.original_string: public static final Function<String, Path> strToPath = new Function<String, Path>() {
          @Override
          public Path apply(String input) {
              return FileSystems.getDefault().getPath(input);
          }
      };
focal_class.type: Function<String, Path>
focal_class.var_name: strToPath
focal_class.file: restx-common/src/main/java/restx/common/MoreFiles.java
focal_class.identifier: MoreFiles
focal_class.class_method_signature: MoreFiles.delete(Path path)
focal_class.full_signature: public static void delete(Path path)
focal_class.identifier: delete
focal_class.modifiers: public static
focal_class.parameters: (Path path)
focal_class.return: void
focal_class.signature: void delete(Path path)
focal_class.class_method_signature: MoreFiles.watch(Path dir, EventBus eventBus,
                               ExecutorService executor, WatcherSettings watcherSettings)
focal_class.full_signature: public static Closeable watch(Path dir, EventBus eventBus,
                               ExecutorService executor, WatcherSettings watcherSettings)
focal_class.identifier: watch
focal_class.modifiers: public static
focal_class.parameters: (Path dir, EventBus eventBus,
                               ExecutorService executor, WatcherSettings watcherSettings)
focal_class.return: Closeable
focal_class.signature: Closeable watch(Path dir, EventBus eventBus,
                               ExecutorService executor, WatcherSettings watcherSettings)
focal_class.class_method_signature: MoreFiles.copyDir(final Path sourceDir, final Path targetDir)
focal_class.full_signature: public static void copyDir(final Path sourceDir, final Path targetDir)
focal_class.identifier: copyDir
focal_class.modifiers: public static
focal_class.parameters: (final Path sourceDir, final Path targetDir)
focal_class.return: void
focal_class.signature: void copyDir(final Path sourceDir, final Path targetDir)
focal_class.class_method_signature: MoreFiles.checkFileExists(String location)
focal_class.full_signature: public static void checkFileExists(String location)
focal_class.identifier: checkFileExists
focal_class.modifiers: public static
focal_class.parameters: (String location)
focal_class.return: void
focal_class.signature: void checkFileExists(String location)
focal_class.class_method_signature: MoreFiles.extractZip(File zip, File toDir)
focal_class.full_signature: public static void extractZip(File zip, File toDir)
focal_class.identifier: extractZip
focal_class.modifiers: public static
focal_class.parameters: (File zip, File toDir)
focal_class.return: void
focal_class.signature: void extractZip(File zip, File toDir)
focal_class.class_method_signature: MoreFiles.removeWindowsCarriageReturnsBeforeLF(String str)
focal_class.full_signature: public static String removeWindowsCarriageReturnsBeforeLF(String str)
focal_class.identifier: removeWindowsCarriageReturnsBeforeLF
focal_class.modifiers: public static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String removeWindowsCarriageReturnsBeforeLF(String str)
focal_method.body: public static void copyDir(final Path sourceDir, final Path targetDir) throws IOException {
          Files.walkFileTree(sourceDir, new SimpleFileVisitor<Path>() {
              @Override
              public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                  Path target = targetDir.resolve(sourceDir.relativize(file));
                  File targetDir = target.getParent().toAbsolutePath().toFile();
                  if (!targetDir.exists() && !targetDir.mkdirs()) {
                      throw new IOException("can't create directory: `" + targetDir + "`");
                  }
                  Files.copy(file, target,
                          StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES);
                  return FileVisitResult.CONTINUE;
              }
          });
      }
focal_method.class_method_signature: MoreFiles.copyDir(final Path sourceDir, final Path targetDir)
focal_method.full_signature: public static void copyDir(final Path sourceDir, final Path targetDir)
focal_method.identifier: copyDir
focal_method.invocations: walkFileTree resolve relativize toFile toAbsolutePath getParent exists mkdirs copy
focal_method.modifiers: public static
focal_method.parameters: (final Path sourceDir, final Path targetDir)
focal_method.return: void
focal_method.signature: void copyDir(final Path sourceDir, final Path targetDir)