private static void addFileToZip(String path, String srcFile,
			ZipOutputStream zip, boolean pIsEmptyFolder) throws IOException {
		String prefix = path.equals("") ? "" : path + "/";
		File folder = new File(srcFile);

		String name = prefix + folder.getName();
		if (pIsEmptyFolder == true) {
			if (log.isDebugEnabled()) {
				log.debug("adding empty dir: " + name);
			}
			zip.putNextEntry(new ZipEntry(name + "/"));
		} else {
			if (!folder.isDirectory()) {
				if (log.isDebugEnabled()) {
					log.debug("adding file: " + name);
				}
				FileInputStream in = null;
				try {
					zip.putNextEntry(new ZipEntry(name));
					in = new FileInputStream(srcFile);
					IOUtils.copy(in, zip);
				} finally {
					IOUtils.closeQuietly(in);
				}
			} else {
				addFolderToZip(path, srcFile, zip);
			}
		}
	}