public static void copy(File source,File destination) throws IOException {
  Validate.notNull(source,"source is null");
  Validate.notNull(destination,"destination is null");
  if (source.equals(destination)) {
    return;
  }
  InputStream input=null;
  OutputStream output=null;
  try {
    input=new FileInputStream(source);
    try {
      output=new FileOutputStream(destination);
      copy(input,output);
    }
  finally {
      if (output != null) {
        output.close();
      }
    }
  }
  finally {
    if (input != null) {
      input.close();
    }
  }
}

public static void copy ( File source , File destination ) throws IOException { Validate . notNull ( source , "source is null" ) ; Validate . notNull ( destination , "destination is null" ) ; if ( source . equals ( destination ) ) { return ; } InputStream input = null ; OutputStream output = null ; try { input = new FileInputStream ( source ) ; try { output = new FileOutputStream ( destination ) ; copy ( input , output ) ; } finally { if ( output != null ) { output . close ( ) ; } } } finally { if ( input != null ) { input . close ( ) ; } } }
copies all the bytes from one file to another . .
