public static void copyFile(File src, File dest) {
		if (!dest.getParentFile().exists() && !dest.getParentFile().mkdirs()) {
			throw new RuntimeException("Cannot create directory tree: " + dest.getParent());
		}
		try {
			byte[] buffer = new byte[1048576];
			InputStream inp = new FileInputStream(src);
			OutputStream out = new FileOutputStream(dest);
			while (true) {
				int bytesRead = inp.read(buffer);
				if (bytesRead <= 0) {
					break;
				}
				out.write(buffer, 0, bytesRead);
			}
			out.close();
			inp.close();
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		}
	}