code: public static int copyFile(String from, String to) {
  		InputStream inStream = null;
  		FileOutputStream fs = null;
  		try {
  			int bytesum = 0;
  			int byteread;
  			File oldfile = new File(from);
  			if (oldfile.exists()) {
  				inStream = new FileInputStream(from);
  				fs = new FileOutputStream(to);
  				byte[] buffer = new byte[1444];
  				while ((byteread = inStream.read(buffer)) != -1) {
  					bytesum += byteread;
  					fs.write(buffer, 0, byteread);
  				}
  			}
  			return bytesum;
  		} catch (Exception e) {
  			return 0;
  		} finally {
  			Util.ensureClosed(inStream);
  			Util.ensureClosed(fs);
  		}
  	}
docs: This function copies file from one location to another
  
  @param from the full path to the source file
  @param to   the full path to the destination file
  @return total bytes copied. 0 indicates