code: public static boolean copy(File pFromFile, File pToFile, boolean pOverWrite) throws IOException {
          // Copy all directory structure
          if (pFromFile.isDirectory()) {
              return copyDir(pFromFile, pToFile, pOverWrite);
          }
  
          // Check if destination is a directory
          if (pToFile.isDirectory()) {
              // Create a new file with same name as from
              pToFile = new File(pToFile, pFromFile.getName());
          }
  
          // Check if file exists, and return false if overWrite is false
          if (!pOverWrite && pToFile.exists()) {
              return false;
          }
  
          InputStream in = null;
          OutputStream out = null;
  
          try {
              // Use buffer size two times byte array, to avoid i/o bottleneck
              in = new FileInputStream(pFromFile);
              out = new FileOutputStream(pToFile);
  
              // Copy from inputStream to outputStream
              copy(in, out);
          }
          //Just pass any IOException on up the stack
          finally {
              close(in);
              close(out);
          }
  
          return true;  // If we got here, everything is probably okay.. ;-)
      }
docs: Copies the fromFile to the toFile location. If toFile is a directory, a
  new file is created in that directory, with the name of the fromFile.
  If the toFile exists, the file will not be copied, unless owerWrite is
  true.
  
  @param pFromFile  The file to copy from
  @param pToFile    The file to copy to
  @param pOverWrite Specifies if the toFile should be overwritten, if it
  exists.
  @return {@code true} if the file was copied successfully,
  {@code false} if the output file exists, and the
  {@code pOwerWrite} parameter is
  {@code false}. In all other cases, an
  {@code IOExceptio}n is thrown, and the method does not return.
  @throws IOException if an i/o error occurs during copy
  @todo Test copyDir functionality!