ruper2/src/java/ant/org/krysalis/ruper/ant/task UpdateTask.java,NONE,1.1

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

Added Files:
	UpdateTask.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.

--- NEW FILE: UpdateTask.java ---
/*
 * Created on Sep 9, 2003
 */
package org.krysalis.ruper.ant.task;

import java.io.File;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.krysalis.ruper.RuperException;
import org.krysalis.ruper.api.tool.FileUpdater;
import org.krysalis.ruper.util.RuperConstants;

/**
 * @author ajack
 */
public class UpdateTask extends Task {

	private File m_file = null;
	private String m_ruper = RuperConstants.DEFAULT;
	private String m_repositories = RuperConstants.DEFAULT;

	/**
	 * @param file
	 */
	public void setFile(File file) {
		m_file = file;
	}

	/**
	 * @param string
	 */
	public void setRepositories(String string) {
		m_repositories = string;
	}

	/**
	 * @param string
	 */
	public void setRuper(String string) {
		m_ruper = string;
	}

	/* (non-Javadoc)
	 * @see org.apache.tools.ant.Task#execute()
	 */
	public void execute() throws BuildException {
		try {
			
			//
			// This uses default or configured stuff..
			//
			FileUpdater updater = new FileUpdater(m_ruper,m_repositories);
			
			if ( null == m_file)
				throw new BuildException("Missing mandatory attribute 'file'");
				
			updater.updateFile(m_file);
		}
		catch (RuperException re) {
			throw new BuildException("Failed to <update ", re);
		}
	}


}




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