Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool
In directory sc8-pr-cvs1:/tmp/cvs-serv6983/src/java/core/org/krysalis/ruper2/tool
Added Files:
DownloaderTool.java
Removed Files:
GumpDownloaderTool.java
Log Message:
Final commit, before I check out & prepare for move to Apache.
--- NEW FILE: DownloaderTool.java ---
/**
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*/
package org.krysalis.ruper2.tool;
import org.krysalis.ruper2.ResourceUpdater;
import org.krysalis.ruper2.config.RuperConfig;
import org.krysalis.ruper2.repository.DefaultRepository;
import org.krysalis.ruper2.repository.IRepository;
import org.krysalis.ruper2.repository.RepositorySet;
import org.krysalis.ruper2.resource.ResourceGroup;
import org.krysalis.version.util.cli.CommandLine;
import org.krysalis.version.util.cli.Option;
/**
*/
public class DownloaderTool extends Tool {
private static Option l_targetOption = null;
private static Option l_groupOption = null;
private static Option l_configOption = null;
static {
l_configOption =
new Option("c", "config", true, "The configuration file");
l_groupOption = new Option("g", "group", true, "The group to go get");
l_targetOption =
new Option(
"t",
"target",
true,
"The target directory to put it into");
}
protected String getTitle() {
return "Ruper Resource Tool";
}
protected void init() {
getOptions().addOption(l_configOption);
getOptions().addOption(l_groupOption);
getOptions().addOption(l_targetOption);
}
private IRepository getTargetRepository(String targetDir) {
return new DefaultRepository("target", targetDir);
}
public void execute(CommandLine cmdline) throws Exception {
String groupName = cmdline.getMandatoryOptionValue(l_groupOption);
String targetDir = cmdline.getOptionValue(l_targetOption);
String configName = cmdline.getOptionValue(l_configOption);
ResourceUpdater ruper = new ResourceUpdater();
// Assigned the target (to copy into)
ruper.setDefaultTargetRepository(getTargetRepository(targetDir));
if (null != configName)
RuperConfig.configure(configName);
ruper.setDefaultRepositorySet(
RepositorySet.getRepositorySet("gump", false));
ResourceGroup group = new ResourceGroup(groupName);
// Update...
ruper.updateResourceGroup(group);
// Cleanup (to remove duplicates)
ruper.clean(group);
}
public static void main(String[] args) {
(new DownloaderTool()).run(args);
}
}
--- GumpDownloaderTool.java DELETED ---
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.