ruper2/src/java/core/org/krysalis/ruper/api/tool FileUpdater.java,1.2,1.3

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

Modified Files:
	FileUpdater.java 
Log Message:
1) created a Construuctor that takes (String id) on ResourceUpdater and RepositorySet,
so Anou's config can create them.

2) Created a simple <update ant task that leverages above to update a file.

Guts of (2) not completed.

Index: FileUpdater.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/api/tool/FileUpdater.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FileUpdater.java	8 Sep 2003 23:21:40 -0000	1.2
--- FileUpdater.java	9 Sep 2003 18:37:05 -0000	1.3
***************
*** 24,27 ****
--- 24,28 ----
  import org.krysalis.ruper.repository.Repository;
  import org.krysalis.ruper.repository.RepositorySet;
+ import org.krysalis.ruper.repository.RepositorySetIdentifier;
  import org.krysalis.ruper.util.RuperConstants;
  import org.krysalis.ruper.util.text.Messages;
***************
*** 55,58 ****
--- 56,69 ----
  	 * 
  	 */
+ 	public FileUpdater(String ruperId, String reposId) throws RuperException {
+ 		this(
+ 			new FileAPI(),
+ 			new ResourceUpdaterIdentifier(ruperId),
+ 			new RepositorySetIdentifier(reposId));
+ 	}
+ 
+ 	/**
+ 	 * 
+ 	 */
  	public FileUpdater(FileAPI api, String identifier) throws RuperException {
  		this(api, new ResourceUpdaterIdentifier(identifier));
***************
*** 70,73 ****
--- 81,98 ----
  	 * 
  	 */
+ 	public FileUpdater(
+ 		FileAPI api,
+ 		ResourceUpdaterIdentifier ruperId,
+ 		RepositorySetIdentifier reposId)
+ 		throws RuperException {
+ 		this(
+ 			api,
+ 			ResourceUpdater.getResourceUpdater(ruperId, true),
+ 			RepositorySet.getRepositorySet(reposId, true));
+ 	}
+ 
+ 	/**
+ 	 * 
+ 	 */
  	public FileUpdater(FileAPI api, ResourceUpdater ruper) {
  		m_ruper = ruper;
***************
*** 77,80 ****
--- 102,117 ----
  
  	/**
+ 	 * 
+ 	 */
+ 	public FileUpdater(
+ 		FileAPI api,
+ 		ResourceUpdater ruper,
+ 		RepositorySet repos) {
+ 		m_ruper = ruper;
+ 		m_api = api;
+ 		m_repos = repos;
+ 	}
+ 
+ 	/**
  	* 
  	*/
***************
*** 117,126 ****
  
  	public void updateFile(File file) throws RuperException {
! 		
! 		String parentFolder = file.getParent();
  
  		System.out.println("File: " + file);
  		System.out.println("Folder: " + parentFolder);
! 		
  		//
  		// A flat repository to put things
--- 154,163 ----
  
  	public void updateFile(File file) throws RuperException {
! 
! 		String parentFolder = m_api.resolveFile(file).getParent();
  
  		System.out.println("File: " + file);
  		System.out.println("Folder: " + parentFolder);
! 
  		//
  		// A flat repository to put things




-------------------------------------------------------
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.