ruper2/src/java/core/org/krysalis/ruper/tool Tool.java,1.2,1.3 RepositoryTool.java,1.7,1.8 FileTool.java,1.1,1.2 ResourceTool.java,1.1,1.2

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/tool
In directory sc8-pr-cvs1:/tmp/cvs-serv5134/src/java/core/org/krysalis/ruper/tool

Modified Files:
	Tool.java RepositoryTool.java FileTool.java ResourceTool.java 
Log Message:
1) Finished Query & Query Engine
2) Worked on Files

Index: Tool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/tool/Tool.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Tool.java	7 Sep 2003 23:30:00 -0000	1.2
--- Tool.java	8 Sep 2003 23:21:39 -0000	1.3
***************
*** 4,7 ****
--- 4,10 ----
  package org.krysalis.ruper.tool;
  
+ import java.io.PrintWriter;
+ 
+ import org.krysalis.version.util.SystemUtils;
  import org.krysalis.version.util.cli.CommandLine;
  import org.krysalis.version.util.cli.CommandLineParser;
***************
*** 32,38 ****
  		return l_options;
  	}
  
  	protected abstract void init();
! 	protected abstract void printHelp();
  	protected abstract void execute(CommandLine cmdline) throws Exception;
  
--- 35,47 ----
  		return l_options;
  	}
+ 	
+ 	protected PrintWriter getOutput() {
+ 		return SystemUtils.getSystemOut();
+ 	}
  
  	protected abstract void init();
! 	protected void printHelp() {
! 		getOptions().display();
! 	}
  	protected abstract void execute(CommandLine cmdline) throws Exception;
  
***************
*** 56,65 ****
  
  	public void run(String args[]) {
- 		init();
  		
  		CommandLine cmdline = parseCommandLine(args);
  
  		try {
  			execute(cmdline);
  		}
  		catch (Exception exc) {
--- 65,84 ----
  
  	public void run(String args[]) {
  		
+ 		SystemUtils.enableCommonsLogging();
+ 		
+ 		init();
+ 
  		CommandLine cmdline = parseCommandLine(args);
  
  		try {
  			execute(cmdline);
+ 		}
+ 		catch (ParseException pe) {
+ 			SystemUtils.getSystemErr().println(
+ 				"Error: " + pe.getLocalizedMessage());
+ 			printHelp();
+ 			cmdline.print();
+ 			System.exit(1);
  		}
  		catch (Exception exc) {

Index: RepositoryTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/tool/RepositoryTool.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** RepositoryTool.java	7 Sep 2003 23:30:00 -0000	1.7
--- RepositoryTool.java	8 Sep 2003 23:21:39 -0000	1.8
***************
*** 11,18 ****
  import org.krysalis.ruper.repository.DefaultRepository;
  import org.krysalis.ruper.repository.RepositoryWrapper;
! import org.krysalis.ruper.resource.ResourceSpecifier;
  import org.krysalis.ruper.util.select.AllSelector;
  import org.krysalis.version.util.cli.CommandLine;
- import org.krysalis.version.util.cli.Option;
  import org.krysalis.version.util.debug.DebugUtils;
  
--- 11,17 ----
  import org.krysalis.ruper.repository.DefaultRepository;
  import org.krysalis.ruper.repository.RepositoryWrapper;
! import org.krysalis.ruper.resource.ResourceGroup;
  import org.krysalis.ruper.util.select.AllSelector;
  import org.krysalis.version.util.cli.CommandLine;
  import org.krysalis.version.util.debug.DebugUtils;
  
***************
*** 25,31 ****
  	}
  	
- 	public void printHelp() {
- 		//:TODO:
- 	}
  
  	public void execute(CommandLine cmdline) throws Exception {
--- 24,27 ----
***************
*** 39,43 ****
  		DebugUtils.dump(
  			repo.listResources(
! 				new ResourceSpecifier("junit"),
  				AllSelector.getInstance()));
  	}
--- 35,39 ----
  		DebugUtils.dump(
  			repo.listResources(
! 				new ResourceGroup("junit"),
  				AllSelector.getInstance()));
  	}

Index: FileTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/tool/FileTool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileTool.java	7 Sep 2003 23:30:00 -0000	1.1
--- FileTool.java	8 Sep 2003 23:21:39 -0000	1.2
***************
*** 21,27 ****
  
  	static {
! 
! 		l_fileOption = new Option("f", "file", false, "resoruce");
! 
  	}
  
--- 21,25 ----
  
  	static {
! 		l_fileOption = new Option("f", "file", true, "Filename");
  	}
  
***************
*** 30,44 ****
  	}
  
- 	public void printHelp() {
- 		//:TODO:
- 	}
- 
  	public void execute(CommandLine cmdline) throws Exception {
  
! 		String resource = cmdline.getOptionValue(l_fileOption);
  
  		FileUpdater fu = new FileUpdater();
  
! 		ResourceResult result = fu.determineFileUpdates(resource);
  
  		DebugUtils.dump(result);
--- 28,40 ----
  	}
  
  	public void execute(CommandLine cmdline) throws Exception {
  
! 		String fileName = cmdline.getMandatoryOptionValue(l_fileOption);
  
  		FileUpdater fu = new FileUpdater();
+ 		
+ 		getOutput().println("File: [" + fileName + "]");
  
! 		ResourceResult result = fu.determineFileUpdates(fileName);
  
  		DebugUtils.dump(result);
***************
*** 46,50 ****
  
  	public static void main(String[] args) {
! 		(new ResourceTool()).run(args);
  	}
  }
--- 42,46 ----
  
  	public static void main(String[] args) {
! 		(new FileTool()).run(args);
  	}
  }

Index: ResourceTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/tool/ResourceTool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ResourceTool.java	7 Sep 2003 23:30:00 -0000	1.1
--- ResourceTool.java	8 Sep 2003 23:21:39 -0000	1.2
***************
*** 11,14 ****
--- 11,15 ----
  import org.krysalis.ruper.query.ResourceRequest;
  import org.krysalis.ruper.query.ResourceResult;
+ import org.krysalis.ruper.query.ResourceSpecifierRequest;
  import org.krysalis.ruper.resource.ResourceSpecifier;
  import org.krysalis.version.util.cli.CommandLine;
***************
*** 24,28 ****
  	static {
  
! 		l_resourceOption = new Option("r", "resource", false, "resoruce");
  
  	}
--- 25,29 ----
  	static {
  
! 		l_resourceOption = new Option("r", "resource", false, "resource");
  
  	}
***************
*** 32,49 ****
  	}
  
- 	public void printHelp() {
- 		//:TODO:
- 	}
- 
- 	
  	public void execute(CommandLine cmdline) throws Exception {
  
! 		String resource = cmdline.getOptionValue(l_resourceOption);
  
  		ResourceUpdater ru = new ResourceUpdater();
  		
  		ResourceSpecifier specifier = new ResourceSpecifier(resource);
! 		ResourceRequest request = new ResourceRequest(specifier);
! 		ResourceResult result = ru.query(request);
  		
  		DebugUtils.dump(result);
--- 33,45 ----
  	}
  
  	public void execute(CommandLine cmdline) throws Exception {
  
! 		String resource = cmdline.getMandatoryOptionValue(l_resourceOption);
  
  		ResourceUpdater ru = new ResourceUpdater();
  		
  		ResourceSpecifier specifier = new ResourceSpecifier(resource);
! 		ResourceRequest request = new ResourceSpecifierRequest(specifier);
! 		ResourceResult result = ru.performRequest(request);
  		
  		DebugUtils.dump(result);




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.