public static void copy(File srcDir,File relSrcFile,File destDir,File relDestFile) throws IOException {
  File finalSrcFile=(srcDir != null) ? new File(srcDir,relSrcFile.getPath()) : relSrcFile;
  File relDestDir=relDestFile.getParentFile();
  if (relDestDir != null) {
    File finalDestDir=(destDir != null) ? new File(destDir,relDestDir.getPath()) : relDestDir;
    mkdirs(finalDestDir);
  }
  File finalDestFile=new File(destDir,relDestFile.getPath());
  Files.copy(finalSrcFile.toPath(),finalDestFile.toPath(),StandardCopyOption.REPLACE_EXISTING,StandardCopyOption.COPY_ATTRIBUTES);
}

public static void copy ( File srcDir , File relSrcFile , File destDir , File relDestFile ) throws IOException { File finalSrcFile = ( srcDir != null ) ? new File ( srcDir , relSrcFile . getPath ( ) ) : relSrcFile ; File relDestDir = relDestFile . getParentFile ( ) ; if ( relDestDir != null ) { File finalDestDir = ( destDir != null ) ? new File ( destDir , relDestDir . getPath ( ) ) : relDestDir ; mkdirs ( finalDestDir ) ; } File finalDestFile = new File ( destDir , relDestFile . getPath ( ) ) ; Files . copy ( finalSrcFile . toPath ( ) , finalDestFile . toPath ( ) , StandardCopyOption . REPLACE_EXISTING , StandardCopyOption . COPY_ATTRIBUTES ) ; }
copy the specified source file given relative to the specified source folder to the specified destination file relative to the specified destination folder
