Index: eenstone3/trunk/src/java/org/greenstone/anttasks/MyGetUserAndPassword.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/anttasks/MyGetUserAndPassword.java	(revision 17095)
+++ 	(revision )
@@ -1,235 +1,0 @@
-/*
- *    MyGetUserAndPassword.java
- *    Copyright (C) 2005 New Zealand Digital Library, http://www.nzdl.org
- *
- *    This program is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 2 of the License, or
- *    (at your option) any later version.
- *
- *    This program is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with this program; if not, write to the Free Software
- *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.greenstone.anttasks;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
-
-/** A new ant task to prompt the user for username and password.
- * To use this task, the compiled class must be put in the classpath. add a taskdef line to the build.xml:
- * <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" />
- * and call it like the following:
- *  <getuserandpassword 
- *       message="a message to display at the top of the dialog" 
- *       userproperty="the name of the username property to set (optional)" 
- *       pwordproperty="the name of the password property to set" 
- *       username="default value for username (optional)" 
- *       if="property name (optional)" 
- *       unless="property name (optional)"/>
- * the if and unless attributes are used to control whether this task runs or not. If the 'if' attribute is set, the task will only run if the specified property is defined. If the unless attribute is set, the task will only run if the property is not defined.
-*/
-
-public class MyGetUserAndPassword
-    extends org.apache.tools.ant.Task {
-    
-    private String message = null;
-    private String user_property = null;
-    private String pword_property = null;
-    private String username = null;
-    private String password = null;
-    private boolean cancelled = false;
-
-    private Dimension SIZE = new Dimension(300, 150);
-    private JButton ok_button = null;
-    private JTextField name_field = null;
-    private JPasswordField pass_field = null;
-    
-    private boolean do_the_task = true;
-    public void setMessage(String m) {
-	message = m;
-    }
-
-    /** specify a property name - the task will only execute if this property is set */
-    public void setIf(String property) {
-	String value = getProject().getProperty(property);
-	if (value== null) {
-	    do_the_task = false;
-	}
-    }
-
-    public void setPwordproperty(String p_prop) {
-	pword_property = p_prop;
-    }
-    
-    /** specify a property name - the task will only execute if this property is not set */
-    public void setUnless(String property) {
-	String value = getProject().getProperty(property);
-	if (value != null) {
-	    do_the_task = false;
-	}
-    }
-    
-    public void setUsername(String user) {
-	username = user;
-    }
-
-    public void setUserproperty(String u_prop) {
-	user_property = u_prop;
-    }
-    public void execute() throws org.apache.tools.ant.BuildException {
-	
-	if (!do_the_task) {
-	    return;
-	}
-	if (pword_property == null) {
-	    throw new org.apache.tools.ant.BuildException("pwordproperty attribute must be specified");
-	}
-	
-	JFrame hiddenFrame = new JFrame("Username and Password Hidden Frame");
-	final JDialog dialog = new JDialog(hiddenFrame, "Username and Password", true);
-	JPanel content_pane = (JPanel)dialog.getContentPane();
-	content_pane.setLayout(new BorderLayout(5,5));
-	content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-	dialog.setLocation(200, 300);
-	dialog.setSize(SIZE);
-	dialog.addWindowListener(new WindowAdapter() {
-		public void windowClosing(WindowEvent windowEvent) {
-		    cancelled = true;
-		    dialog.dispose();
-		} 
-	    });
-	
-	JPanel button_pane = new JPanel();
-	button_pane.setLayout(new GridLayout(1,2));
-	JPanel details_pane = new JPanel();
-	details_pane.setLayout(new BorderLayout(5,5));
-	JPanel labels_pane = new JPanel();
-	labels_pane.setLayout(new GridLayout(2,1));
-	JPanel fields_pane = new JPanel();
-	fields_pane.setLayout(new GridLayout(2,1));
-	
-        JTextArea instruction_textarea = new JTextArea();
-	instruction_textarea.setEditable(false);
-	instruction_textarea.setLineWrap(true);
-	instruction_textarea.setRows(2);
-	instruction_textarea.setWrapStyleWord(true);
-	if (message == null) {
-	    message = "Please enter your username and password";
-	}
-	instruction_textarea.setText(message);
-		
-	JLabel name_label = new JLabel("User name:");
-	name_field = new JTextField(16);
-	if (username != null) {
-	    name_field.setText(username);
-	}
-	if (user_property == null ) {
-	    name_field.setEditable(false);
-	} 
-	JLabel pass_label = new JLabel("Password:");
-	pass_field = new JPasswordField(16);
-	
-	FieldListener field_listener = new FieldListener();
-	name_field.addActionListener(field_listener);
-	name_field.getDocument().addDocumentListener(field_listener);
-	pass_field.addActionListener(field_listener);
-	pass_field.getDocument().addDocumentListener(field_listener);
-
-	ok_button = new JButton("Ok");
-	ok_button.setEnabled(false);
-	ok_button.addActionListener(new ActionListener() {
-		public void actionPerformed(ActionEvent actionEvent) {
-		    username = name_field.getText();
-		    password = new String(pass_field.getPassword());
-		    dialog.dispose();
-		}
-	    });
-		
-	JButton cancel_button = new JButton("Cancel");
-	cancel_button.addActionListener(new ActionListener() {
-		public void actionPerformed(ActionEvent actionEvent) {
-		    cancelled = true;
-		    dialog.dispose();
-		}
-	    });
-	
-	button_pane.add(ok_button);
-	button_pane.add(cancel_button);
-		
-	labels_pane.add(name_label);
-	labels_pane.add(pass_label);
-
-	fields_pane.add(name_field);
-	fields_pane.add(pass_field);
-
-	details_pane.add(labels_pane, BorderLayout.WEST);
-	details_pane.add(fields_pane, BorderLayout.CENTER);
-	
-	content_pane.add(instruction_textarea, BorderLayout.NORTH);
-	content_pane.add(details_pane, BorderLayout.CENTER);
-	content_pane.add(button_pane, BorderLayout.SOUTH);
-		
-	dialog.show();
-	hiddenFrame.dispose();
-
-	if (cancelled) {
-	    throw new org.apache.tools.ant.BuildException("Cancelled by user.");
-	}
-	
-	if (user_property != null) {
-	    getProject().setProperty(user_property, username);
-	}
-	getProject().setProperty(pword_property, password);
-	
-	
-	
-    }
-    private class FieldListener
-	implements ActionListener, DocumentListener {
-	
-	public void actionPerformed(ActionEvent actionEvent) {
-	    validateOkButton();
-	}
-	public void changedUpdate(DocumentEvent e) {
-	    
-	    validateOkButton();
-	}
-
-	public void insertUpdate(DocumentEvent e) {
-            
-	    validateOkButton();
-	}
-	
-	public void removeUpdate(DocumentEvent e) {
-            
-	    validateOkButton();
-	}
-	
-	private void validateOkButton() {
-	    if (name_field.getText().length()!=0 && 
-		pass_field.getPassword().length!=0) {		
-		ok_button.setEnabled(true);
-	    } else {
-		ok_button.setEnabled(false);
-	    }
-	}
-    }
-    
-
-    public static void main(String [] args) {
-	MyGetUserAndPassword task = new MyGetUserAndPassword();
-	task.setMessage("hi there kath");
-	task.setUserproperty("username");
-	task.setPwordproperty("password");
-	task.execute();
-
-    }
-}
Index: eenstone3/trunk/src/java/org/greenstone/anttasks/MySetProxy.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/anttasks/MySetProxy.java	(revision 17095)
+++ 	(revision )
@@ -1,70 +1,0 @@
-/*
- *    MyGetUserAndPassword.java
- *    Copyright (C) 2005 New Zealand Digital Library, http://www.nzdl.org
- *
- *    This program is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 2 of the License, or
- *    (at your option) any later version.
- *
- *    This program is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with this program; if not, write to the Free Software
- *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.greenstone.anttasks;
-
-import java.net.Authenticator;
-import java.net.PasswordAuthentication;      
-
-/** A new ant task for as the setproxy task has a bug in it.
- * To use this task, the compiled class must be put in the classpath. add a taskdef line to the build.xml:
- * <taskdef name="mysetproxy" classname="MySetProxy" />
- * and call it like the following:
- *  <mysetproxy proxyhost="" proxyport="" proxyuser="" proxypassword=""/>
-*/
-public class MySetProxy 
-    extends org.apache.tools.ant.Task {
-
-    String host = null;
-    String port = null;
-    String user = null;
-    String password = null;
-
-    public void setProxyhost(String proxy_host) {
-	host = proxy_host;
-    }
-
-    public void setProxyPort(int proxy_port) {
-	port = Integer.toString(proxy_port);
-    }
-
-    public void setProxyuser(String proxy_user) {
-	user = proxy_user;
-    }
-    
-    public void setProxypassword(String proxy_password) {
-	password = proxy_password;
-    }
-
-    public void execute() {
-
-	try {
-	    System.setProperty("http.proxyType", "4");
-	    System.setProperty("http.proxyHost", host);
-	    System.setProperty("http.proxyPort", port);
-	    System.setProperty("http.proxySet", "true");
-	    Authenticator.setDefault(new Authenticator(){ 
-		    protected PasswordAuthentication getPasswordAuthentication(){ 
-			return new PasswordAuthentication(user, new String(password).toCharArray()); 
-		    } 
-		}); 
-	} catch (Exception e) {
-	    System.err.println("MySetProxy Error: couldn't set up the proxy");    
-	}
-    }
-}
Index: /greenstone3/trunk/src/java/org/greenstone/anttasks/README
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/anttasks/README	(revision 17096)
+++ /greenstone3/trunk/src/java/org/greenstone/anttasks/README	(revision 17096)
@@ -0,0 +1,3 @@
+The ant tasks that were in here are useful for more than just Greenstone3, so I
+have moved them to the other-projects directory
+(http://svn.greenstone.org/other-projects/trunk/anttasks).
Index: eenstone3/trunk/src/java/org/greenstone/anttasks/RegexSearchReplace.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/anttasks/RegexSearchReplace.java	(revision 17095)
+++ 	(revision )
@@ -1,117 +1,0 @@
-package org.greenstone.anttasks;
-
-import org.apache.tools.ant.*;
-import org.apache.tools.ant.taskdefs.*;
-import java.util.*;
-import java.io.*;
-import java.util.regex.*;
-
-
-public class RegexSearchReplace extends Task {
-	private File file = null;
-	private String pattern = null;
-	private String replacement = null;
-	
-
-	/**
-	 * for testing
-	 */
-	public static void main( String[] args ) {
-		RegexSearchReplace rsr = new RegexSearchReplace();
-		rsr.setFile(new File (args[0]));
-		rsr.setPattern(args[1]);
-		rsr.setReplacement(args[2]);
-
-		rsr.execute();
-
-	}
-
-	public void execute() {
-
-		if ( file == null ) {
-			throw new BuildException( "Error - No file specified !!" );
-		}
-
-		if ( pattern == null ) {
-			throw new BuildException( "Error - No pattern specified !!" );
-		}
-
-		if (replacement == null) {
-			replacement = "";
-		}
-
-
-		//create the output stream
-		BufferedWriter out = null;
-		File temp = null;
-		try {
-			// Create temp file.
-			temp = File.createTempFile("rsr", ".tmp");
-
-			// Delete temp file when program exits.
-			temp.deleteOnExit();
-
-			// Write to temp file
-			out = new BufferedWriter(new FileWriter(temp));
-
-		} catch (IOException e) {}
-
-
-		//create the input stream
-		BufferedReader in = null;
-		try {
-			in = new BufferedReader(new FileReader( file ));
-		} catch ( Exception e ) {}
-
-		//pass the file through, searching and replacing
-		String line;
-		try {
-			while ( (line = in.readLine()) != null ) {
-				line = line.replaceAll( pattern, replacement);
-				out.write(line);
-				out.newLine();
-			}
-			//close them both up
-			in.close();
-			out.close();
-
-		} catch ( Exception e ) {
-			e.printStackTrace();
-		}
-
-
-
-		//copy the new file (temp) over the original
-		try {
-			InputStream i = new FileInputStream(temp);
-			OutputStream o = new FileOutputStream(file);
-
-			// Transfer bytes from in to out
-			byte[] buf = new byte[1024];
-			int len;
-			while ((len = i.read(buf)) > 0) {
-			   o.write(buf, 0, len);
-			}
-
-			//close them up
-			i.close();
-			o.close();
-		} catch ( Exception e ) {}
-		
-	}
-
-   
-	public void setFile(File file) {
-			this.file = file;
-	}
-
-	public void setPattern(String pattern) {
-			this.pattern = pattern;
-	}
-
-	public void setReplacement(String replacement) {
-			this.replacement = replacement;
-	}
-
-
-}
