From 094dab9e8e35fd61da0fb579f4c4b524f834d120 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Thu, 21 Feb 2002 09:42:14 +0000 Subject: [PATCH] Remove some unreferenced files git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271488 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/DemuxOutputStream.java | 126 ------------------ .../main/org/apache/tools/ant/Project.java | 79 ----------- .../apache/tools/ant/DemuxOutputStream.java | 126 ------------------ .../todo/org/apache/tools/ant/Project.java | 79 ----------- 4 files changed, 410 deletions(-) delete mode 100644 proposal/myrmidon/src/main/org/apache/tools/ant/DemuxOutputStream.java delete mode 100644 proposal/myrmidon/src/main/org/apache/tools/ant/Project.java delete mode 100644 proposal/myrmidon/src/todo/org/apache/tools/ant/DemuxOutputStream.java delete mode 100644 proposal/myrmidon/src/todo/org/apache/tools/ant/Project.java diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/DemuxOutputStream.java b/proposal/myrmidon/src/main/org/apache/tools/ant/DemuxOutputStream.java deleted file mode 100644 index 3c9e68be2..000000000 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/DemuxOutputStream.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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.txt file. - */ -package org.apache.tools.ant; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Hashtable; - -/** - * Logs content written by a thread and forwards the buffers onto the project - * object which will forward the content to the appropriate task - * - * @author Conor MacNeill - */ -public class DemuxOutputStream extends OutputStream -{ - - private final static int MAX_SIZE = 1024; - - private Hashtable buffers = new Hashtable(); - // private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - private boolean skip = false; - private boolean isErrorStream; - private Project project; - - /** - * Creates a new instance of this class. - * - * @param project Description of Parameter - * @param isErrorStream Description of Parameter - */ - public DemuxOutputStream( Project project, boolean isErrorStream ) - { - this.project = project; - this.isErrorStream = isErrorStream; - } - - /** - * Writes all remaining - * - * @exception IOException Description of Exception - */ - public void close() - throws IOException - { - flush(); - } - - /** - * Writes all remaining - * - * @exception IOException Description of Exception - */ - public void flush() - throws IOException - { - if( getBuffer().size() > 0 ) - { - processBuffer(); - } - } - - /** - * Write the data to the buffer and flush the buffer, if a line separator is - * detected. - * - * @param cc data to log (byte). - * @exception IOException Description of Exception - */ - public void write( int cc ) - throws IOException - { - final byte c = (byte)cc; - if( ( c == '\n' ) || ( c == '\r' ) ) - { - if( !skip ) - { - processBuffer(); - } - } - else - { - ByteArrayOutputStream buffer = getBuffer(); - buffer.write( cc ); - if( buffer.size() > MAX_SIZE ) - { - processBuffer(); - } - } - skip = ( c == '\r' ); - } - - /** - * Converts the buffer to a string and sends it to processLine - */ - protected void processBuffer() - { - String output = getBuffer().toString(); - project.demuxOutput( output, isErrorStream ); - resetBuffer(); - } - - private ByteArrayOutputStream getBuffer() - { - Thread current = Thread.currentThread(); - ByteArrayOutputStream buffer = (ByteArrayOutputStream)buffers.get( current ); - if( buffer == null ) - { - buffer = new ByteArrayOutputStream(); - buffers.put( current, buffer ); - } - return buffer; - } - - private void resetBuffer() - { - Thread current = Thread.currentThread(); - buffers.remove( current ); - } -} diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/Project.java b/proposal/myrmidon/src/main/org/apache/tools/ant/Project.java deleted file mode 100644 index bf7e06664..000000000 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/Project.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.txt file. - */ -package org.apache.tools.ant; - -import java.util.Enumeration; -import java.util.Hashtable; -import org.apache.tools.ant.types.FilterSet; - -/** - * Central representation of an Ant project. This class defines a Ant project - * with all of it's targets and tasks. It also provides the mechanism to kick - * off a build using a particular target name.

- * - * This class also encapsulates methods which allow Files to be refered to using - * abstract path names which are translated to native system file paths at - * runtime as well as defining various project properties. - * - * @author duncan@x180.com - */ -public class Project -{ - private Hashtable properties = new Hashtable(); - private FilterSet globalFilterSet = new FilterSet(); - - /** - * Records the latest task on a thread - */ - private Hashtable threadTasks = new Hashtable(); - - public FilterSet getGlobalFilterSet() - { - return globalFilterSet; - } - - /** - * get a copy of the property hashtable - * - * @return the hashtable containing all properties, user included - */ - public Hashtable getProperties() - { - Hashtable propertiesCopy = new Hashtable(); - - Enumeration e = properties.keys(); - while( e.hasMoreElements() ) - { - Object name = e.nextElement(); - Object value = properties.get( name ); - propertiesCopy.put( name, value ); - } - - return propertiesCopy; - } - - public void demuxOutput( String line, boolean isError ) - { - Task task = (Task)threadTasks.get( Thread.currentThread() ); - if( task == null ) - { - //fireMessageLogged( this, line, isError ? MSG_ERR : MSG_INFO ); - } - else - { - if( isError ) - { - task.handleErrorOutput( line ); - } - else - { - task.handleOutput( line ); - } - } - } -} diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/DemuxOutputStream.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/DemuxOutputStream.java deleted file mode 100644 index 3c9e68be2..000000000 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/DemuxOutputStream.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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.txt file. - */ -package org.apache.tools.ant; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Hashtable; - -/** - * Logs content written by a thread and forwards the buffers onto the project - * object which will forward the content to the appropriate task - * - * @author Conor MacNeill - */ -public class DemuxOutputStream extends OutputStream -{ - - private final static int MAX_SIZE = 1024; - - private Hashtable buffers = new Hashtable(); - // private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - private boolean skip = false; - private boolean isErrorStream; - private Project project; - - /** - * Creates a new instance of this class. - * - * @param project Description of Parameter - * @param isErrorStream Description of Parameter - */ - public DemuxOutputStream( Project project, boolean isErrorStream ) - { - this.project = project; - this.isErrorStream = isErrorStream; - } - - /** - * Writes all remaining - * - * @exception IOException Description of Exception - */ - public void close() - throws IOException - { - flush(); - } - - /** - * Writes all remaining - * - * @exception IOException Description of Exception - */ - public void flush() - throws IOException - { - if( getBuffer().size() > 0 ) - { - processBuffer(); - } - } - - /** - * Write the data to the buffer and flush the buffer, if a line separator is - * detected. - * - * @param cc data to log (byte). - * @exception IOException Description of Exception - */ - public void write( int cc ) - throws IOException - { - final byte c = (byte)cc; - if( ( c == '\n' ) || ( c == '\r' ) ) - { - if( !skip ) - { - processBuffer(); - } - } - else - { - ByteArrayOutputStream buffer = getBuffer(); - buffer.write( cc ); - if( buffer.size() > MAX_SIZE ) - { - processBuffer(); - } - } - skip = ( c == '\r' ); - } - - /** - * Converts the buffer to a string and sends it to processLine - */ - protected void processBuffer() - { - String output = getBuffer().toString(); - project.demuxOutput( output, isErrorStream ); - resetBuffer(); - } - - private ByteArrayOutputStream getBuffer() - { - Thread current = Thread.currentThread(); - ByteArrayOutputStream buffer = (ByteArrayOutputStream)buffers.get( current ); - if( buffer == null ) - { - buffer = new ByteArrayOutputStream(); - buffers.put( current, buffer ); - } - return buffer; - } - - private void resetBuffer() - { - Thread current = Thread.currentThread(); - buffers.remove( current ); - } -} diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/Project.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/Project.java deleted file mode 100644 index bf7e06664..000000000 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/Project.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.txt file. - */ -package org.apache.tools.ant; - -import java.util.Enumeration; -import java.util.Hashtable; -import org.apache.tools.ant.types.FilterSet; - -/** - * Central representation of an Ant project. This class defines a Ant project - * with all of it's targets and tasks. It also provides the mechanism to kick - * off a build using a particular target name.

- * - * This class also encapsulates methods which allow Files to be refered to using - * abstract path names which are translated to native system file paths at - * runtime as well as defining various project properties. - * - * @author duncan@x180.com - */ -public class Project -{ - private Hashtable properties = new Hashtable(); - private FilterSet globalFilterSet = new FilterSet(); - - /** - * Records the latest task on a thread - */ - private Hashtable threadTasks = new Hashtable(); - - public FilterSet getGlobalFilterSet() - { - return globalFilterSet; - } - - /** - * get a copy of the property hashtable - * - * @return the hashtable containing all properties, user included - */ - public Hashtable getProperties() - { - Hashtable propertiesCopy = new Hashtable(); - - Enumeration e = properties.keys(); - while( e.hasMoreElements() ) - { - Object name = e.nextElement(); - Object value = properties.get( name ); - propertiesCopy.put( name, value ); - } - - return propertiesCopy; - } - - public void demuxOutput( String line, boolean isError ) - { - Task task = (Task)threadTasks.get( Thread.currentThread() ); - if( task == null ) - { - //fireMessageLogged( this, line, isError ? MSG_ERR : MSG_INFO ); - } - else - { - if( isError ) - { - task.handleErrorOutput( line ); - } - else - { - task.handleOutput( line ); - } - } - } -}