if(!arcDir.isDirectory()) {
arcDir.mkdir();
}
File [] files = {arcDir};
boolean compress = true;
ARCWriter writer = new ARCWriter(new AtomicInteger(),
Arrays.asList(files), "test", compress,
DEFAULT_MAX_ARC_FILE_SIZE);
Properties p = new Properties();
p.setProperty(ARCCacheDirectory.LIVE_WEB_ARC_DIR, args[0]);
p.setProperty(ARCCacheDirectory.LIVE_WEB_ARC_PREFIX, "test");
p.setProperty(CACHE_PATH, arcDir.getAbsolutePath());
URLCacher uc = new URLCacher();
ARCCacheDirectory cache = new ARCCacheDirectory();
// try {
//// cache.init(p);
//// uc.init(p);
// } catch (ConfigurationException e) {
// e.printStackTrace();
// System.exit(1);
// }
for(int k = 1; k < args.length; k++) {
try {
url = new URL(args[k]);
} catch (MalformedURLException e1) {
e1.printStackTrace();
continue;
}
try {
uc.cache(cache, url.toString());
} catch (URIException e) {
e.printStackTrace();
} catch (LiveDocumentNotAvailableException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
try {
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}