public static int archive(ZipOutputStream os, List<File> files, File baseDir) {
		BufferedInputStream bis = null;
		try {
			for (File f : files) {
				if (f.isDirectory())
					continue;
				String filePath = f.getAbsolutePath();
				// zip 안에 들어갈 상대경로를 추출
				if (!filePath.startsWith(baseDir.getAbsolutePath())) {
					System.err.println("not in basedir. omitted: " + f);
					continue;
				}
//				String zipEntryName = filePath.substring(baseDir.getAbsolutePath().length() + 1, filePath.length());
				String zipEntryName = extractSubPath(f, baseDir);

				try {
					ZipEntry zEntry = new ZipEntry(zipEntryName);
					zEntry.setTime(f.lastModified());
					os.putNextEntry(zEntry);

					bis = new BufferedInputStream(new FileInputStream(f));

					byte[] buffer = new byte[BUFFER_SIZE];
					int cnt = 0;
					while ((cnt = bis.read(buffer, 0, BUFFER_SIZE)) != -1) {
						os.write(buffer, 0, cnt);
					}
					os.closeEntry();
					bis.close();
				} catch (FileNotFoundException e) {
					logger.warn("target file not found", e);
					continue;
				} catch (IOException e) {
					logger.warn("exception while reading file", e);
					continue;
				}
			}
		} finally {
			if (bis != null) {
				try {
					bis.close();
				} catch (IOException e) {
					e.printStackTrace();
					// ignore
				}
			}
		}
		return 0;
	}