static public int cp(String src, String dest) throws Exception {
		int counter = 0;
		File srcFolder = new java.io.File(src) ;
		if(!srcFolder.exists()) throw new Exception(src + " does not exist") ;

		if(srcFolder.isFile()) {
			File destFolder = new java.io.File(dest);
			if (destFolder.isFile()) {
				dest = destFolder.getParent();
			}
			if (destFolder.exists()) {
				dest = dest + "/" + srcFolder.getName();
			}
			InputStream input = new java.io.FileInputStream(srcFolder) ;
			OutputStream output = new java.io.FileOutputStream(dest) ;
			byte[] buff = new byte[8192] ;
			int len = 0 ;
			while ((len = input.read(buff)) > 0) {
				output.write(buff, 0, len);
			}
			input.close();
			output.close();
			counter++ ;
		} else {
			File destFolder = new File(dest) ;
			if(!destFolder.exists()) {
				destFolder.mkdirs() ;
			}
			File[] child =  srcFolder.listFiles();
			for(int i = 0; i < child.length; i++) {
				File file =  child[i] ;
				if(file.isFile())  {
					counter += cp(file.getAbsolutePath(), destFolder.getAbsolutePath() + "/" +  file.getName());
				} else {
					counter += cp(file.getAbsolutePath(), destFolder.getAbsolutePath() + "/" + file.getName());
				}
			}
		}
		return counter ;
	}