conor 02/04/15 05:11:52
Modified: src/main/org/apache/tools/ant/helper ProjectHelperImpl.java
src/main/org/apache/tools/ant/taskdefs BuildNumber.java
Concat.java LoadProperties.java Manifest.java
Parallel.java Patch.java PathConvert.java
src/main/org/apache/tools/ant/taskdefs/cvslib
ChangeLogParser.java CvsTagDiff.java
src/main/org/apache/tools/ant/taskdefs/optional
TraXLiaison.java XMLValidateTask.java
src/main/org/apache/tools/ant/taskdefs/optional/jlink
JlinkTask.java jlink.java
src/main/org/apache/tools/ant/taskdefs/optional/jsp
JspC.java WLJspc.java
src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
DefaultJspCompilerAdapter.java JasperC.java
JspCompilerAdapter.java
JspCompilerAdapterFactory.java
src/main/org/apache/tools/ant/taskdefs/optional/junit
AggregateTransformer.java BatchTest.java
DOMUtil.java Enumerations.java
FormatterElement.java JUnitResultFormatter.java
JUnitTask.java JUnitTest.java JUnitTestRunner.java
PlainJUnitResultFormatter.java
SummaryJUnitResultFormatter.java
XMLJUnitResultFormatter.java
XMLResultAggregator.java Xalan1Executor.java
src/main/org/apache/tools/ant/taskdefs/optional/metamata
MParse.java
src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java
MimeMail.java TelnetTask.java
src/main/org/apache/tools/ant/taskdefs/optional/perforce
P4Submit.java
src/main/org/apache/tools/ant/taskdefs/optional/pvcs
Pvcs.java
src/main/org/apache/tools/ant/taskdefs/optional/scm
AntStarTeamCheckOut.java
src/main/org/apache/tools/ant/taskdefs/optional/sound
AntSoundPlayer.java SoundTask.java
src/main/org/apache/tools/ant/taskdefs/optional/splash
SplashScreen.java SplashTask.java
src/main/org/apache/tools/ant/taskdefs/optional/starteam
StarTeamTask.java
src/main/org/apache/tools/ant/taskdefs/optional/vss
MSVSS.java MSVSSADD.java MSVSSCHECKIN.java
MSVSSCHECKOUT.java MSVSSCP.java MSVSSCREATE.java
MSVSSGET.java MSVSSHISTORY.java MSVSSLABEL.java
src/main/org/apache/tools/ant/taskdefs/rmic
DefaultRmicAdapter.java KaffeRmic.java
RmicAdapter.java RmicAdapterFactory.java
SunRmic.java WLRmic.java
src/main/org/apache/tools/ant/types AbstractFileSet.java
Commandline.java CommandlineJava.java DataType.java
Environment.java FileList.java FilterSet.java
FilterSetCollection.java Mapper.java Path.java
PatternSet.java Reference.java
RegularExpression.java XMLCatalog.java
ZipFileSet.java
src/main/org/apache/tools/ant/types/optional/depend
ClassfileSet.java DependScanner.java
src/main/org/apache/tools/ant/util DOMElementWriter.java
DateUtils.java FileUtils.java
GlobPatternMapper.java LoaderUtils.java
RegexpPatternMapper.java SourceFileScanner.java
StringUtils.java
src/main/org/apache/tools/ant/util/depend/bcel
AncestorAnalyzer.java FullAnalyzer.java
src/main/org/apache/tools/ant/util/regexp
JakartaOroMatcher.java JakartaOroRegexp.java
JakartaRegexpMatcher.java JakartaRegexpRegexp.java
Jdk14RegexpMatcher.java Jdk14RegexpRegexp.java
src/main/org/apache/tools/bzip2 CBZip2InputStream.java
CBZip2OutputStream.java CRC.java
src/main/org/apache/tools/tar TarEntry.java
src/main/org/apache/tools/zip AsiExtraField.java
ExtraFieldUtils.java UnrecognizedExtraField.java
ZipEntry.java ZipLong.java ZipOutputStream.java
ZipShort.java
Log:
More coding standard fixes
Revision Changes Path
1.4 +12 -8
jakarta-ant/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
Index: ProjectHelperImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- ProjectHelperImpl.java 9 Apr 2002 14:43:30 -0000 1.3
+++ ProjectHelperImpl.java 15 Apr 2002 12:11:47 -0000 1.4
@@ -876,9 +876,11 @@
public void startElement(String name, AttributeList attrs) throws
SAXParseException {
if (task instanceof TaskContainer) {
// task can contain other tasks - no other nested elements
possible
- new TaskHandler(helperImpl, this, (TaskContainer)task,
wrapper, target).init(name, attrs);
+ new TaskHandler(helperImpl, this, (TaskContainer) task,
+ wrapper, target).init(name, attrs);
} else {
- new NestedElementHandler(helperImpl, this, task, wrapper,
target).init(name, attrs);
+ new NestedElementHandler(helperImpl, this, task,
+ wrapper, target).init(name, attrs);
}
}
}
@@ -1027,9 +1029,11 @@
if (child instanceof TaskContainer) {
// taskcontainer nested element can contain other tasks - no
other
// nested elements possible
- new TaskHandler(helperImpl, this, (TaskContainer)child,
childWrapper, target).init(name, attrs);
+ new TaskHandler(helperImpl, this, (TaskContainer) child,
+ childWrapper, target).init(name, attrs);
} else {
- new NestedElementHandler(helperImpl, this, child,
childWrapper, target).init(name, attrs);
+ new NestedElementHandler(helperImpl, this, child,
+ childWrapper, target).init(name, attrs);
}
}
}
1.6 +74 -97
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java
Index: BuildNumber.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- BuildNumber.java 10 Apr 2002 13:55:48 -0000 1.5
+++ BuildNumber.java 15 Apr 2002 12:11:47 -0000 1.6
@@ -63,56 +63,51 @@
import org.apache.tools.ant.util.FileUtils;
/**
- * This is a basic task that can be used to track build numbers.
- *
- * It will first attempt to read a build number from a file, then
- * set the property "build.number" to the value that was read in
- * (or 0 if no such value). Then it will increment the build number
- * by one and write it back out into the file.
+ * This is a basic task that can be used to track build numbers. It will
first
+ * attempt to read a build number from a file, then set the property
+ * "build.number" to the value that was read in (or 0 if no such value). Then
+ * it will increment the build number by one and write it back out into the
+ * file.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.5 $ $Date: 2002/04/10 13:55:48 $
+ * @version $Revision: 1.6 $ $Date: 2002/04/15 12:11:47 $
* @since Ant 1.5
* @ant.task name="buildnumber"
*/
public class BuildNumber
- extends Task
-{
+ extends Task {
/**
* The name of the property in which the build number is stored.
*/
private static final String DEFAULT_PROPERTY_NAME = "build.number";
- /**
- * The default filename to use if no file specified.
- */
+ /** The default filename to use if no file specified. */
private static final String DEFAULT_FILENAME = DEFAULT_PROPERTY_NAME;
- /**
- * The File in which the build number is stored.
- */
+ /** The File in which the build number is stored. */
private File m_file;
+
/**
- * Specify the file in which the build numberis stored.
- * Defaults to "build.number" if not specified.
+ * Specify the file in which the build numberis stored. Defaults to
+ * "build.number" if not specified.
*
* @param file the file in which build number is stored.
*/
- public void setFile( final File file )
- {
+ public void setFile(final File file) {
m_file = file;
}
+
/**
* Run task.
*
* @exception BuildException if an error occurs
*/
public void execute()
- throws BuildException
- {
+ throws BuildException {
File savedFile = m_file; // may be altered in validate
+
validate();
final Properties properties = loadProperties();
@@ -123,28 +118,22 @@
// Write the properties file back out
FileOutputStream output = null;
- try
- {
+
+ try {
output = new FileOutputStream( m_file );
final String header = "Build Number for ANT. Do not edit!";
+
properties.save( output, header );
- }
- catch( final IOException ioe )
- {
+ } catch (final IOException ioe) {
final String message = "Error while writing " + m_file;
+
throw new BuildException( message, ioe );
- }
- finally
- {
- if( null != output )
- {
- try
- {
+ } finally {
+ if (null != output) {
+ try {
output.close();
- }
- catch( final IOException ioe )
- {
+ } catch (final IOException ioe) {
}
}
m_file = savedFile;
@@ -155,6 +144,7 @@
String.valueOf( buildNumber ) );
}
+
/**
* Utility method to retrieve build number from properties object.
*
@@ -163,24 +153,22 @@
* @throws BuildException if build.number property is not an integer
*/
private int getBuildNumber( final Properties properties )
- throws BuildException
- {
+ throws BuildException {
final String buildNumber =
properties.getProperty( DEFAULT_PROPERTY_NAME, "0" ).trim();
// Try parsing the line into an integer.
- try
- {
+ try {
return Integer.parseInt( buildNumber );
- }
- catch( final NumberFormatException nfe )
- {
+ } catch (final NumberFormatException nfe) {
final String message =
m_file + " contains a non integer build number: " +
buildNumber;
+
throw new BuildException( message , nfe );
}
}
+
/**
* Utility method to load properties from file.
*
@@ -188,72 +176,61 @@
* @throws BuildException
*/
private Properties loadProperties()
- throws BuildException
- {
+ throws BuildException {
FileInputStream input = null;
- try
- {
+
+ try {
final Properties properties = new Properties();
+
input = new FileInputStream( m_file );
properties.load( input );
return properties;
- }
- catch( final IOException ioe )
- {
+ } catch (final IOException ioe) {
throw new BuildException( ioe );
- }
- finally
- {
- if( null != input )
- {
- try
- {
+ } finally {
+ if (null != input) {
+ try {
input.close();
- }
- catch( final IOException ioe )
- {
+ } catch (final IOException ioe) {
}
}
}
}
+
/**
* Validate that the task parameters are valid.
*
* @throws BuildException if parameters are invalid
*/
private void validate()
- throws BuildException
- {
- if( null == m_file )
- {
+ throws BuildException {
+ if (null == m_file) {
m_file = getProject().resolveFile( DEFAULT_FILENAME );
}
- if( !m_file.exists() )
- {
- try
- {
+ if (!m_file.exists()) {
+ try {
FileUtils.newFileUtils().createNewFile(m_file);
- }
- catch( final IOException ioe )
- {
+ } catch (final IOException ioe) {
final String message =
m_file + " doesn't exist and new file can't be created.";
+
throw new BuildException( message, ioe );
}
}
- if( !m_file.canRead() )
- {
+ if (!m_file.canRead()) {
final String message = "Unable to read from " + m_file + ".";
+
throw new BuildException( message );
}
- if( !m_file.canWrite() )
- {
+ if (!m_file.canWrite()) {
final String message = "Unable to write to " + m_file + ".";
+
throw new BuildException( message );
}
}
}
+
1.4 +6 -14
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Concat.java
Index: Concat.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- Concat.java 11 Apr 2002 06:32:43 -0000 1.3
+++ Concat.java 15 Apr 2002 12:11:47 -0000 1.4
@@ -392,17 +392,14 @@
// Log using WARN so it displays in 'quiet' mode.
out = new PrintWriter(
new OutputStreamWriter(
- new LogOutputStream(this, Project.MSG_WARN)
- )
- );
+ new LogOutputStream(this,
Project.MSG_WARN)));
} else {
out = new PrintWriter(
new OutputStreamWriter(
new FileOutputStream(destinationFile
.getAbsolutePath(),
append),
- encoding)
- );
+ encoding));
// This flag should only be recognized for the first
// file. In the context of a single 'cat', we always
@@ -412,11 +409,8 @@
for (int i = 0; i < len; i++) {
in = new BufferedReader(
- new InputStreamReader(
- new FileInputStream(input[i]),
- encoding
- )
- );
+ new InputStreamReader(new
FileInputStream(input[i]),
+ encoding));
String line;
while ((line = in.readLine()) != null) {
@@ -480,9 +474,7 @@
// Reads the text, line by line.
BufferedReader reader = null;
try {
- reader = new BufferedReader(
- new StringReader(text)
- );
+ reader = new BufferedReader(new StringReader(text));
String line;
while ((line = reader.readLine()) != null) {
1.6 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java
Index: LoadProperties.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
1.31 +21 -21
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Manifest.java
Index: Manifest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Manifest.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -w -u -r1.30 -r1.31
1.9 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java
Index: Parallel.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
1.14 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Patch.java
Index: Patch.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Patch.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
1.17 +147 -139
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
Index: PathConvert.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -u -r1.16 -r1.17
--- PathConvert.java 12 Apr 2002 13:26:50 -0000 1.16
+++ PathConvert.java 15 Apr 2002 12:11:47 -0000 1.17
@@ -51,7 +51,6 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
-
package org.apache.tools.ant.taskdefs;
import org.apache.tools.ant.BuildException;
@@ -70,46 +69,59 @@
import java.io.File;
/**
- * This task converts path and classpath information to a specific
- * target OS format. The resulting formatted path is placed into a
- * specified property.
- *
- * @author Larry Streepy <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
+ * This task converts path and classpath information to a specific target OS
+ * format. The resulting formatted path is placed into a specified property.
*
+ * @author Larry Streepy <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
* @since Ant 1.4
- *
* @ant.task category="utility"
*/
public class PathConvert extends Task {
+ // Members
+ private Path path = null;// Path to be converted
+ private Reference refid = null;// Reference to path/fileset to
+ // convert
+ private String targetOS = null;// The target OS type
+ private boolean targetWindows = false;// Set when targetOS is set
+ private boolean onWindows = false;// Set if we're running on windows
+ private String property = null;// The property to receive the
+ //results
+ private Vector prefixMap = new Vector();// Path prefix map
+ private String pathSep = null;// User override on path sep char
+ private String dirSep = null;// User override on directory sep
+ // char
+
public PathConvert() {
onWindows = Os.isFamily("dos");
}
+
/**
- * Helper class, holds the nested <map> values. Elements will
- * look like this: <map from="d:" to="/foo"/>
- * <p>
- * When running on windows, the prefix comparison will be case
insensitive.
+ * Helper class, holds the nested <map> values. Elements will look like
+ * this: <map from="d:" to="/foo"/> <p>
+ *
+ * When running on windows, the prefix comparison will be case
+ * insensitive.
*/
public class MapEntry {
- /**
- * Set the "from" attribute of the map entry
- */
+ /** Set the "from" attribute of the map entry */
public void setFrom( String from ) {
this.from = from;
}
- /**
- * Set the "to" attribute of the map entry
- */
+
+ /** Set the "to" attribute of the map entry */
public void setTo( String to ) {
this.to = to;
}
+
/**
* Apply this map entry to a given path element
+ *
* @param elem Path element to process
* @return String Updated path element after mapping
*/
@@ -144,15 +156,15 @@
private String to = null;
}
+
public static class TargetOs extends EnumeratedAttribute {
public String[] getValues() {
return new String[] {"windows", "unix", "netware", "os/2"};
}
}
- /**
- * Create a nested PATH element
- */
+
+ /** Create a nested PATH element */
public Path createPath() {
if( isReference() ) {
@@ -165,12 +177,12 @@
return path.createPath();
}
- /**
- * Create a nested MAP element
- */
+
+ /** Create a nested MAP element */
public MapEntry createMap() {
MapEntry entry = new MapEntry();
+
prefixMap.addElement( entry );
return entry;
}
@@ -178,17 +190,21 @@
/**
* Set the value of the targetos attribute
+ *
* @deprecated use the method taking a TargetOs argument instead
* @see #setTargetos(TargetOs)
*/
public void setTargetos( String target ) {
TargetOs to = new TargetOs();
+
to.setValue(target);
setTargetos(to);
}
+
/**
* Set the value of the targetos attribute
+ *
* @since Ant 1.5
*/
public void setTargetos( TargetOs target ) {
@@ -205,14 +221,16 @@
targetWindows = !targetOS.equals("unix");
}
+
/**
- * Set the value of the property attribute - this is the property
- * into which our converted path will be placed.
+ * Set the value of the property attribute - this is the property into
+ * which our converted path will be placed.
*/
public void setProperty( String p ) {
property = p;
}
+
/**
* Adds a reference to a Path, FileSet, DirSet, or FileList defined
* elsewhere.
@@ -225,13 +243,13 @@
refid = r;
}
- /**
- * Override the default path separator string for the target os
- */
+
+ /** Override the default path separator string for the target os */
public void setPathSep( String sep ) {
pathSep = sep;
}
+
/**
* Override the default directory separator string for the target os
*/
@@ -239,16 +257,14 @@
dirSep = sep;
}
- /**
- * Has the refid attribute of this element been set?
- */
+
+ /** Has the refid attribute of this element been set? */
public boolean isReference() {
return refid != null;
}
- /**
- * Do the execution.
- */
+
+ /** Do the execution. */
public void execute() throws BuildException {
Path savedPath = path;
String savedPathSep = pathSep; // may be altered in validateSetup
@@ -265,12 +281,15 @@
path.setRefid(refid);
} else if( obj instanceof FileSet ) {
FileSet fs = (FileSet)obj;
+
path.addFileset( fs );
} else if( obj instanceof DirSet ) {
DirSet ds = (DirSet)obj;
+
path.addDirset( ds );
} else if( obj instanceof FileList ) {
FileList fl = (FileList)obj;
+
path.addFilelist( fl );
} else {
@@ -302,7 +321,6 @@
elem = mapElement( elem ); // Apply the path prefix map
-
// Now convert the path and file separator characters from
the
// current os to the target os.
@@ -319,8 +337,7 @@
if (fromDirSep.equals(token)) {
rslt.append( dirSep );
- }
- else {
+ } else {
rslt.append( token );
}
}
@@ -340,6 +357,7 @@
}
}
+
/**
* Apply the configured map to a path element. The map is used to
convert
* between Windows drive letters and Unix paths. If no map is
configured,
@@ -374,8 +392,10 @@
return elem;
}
+
/**
* Validate that all our parameters have been properly initialized.
+ *
* @throws BuildException if something is not setup properly
*/
private void validateSetup() throws BuildException {
@@ -417,27 +437,15 @@
dirSep = dsep;
}
+
/**
- * Creates an exception that indicates that this XML element must
- * not have child elements if the refid attribute is set.
+ * Creates an exception that indicates that this XML element must not
have
+ * child elements if the refid attribute is set.
*/
private BuildException noChildrenAllowed() {
return new BuildException("You must not specify nested <path> "
+ "elements when using the refid
attribute.");
}
- // Members
- private Path path = null; // Path to be converted
- private Reference refid = null; // Reference to path/fileset to
- // convert
- private String targetOS = null; // The target OS type
- private boolean targetWindows = false; // Set when targetOS is set
- private boolean onWindows = false; // Set if we're running on
windows
- private String property = null; // The property to receive the
- //results
- private Vector prefixMap = new Vector(); // Path prefix map
- private String pathSep = null; // User override on path sep
char
- private String dirSep = null; // User override on directory
sep
- // char
-
}
+
1.10 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
Index: ChangeLogParser.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- ChangeLogParser.java 15 Apr 2002 09:07:21 -0000 1.9
+++ ChangeLogParser.java 15 Apr 2002 12:11:47 -0000 1.10
@@ -64,7 +64,7 @@
* A class used to parse the output of the CVS log command.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.9 $ $Date: 2002/04/15 09:07:21 $
+ * @version $Revision: 1.10 $ $Date: 2002/04/15 12:11:47 $
*/
class ChangeLogParser {
//private static final int GET_ENTRY = 0;
1.3 +6 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
Index: CvsTagDiff.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- CvsTagDiff.java 15 Apr 2002 10:47:48 -0000 1.2
+++ CvsTagDiff.java 15 Apr 2002 12:11:47 -0000 1.3
@@ -100,7 +100,7 @@
* </PRE>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Frederic Lavigne</a>
- * @version $Revision: 1.2 $ $Date: 2002/04/15 10:47:48 $
+ * @version $Revision: 1.3 $ $Date: 2002/04/15 12:11:47 $
* @since Ant 1.5
* @ant.task name="cvstagdiff"
*/
@@ -291,9 +291,9 @@
// build the rdiff command
String rdiff = "rdiff -s " +
(m_startTag!=null?("-r " + m_startTag):("-D " + m_startDate))
- + " " +
- (m_endTag!=null?("-r " + m_endTag):("-D " + m_endDate)) + " " +
- m_package;
+ + " "
+ + (m_endTag != null ? ("-r " + m_endTag) : ("-D " + m_endDate))
+ + " " + m_package;
log("Cvs command is " + rdiff, Project.MSG_VERBOSE);
m_cvs.setCommand(rdiff);
1.17 +13 -13
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
Index: TraXLiaison.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -u -r1.16 -r1.17
1.13 +36 -30
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
Index: XMLValidateTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -u -r1.12 -r1.13
--- XMLValidateTask.java 8 Apr 2002 15:40:33 -0000 1.12
+++ XMLValidateTask.java 15 Apr 2002 12:11:48 -0000 1.13
@@ -95,7 +95,8 @@
* validation.
*/
// The crimson implementation is shipped with ant.
- public static String DEFAULT_XML_READER_CLASSNAME=
"org.apache.crimson.parser.XMLReaderImpl";
+ public static String DEFAULT_XML_READER_CLASSNAME
+ = "org.apache.crimson.parser.XMLReaderImpl";
protected static String INIT_FAILED_MSG = "Could not start xml
validation: ";
@@ -313,8 +314,7 @@
xmlReader = new ParserAdapter(parser);
log("Using SAX1 parser " + readerClassName,
Project.MSG_VERBOSE);
} else {
- throw new BuildException(INIT_FAILED_MSG
- + readerClassName
+ throw new BuildException(INIT_FAILED_MSG +
readerClassName
+ " implements nor SAX1 Parser
nor SAX2 XMLReader.");
}
}
@@ -386,16 +386,19 @@
String uri = "file:" + afile.getAbsolutePath().replace('\\',
'/');
for (int index = uri.indexOf('#'); index != -1;
index = uri.indexOf('#')) {
- uri = uri.substring(0, index) + "%23" +
uri.substring(index+1);
+ uri = uri.substring(0, index) + "%23"
+ + uri.substring(index + 1);
}
is.setSystemId(uri);
xmlReader.parse(is);
} catch (SAXException ex) {
if (failOnError) {
- throw new BuildException("Could not validate document " +
afile);
+ throw new BuildException("Could not validate document "
+ + afile);
}
} catch (IOException ex) {
- throw new BuildException("Could not validate document " + afile,
ex);
+ throw new BuildException("Could not validate document " + afile,
+ ex);
}
if (errorHandler.getFailure()) {
@@ -493,7 +496,8 @@
if (fileDTD.exists()) {
if (publicId != null) {
fileDTDs.put(publicId, fileDTD);
- log("Mapped publicId " + publicId + " to file " +
fileDTD, Project.MSG_VERBOSE);
+ log("Mapped publicId " + publicId + " to file " +
fileDTD,
+ Project.MSG_VERBOSE);
}
return;
}
@@ -501,7 +505,8 @@
if (LocalResolver.this.getClass().getResource(location) != null)
{
if (publicId != null) {
resourceDTDs.put(publicId, location);
- log("Mapped publicId " + publicId + " to resource " +
location, Project.MSG_VERBOSE);
+ log("Mapped publicId " + publicId + " to resource "
+ + location, Project.MSG_VERBOSE);
}
}
@@ -510,7 +515,7 @@
URL urldtd = new URL(location);
urlDTDs.put(publicId, urldtd);
}
- } catch ( java.net.MalformedURLException e) {
+ } catch (MalformedURLException e) {
//ignored
}
}
@@ -532,7 +537,8 @@
if (dtdResourceName != null) {
InputStream is =
this.getClass().getResourceAsStream(dtdResourceName);
if (is != null) {
- log("Resolved " + publicId + " to local resource " +
dtdResourceName, Project.MSG_VERBOSE);
+ log("Resolved " + publicId + " to local resource "
+ + dtdResourceName, Project.MSG_VERBOSE);
return new InputSource(is);
}
}
1.7 +5 -5
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java
Index: JlinkTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
1.6 +203 -179
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java
Index: jlink.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- jlink.java 28 Oct 2001 21:30:21 -0000 1.5
+++ jlink.java 15 Apr 2002 12:11:48 -0000 1.6
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000,2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,16 +51,13 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
-
/**
- * jlink.java
- * links together multiple .jar files
- *
- * Original code by Patrick Beard. Modifications to work
- * with ANT by Matthew Kuperus Heun.
+ * jlink.java links together multiple .jar files Original code by Patrick
+ * Beard. Modifications to work with ANT by Matthew Kuperus Heun.
*
* @author <a href="mailto:[EMAIL PROTECTED]>Patrick C. Beard</a>.
- * @author <a href="mailto:[EMAIL PROTECTED]>Matthew Kuperus Heun</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]>Matthew Kuperus Heun
+ * </a>
*/
package org.apache.tools.ant.taskdefs.optional.jlink;
@@ -81,9 +78,7 @@
public class jlink extends Object{
- /**
- * The file that will be created by this instance of jlink.
- */
+ /** The file that will be created by this instance of jlink. */
public void setOutfile( String outfile ) {
if ( outfile == null ) {
return ;
@@ -91,9 +86,8 @@
this .outfile = outfile;
}
- /**
- * Adds a file to be merged into the output.
- */
+
+ /** Adds a file to be merged into the output. */
public void addMergeFile( String mergefile ) {
if ( mergefile == null ) {
return ;
@@ -101,9 +95,8 @@
mergefiles .addElement( mergefile );
}
- /**
- * Adds a file to be added into the output.
- */
+
+ /** Adds a file to be added into the output. */
public void addAddFile( String addfile ) {
if ( addfile == null ) {
return ;
@@ -111,9 +104,8 @@
addfiles .addElement( addfile );
}
- /**
- * Adds several files to be merged into the output.
- */
+
+ /** Adds several files to be merged into the output. */
public void addMergeFiles( String[] mergefiles ) {
if ( mergefiles == null ) {
return ;
@@ -123,9 +115,8 @@
}
}
- /**
- * Adds several file to be added into the output.
- */
+
+ /** Adds several file to be added into the output. */
public void addAddFiles( String[] addfiles ) {
if ( addfiles == null ) {
return ;
@@ -135,68 +126,71 @@
}
}
- /**
- * Determines whether output will be compressed.
- */
+
+ /** Determines whether output will be compressed. */
public void setCompression( boolean compress ) {
this .compression = compress;
}
+
/**
- * Performs the linking of files.
- * Addfiles are added to the output as-is. For example, a
- * jar file is added to the output as a jar file.
- * However, mergefiles are first examined for their type.
- * If it is a jar or zip file, the contents will be extracted
- * from the mergefile and entered into the output.
- * If a zip or jar file is encountered in a subdirectory
- * it will be added, not merged.
- * If a directory is encountered, it becomes the root
- * entry of all the files below it. Thus, you can
- * provide multiple, disjoint directories, as
- * addfiles: they will all be added in a rational
- * manner to outfile.
+ * Performs the linking of files. Addfiles are added to the output as-is.
+ * For example, a jar file is added to the output as a jar file. However,
+ * mergefiles are first examined for their type. If it is a jar or zip
+ * file, the contents will be extracted from the mergefile and entered
+ * into the output. If a zip or jar file is encountered in a subdirectory
+ * it will be added, not merged. If a directory is encountered, it
becomes
+ * the root entry of all the files below it. Thus, you can provide
+ * multiple, disjoint directories, as addfiles: they will all be added in
+ * a rational manner to outfile.
*/
public void link() throws Exception {
ZipOutputStream output = new ZipOutputStream( new FileOutputStream(
outfile ) );
+
if ( compression ) {
output .setMethod( ZipOutputStream .DEFLATED );
output .setLevel( Deflater .DEFAULT_COMPRESSION );
} else {
output .setMethod( ZipOutputStream .STORED );
}
+
Enumeration merges = mergefiles .elements();
+
while ( merges .hasMoreElements() ) {
String path = (String) merges .nextElement();
File f = new File( path );
+
if ( f.getName().endsWith( ".jar" ) || f.getName().endsWith(
".zip" ) ) {
//Do the merge
mergeZipJarContents( output, f );
- }
- else {
+ } else {
//Add this file to the addfiles Vector and add it
//later at the top level of the output file.
addAddFile( path );
}
}
+
Enumeration adds = addfiles .elements();
+
while ( adds .hasMoreElements() ) {
String name = (String) adds .nextElement();
File f = new File( name );
+
if ( f .isDirectory() ) {
//System.out.println("in jlink: adding directory contents of
" + f.getPath());
addDirContents( output, f, f.getName() + '/', compression );
- }
- else {
+ } else {
addFile( output, f, "", compression );
}
}
if ( output != null ) {
try {
output .close();
- } catch( IOException ioe ) {}
+ } catch (IOException ioe) {
}
}
+ }
+
public static void main( String[] args ) {
// jlink output input1 ... inputN
@@ -205,6 +199,7 @@
System .exit( 1 );
}
jlink linker = new jlink();
+
linker .setOutfile( args[0] );
//To maintain compatibility with the command-line version, we will
only add files to be merged.
for ( int i = 1; i < args .length; i++ ) {
@@ -217,6 +212,7 @@
}
}
+
/*
* Actually performs the merging of f into the output.
* f should be a zip or jar file.
@@ -228,6 +224,7 @@
}
ZipFile zipf = new ZipFile( f );
Enumeration entries = zipf.entries();
+
while (entries.hasMoreElements()){
ZipEntry inputEntry = (ZipEntry) entries.nextElement();
//Ignore manifest entries. They're bound to cause conflicts
between
@@ -235,6 +232,7 @@
//manifest file when doing the merge.
String inputEntryName = inputEntry.getName();
int index = inputEntryName.indexOf("META-INF");
+
if (index < 0){
//META-INF not found in the name of the entry. Go ahead and
process it.
try {
@@ -247,6 +245,7 @@
//In that case, just ignore the error and go on to the
//next entry.
String mess = ex.getMessage();
+
if (mess.indexOf("duplicate") >= 0){
//It was the duplicate entry.
continue;
@@ -255,9 +254,11 @@
throw ex;
}
}
+
InputStream in = zipf.getInputStream(inputEntry);
int len = buffer.length;
int count = -1;
+
while ((count = in.read(buffer, 0, len)) > 0){
output.write(buffer, 0, count);
}
@@ -268,23 +269,26 @@
zipf .close();
}
+
/*
* Adds contents of a directory to the output.
*/
private void addDirContents( ZipOutputStream output, File dir, String
prefix, boolean compress ) throws IOException {
String[] contents = dir .list();
+
for ( int i = 0; i < contents .length; ++i ) {
String name = contents[i];
File file = new File( dir, name );
+
if ( file .isDirectory() ) {
addDirContents( output, file, prefix + name + '/', compress
);
- }
- else {
+ } else {
addFile( output, file, prefix, compress );
}
}
}
+
/*
* Gets the name of an entry in the file. This is the real name
* which for a class is the name of the package with the class
@@ -292,40 +296,48 @@
*/
private String getEntryName( File file, String prefix ) {
String name = file .getName();
+
if ( ! name .endsWith( ".class" ) ) {
// see if the file is in fact a .class file, and determine its
actual name.
try {
InputStream input = new FileInputStream( file );
String className = ClassNameReader .getClassName( input );
+
input .close();
if ( className != null ) {
return className .replace( '.', '/' ) + ".class";
}
- } catch( IOException ioe ) {}
+ } catch (IOException ioe) {
+ }
}
System.out.println("From " + file.getPath() + " and prefix " +
prefix + ", creating entry " + prefix+name);
return (prefix + name);
}
+
/*
* Adds a file to the output stream.
*/
private void addFile( ZipOutputStream output, File file, String prefix,
boolean compress) throws IOException {
//Make sure file exists
long checksum = 0;
+
if ( ! file .exists() ) {
return ;
}
ZipEntry entry = new ZipEntry( getEntryName( file, prefix ) );
+
entry .setTime( file .lastModified() );
entry .setSize( file .length() );
if (! compress){
entry.setCrc(calcChecksum(file));
}
FileInputStream input = new FileInputStream( file );
+
addToOutputStream(output, input, entry);
}
+
/*
* A convenience method that several other methods might call.
*/
@@ -337,7 +349,9 @@
input.close();
return;
}
+
int numBytes = -1;
+
while((numBytes = input.read(buffer)) > 0){
output.write(buffer, 0, numBytes);
}
@@ -345,6 +359,7 @@
input.close();
}
+
/*
* A method that does the work on a given entry in a mergefile.
* The big deal is to set the right parameters in the ZipEntry
@@ -364,17 +379,21 @@
information on to the output entry.
*/
String name = inputEntry .getName();
+
if ( ! (inputEntry .isDirectory() || name .endsWith( ".class" )) ) {
try {
InputStream input = zip.getInputStream( zip .getEntry( name
) );
String className = ClassNameReader .getClassName( input );
+
input .close();
if ( className != null ) {
name = className .replace( '.', '/' ) + ".class";
}
- } catch( IOException ioe ) {}
+ } catch (IOException ioe) {
+ }
}
ZipEntry outputEntry = new ZipEntry( name );
+
outputEntry.setTime(inputEntry .getTime() );
outputEntry.setExtra(inputEntry.getExtra());
outputEntry.setComment(inputEntry.getComment());
@@ -390,15 +409,18 @@
return outputEntry;
}
+
/*
* Necessary in the case where you add a entry that
* is not compressed.
*/
private long calcChecksum(File f) throws IOException {
BufferedInputStream in = new BufferedInputStream(new
FileInputStream(f));
+
return calcChecksum(in, f.length());
}
+
/*
* Necessary in the case where you add a entry that
* is not compressed.
@@ -408,6 +430,7 @@
int len = buffer.length;
int count = -1;
int haveRead = 0;
+
while((count=in.read(buffer, 0, len)) > 0){
haveRead += count;
crc.update(buffer, 0, count);
@@ -416,6 +439,7 @@
return crc.getValue();
}
+
private String outfile = null;
private Vector mergefiles = new Vector( 10 );
1.14 +43 -43
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
Index: JspC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
--- JspC.java 10 Apr 2002 00:19:54 -0000 1.13
+++ JspC.java 15 Apr 2002 12:11:48 -0000 1.14
@@ -530,22 +530,22 @@
boolean shouldCompile=false;
if (!javaFile.exists()) {
shouldCompile=true;
- log("Compiling " + srcFile.getPath() +
- " because java file "+ javaFile.getPath() + " does not
exist",
- Project.MSG_VERBOSE);
+ log("Compiling " + srcFile.getPath()
+ + " because java file " + javaFile.getPath()
+ + " does not exist", Project.MSG_VERBOSE);
} else {
if( srcFile.lastModified() > javaFile.lastModified()) {
shouldCompile=true;
- log("Compiling " + srcFile.getPath() +
- " because it is out of date with respect to " +
javaFile.getPath(),
+ log("Compiling " + srcFile.getPath()
+ + " because it is out of date with respect to "
+ + javaFile.getPath(),
Project.MSG_VERBOSE);
} else {
if( javaFile.length()==0) {
shouldCompile=true;
- log("Compiling " + srcFile.getPath() +
- " because java file "+ javaFile.getPath()
- + " is empty",
- Project.MSG_VERBOSE);
+ log("Compiling " + srcFile.getPath()
+ + " because java file " + javaFile.getPath()
+ + " is empty", Project.MSG_VERBOSE);
}
}
}
1.7 +32 -30
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
Index: WLJspc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- WLJspc.java 12 Apr 2002 13:44:36 -0000 1.6
+++ WLJspc.java 15 Apr 2002 12:11:48 -0000 1.7
@@ -146,7 +146,8 @@
String systemClassPath = System.getProperty("java.class.path");
- pathToPackage =
this.destinationPackage.replace('.',File.separatorChar);
+ pathToPackage
+ = this.destinationPackage.replace('.', File.separatorChar);
// get all the files in the sourceDirectory
DirectoryScanner ds = super.getDirectoryScanner(sourceDirectory);
@@ -207,7 +208,8 @@
}
- args[j+2] = sourceDirectory+File.separator+(String)
filesToDo.elementAt(i);
+ args[j + 2] = sourceDirectory + File.separator
+ + (String) filesToDo.elementAt(i);
arg="";
for (int x=0;x<12;x++) {
@@ -330,13 +332,13 @@
}
- protected String replaceString(String inpString,String
escapeChars,String replaceChars) {
+ protected String replaceString(String inpString, String escapeChars,
+ String replaceChars) {
String localString="";
int numTokens=0;
StringTokenizer st=new StringTokenizer(inpString,escapeChars,true);
numTokens=st.countTokens();
- for(int i=0;i<numTokens;i++)
- {
+ for (int i = 0; i < numTokens; i++) {
String test=st.nextToken();
test=(test.equals(escapeChars)?replaceChars:test);
localString+=test;
1.2 +6 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java
Index: DefaultJspCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
1.7 +13 -13
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
Index: JasperC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
1.2 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapter.java
Index: JspCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
1.2 +9 -9
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java
Index: JspCompilerAdapterFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
1.15 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
Index: AggregateTransformer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -u -r1.14 -r1.15
1.11 +6 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/BatchTest.java
Index: BatchTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/BatchTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- BatchTest.java 10 Jan 2002 13:59:37 -0000 1.10
+++ BatchTest.java 15 Apr 2002 12:11:48 -0000 1.11
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.5 +9 -9
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java
Index: DOMUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- DOMUtil.java 28 Oct 2001 21:30:22 -0000 1.4
+++ DOMUtil.java 15 Apr 2002 12:11:48 -0000 1.5
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.4 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java
Index: Enumerations.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- Enumerations.java 10 Jan 2002 13:59:37 -0000 1.3
+++ Enumerations.java 15 Apr 2002 12:11:48 -0000 1.4
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.8 +3 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java
Index: FormatterElement.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- FormatterElement.java 10 Jan 2002 13:59:37 -0000 1.7
+++ FormatterElement.java 15 Apr 2002 12:11:48 -0000 1.8
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -195,7 +195,8 @@
}
if (!(o instanceof JUnitResultFormatter)) {
- throw new BuildException(classname+" is not a
JUnitResultFormatter");
+ throw new BuildException(classname
+ + " is not a JUnitResultFormatter");
}
JUnitResultFormatter r = (JUnitResultFormatter) o;
1.8 +4 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitResultFormatter.java
Index: JUnitResultFormatter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitResultFormatter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- JUnitResultFormatter.java 10 Jan 2002 13:59:37 -0000 1.7
+++ JUnitResultFormatter.java 15 Apr 2002 12:11:48 -0000 1.8
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.41 +27 -28
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Index: JUnitTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -w -u -r1.40 -r1.41
--- JUnitTask.java 15 Apr 2002 08:39:18 -0000 1.40
+++ JUnitTask.java 15 Apr 2002 12:11:48 -0000 1.41
@@ -146,7 +146,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Gerrit Riessen</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Erik Hatcher</a>
*
- * @version $Revision: 1.40 $
+ * @version $Revision: 1.41 $
*
* @since Ant 1.2
*
@@ -543,8 +543,7 @@
if ((errorOccurredHere && test.getHaltonerror())
|| (failureOccurredHere && test.getHaltonfailure())) {
throw new BuildException("Test "+test.getName()+" failed"
- +(wasKilled ? " (timeout)" : ""),
- location);
+ + (wasKilled ? " (timeout)" : ""), location);
} else {
log("TEST "+test.getName()+" FAILED"
+ (wasKilled ? " (timeout)" : ""), Project.MSG_ERR);
1.12 +21 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
Index: JUnitTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -u -r1.11 -r1.12
--- JUnitTest.java 12 Apr 2002 15:08:17 -0000 1.11
+++ JUnitTest.java 15 Apr 2002 12:11:48 -0000 1.12
@@ -148,12 +148,26 @@
this.runTime = runTime;
}
- public long runCount() {return runs;}
- public long failureCount() {return failures;}
- public long errorCount() {return errors;}
- public long getRunTime() {return runTime;}
+ public long runCount() {
+ return runs;
+ }
+
+ public long failureCount() {
+ return failures;
+ }
+
+ public long errorCount() {
+ return errors;
+ }
+
+ public long getRunTime() {
+ return runTime;
+ }
+
+ public Properties getProperties() {
+ return props;
+ }
- public Properties getProperties() { return props;}
public void setProperties(Hashtable p) {
props = new Properties();
for (Enumeration enum = p.keys(); enum.hasMoreElements(); ) {
1.21 +19 -19
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Index: JUnitTestRunner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -u -r1.20 -r1.21
1.14 +7 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java
Index: PlainJUnitResultFormatter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
--- PlainJUnitResultFormatter.java 20 Jan 2002 20:45:57 -0000 1.13
+++ PlainJUnitResultFormatter.java 15 Apr 2002 12:11:48 -0000 1.14
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.8 +7 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java
Index: SummaryJUnitResultFormatter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- SummaryJUnitResultFormatter.java 10 Jan 2002 13:59:37 -0000 1.7
+++ SummaryJUnitResultFormatter.java 15 Apr 2002 12:11:48 -0000 1.8
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.21 +8 -9
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
Index: XMLJUnitResultFormatter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -u -r1.20 -r1.21
--- XMLJUnitResultFormatter.java 20 Jan 2002 20:45:57 -0000 1.20
+++ XMLJUnitResultFormatter.java 15 Apr 2002 12:11:48 -0000 1.21
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -218,8 +218,7 @@
Long l = (Long) testStarts.get(test);
currentTest.setAttribute(ATTR_TIME,
-
""+((System.currentTimeMillis()-l.longValue())
- / 1000.0));
+ "" + ((System.currentTimeMillis() - l.longValue()) / 1000.0));
}
/**
1.16 +9 -8
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
Index: XMLResultAggregator.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -u -r1.15 -r1.16
--- XMLResultAggregator.java 9 Apr 2002 12:13:25 -0000 1.15
+++ XMLResultAggregator.java 15 Apr 2002 12:11:48 -0000 1.16
@@ -270,7 +270,8 @@
//XXX there seems to be a bug in xerces 1.3.0 that doesn't
like file object
// will investigate later. It does not use the given
directory but
// the vm dir instead ? Works fine with crimson.
- Document testsuiteDoc = builder.parse( "file:///" +
files[i].getAbsolutePath() );
+ Document testsuiteDoc
+ = builder.parse("file:///" + files[i].getAbsolutePath());
Element elem = testsuiteDoc.getDocumentElement();
// make sure that this is REALLY a testsuite.
if ( TESTSUITE.equals(elem.getNodeName()) ) {
1.8 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/Xalan1Executor.java
Index: Xalan1Executor.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/Xalan1Executor.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
1.9 +8 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
Index: MParse.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- MParse.java 25 Feb 2002 17:38:16 -0000 1.8
+++ MParse.java 15 Apr 2002 12:11:49 -0000 1.9
@@ -278,12 +278,14 @@
File[] jars = getMetamataLibs();
for (int i = 0; i < jars.length; i++){
if (!jars[i].exists()){
- throw new BuildException( jars[i] + " does not exist. Check
your metamata installation.");
+ throw new BuildException(jars[i]
+ + " does not exist. Check your metamata installation.");
}
}
// check that the target is ok and resolve it.
- if (target == null || !target.isFile() ||
!target.getName().endsWith(".jj") ) {
+ if (target == null || !target.isFile()
+ || !target.getName().endsWith(".jj")) {
throw new BuildException("Invalid target: " + target);
}
target = project.resolveFile(target.getPath());
1.20 +329 -368
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
Index: FTP.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -u -r1.19 -r1.20
--- FTP.java 15 Apr 2002 09:57:34 -0000 1.19
+++ FTP.java 15 Apr 2002 12:11:49 -0000 1.20
@@ -51,7 +51,6 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
-
package org.apache.tools.ant.taskdefs.optional.net;
import com.oroinc.net.ftp.FTPClient;
@@ -89,24 +88,22 @@
* <li><strong>list</strong> - create a file listing.</li>
* <li><strong>chmod</strong> - change unix file permissions.</li>
* </ul>
+ * <strong>Note:</strong> Some FTP servers - notably the Solaris server -
seem
+ * to hold data ports open after a "retr" operation, allowing them to timeout
+ * instead of shutting them down cleanly. This happens in active or passive
+ * mode, and the ports will remain open even after ending the FTP session.
FTP
+ * "send" operations seem to close ports immediately. This behavior may cause
+ * problems on some systems when downloading large sets of files.
*
- * <strong>Note:</strong>
- * Some FTP servers - notably the Solaris server - seem to hold data ports
- * open after a "retr" operation, allowing them to timeout instead of
- * shutting them down cleanly. This happens in active or passive mode,
- * and the ports will remain open even after ending the FTP session.
- * FTP "send" operations seem to close ports immediately. This behavior
- * may cause problems on some systems when downloading large sets of files.
- *
- * @author Roger Vaughn <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
- * @author Glenn McAllister <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
+ * @author Roger Vaughn <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
+ * @author Glenn McAllister <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
- *
* @since Ant 1.3
*/
public class FTP
- extends Task
-{
+ extends Task {
protected final static int SEND_FILES = 0;
protected final static int GET_FILES = 1;
protected final static int DEL_FILES = 2;
@@ -154,14 +151,17 @@
"mode changed"
};
+
protected class FTPDirectoryScanner extends DirectoryScanner {
protected FTPClient ftp = null;
+
public FTPDirectoryScanner(FTPClient ftp) {
super();
this.ftp = ftp;
}
+
public void scan() {
if (includes == null) {
// No includes supplied, so set it to 'matches all'
@@ -189,6 +189,7 @@
}
}
+
protected void scandir(String dir, String vpath, boolean fast) {
try {
if (!ftp.changeWorkingDirectory(dir)) {
@@ -196,6 +197,7 @@
}
FTPFile[] newfiles = ftp.listFiles();
+
if (newfiles == null) {
ftp.changeToParentDirectory();
return;
@@ -203,6 +205,7 @@
for (int i = 0; i < newfiles.length; i++) {
FTPFile file = newfiles[i];
+
if (!file.getName().equals(".")
&& !file.getName().equals("..")) {
if (file.isDirectory()) {
@@ -235,6 +238,7 @@
} else {
if (file.isFile()) {
String name = vpath + file.getName();
+
if (isIncluded(name)) {
if (!isExcluded(name)) {
filesIncluded.addElement(name);
@@ -256,106 +260,98 @@
}
}
+
/**
- * Sets the remote directory where files will be placed. This may
- * be a relative or absolute path, and must be in the path syntax
- * expected by the remote server. No correction of path syntax will
- * be performed.
+ * Sets the remote directory where files will be placed. This may be a
+ * relative or absolute path, and must be in the path syntax expected by
+ * the remote server. No correction of path syntax will be performed.
*/
- public void setRemotedir(String dir)
- {
+ public void setRemotedir(String dir) {
this.remotedir = dir;
}
- /**
- * Sets the FTP server to send files to.
- */
- public void setServer(String server)
- {
+
+ /** Sets the FTP server to send files to. */
+ public void setServer(String server) {
this.server = server;
}
- /**
- * Sets the FTP port used by the remote server.
- */
- public void setPort(int port)
- {
+
+ /** Sets the FTP port used by the remote server. */
+ public void setPort(int port) {
this.port = port;
}
- /**
- * Sets the login user id to use on the specified server.
- */
- public void setUserid(String userid)
- {
+
+ /** Sets the login user id to use on the specified server. */
+ public void setUserid(String userid) {
this.userid = userid;
}
- /**
- * Sets the login password for the given user id.
- */
- public void setPassword(String password)
- {
+
+ /** Sets the login password for the given user id. */
+ public void setPassword(String password) {
this.password = password;
}
+
/**
- * Specifies whether to use binary-mode or text-mode transfers. Set
- * to true to send binary mode. Binary mode is enabled by default.
+ * Specifies whether to use binary-mode or text-mode transfers. Set to
+ * true to send binary mode. Binary mode is enabled by default.
*/
- public void setBinary(boolean binary)
- {
+ public void setBinary(boolean binary) {
this.binary = binary;
}
+
/**
- * Specifies whether to use passive mode. Set to true if you
- * are behind a firewall and cannot connect without it. Passive mode
- * is disabled by default.
+ * Specifies whether to use passive mode. Set to true if you are behind a
+ * firewall and cannot connect without it. Passive mode is disabled by
+ * default.
*/
- public void setPassive(boolean passive)
- {
+ public void setPassive(boolean passive) {
this.passive = passive;
}
+
/**
* Set to true to receive notification about each file as it is
* transferred.
*/
- public void setVerbose(boolean verbose)
- {
+ public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
+
/**
* Set to true to transmit only files that are new or changed from their
* remote counterparts. The default is to transmit all files.
*/
- public void setNewer(boolean newer)
- {
+ public void setNewer(boolean newer) {
this.newerOnly = newer;
}
+
/**
* A synonym for setNewer. Set to true to transmit only new or changed
* files.
*/
- public void setDepends(boolean depends)
- {
+ public void setDepends(boolean depends) {
this.newerOnly = depends;
}
+
/**
- * Sets the remote file separator character. This normally defaults to
- * the Unix standard forward slash, but can be manually overridden using
- * this call if the remote server requires some other separator. Only
- * the first character of the string is used.
+ * Sets the remote file separator character. This normally defaults to
the
+ * Unix standard forward slash, but can be manually overridden using this
+ * call if the remote server requires some other separator. Only the
first
+ * character of the string is used.
*/
- public void setSeparator(String separator)
- {
+ public void setSeparator(String separator) {
remoteFileSep = separator;
}
+
/**
* Sets the file permission mode (Unix only) for files sent to the
server.
*/
@@ -364,46 +360,49 @@
this.chmod = theMode;
}
- /**
- * Sets the default mask for file creation on a unix server.
- */
+
+ /** Sets the default mask for file creation on a unix server. */
public void setUmask(String theUmask) {
this.umask = theUmask;
}
- /**
- * Adds a set of files (nested fileset attribute).
- */
+
+ /** Adds a set of files (nested fileset attribute). */
public void addFileset(FileSet set) {
filesets.addElement(set);
}
+
/**
- * Sets the FTP action to be taken. Currently accepts "put", "get",
- * "del", "mkdir" and "list".
+ * Sets the FTP action to be taken. Currently accepts "put", "get",
"del",
+ * "mkdir" and "list".
*
* @deprecated setAction(String) is deprecated and is replaced with
- * setAction(FTP.Action) to make Ant's Introspection
- * mechanism do the work and also to encapsulate operations
on
- * the type in its own class.
+ * setAction(FTP.Action) to make Ant's Introspection mechanism do
the
+ * work and also to encapsulate operations on the type in its own
+ * class.
*/
public void setAction(String action) throws BuildException {
log("DEPRECATED - The setAction(String) method has been deprecated."
+ " Use setAction(FTP.Action) instead.");
+
Action a = new Action();
+
a.setValue(action);
this.action = a.getAction();
}
+
/**
- * Sets the FTP action to be taken. Currently accepts "put", "get",
- * "del", "mkdir", "chmod" and "list".
+ * Sets the FTP action to be taken. Currently accepts "put", "get",
"del",
+ * "mkdir", "chmod" and "list".
*/
public void setAction(Action action) throws BuildException {
this.action = action.getAction();
}
+
/**
* The output file for the "list" action. This attribute is ignored for
* any other actions.
@@ -413,13 +412,12 @@
}
- /**
- * set the failed transfer flag
- */
+ /** set the failed transfer flag */
public void setSkipFailedTransfers(boolean skipFailedTransfers) {
this.skipFailedTransfers=skipFailedTransfers;
}
+
/**
* set the flag to skip errors on dir creation (and maybe later other
* server specific errors)
@@ -428,26 +426,20 @@
this.ignoreNoncriticalErrors=ignoreNoncriticalErrors;
}
- /**
- * Checks to see that all required parameters are set.
- */
- protected void checkConfiguration() throws BuildException
- {
- if (server == null)
- {
+
+ /** Checks to see that all required parameters are set. */
+ protected void checkConfiguration() throws BuildException {
+ if (server == null) {
throw new BuildException("server attribute must be set!");
}
- if (userid == null)
- {
+ if (userid == null) {
throw new BuildException("userid attribute must be set!");
}
- if (password == null)
- {
+ if (password == null) {
throw new BuildException("password attribute must be set!");
}
- if ((action == LIST_FILES) && (listing == null))
- {
+ if ((action == LIST_FILES) && (listing == null)) {
throw new BuildException("listing attribute must be set for list
"
+ "action!");
}
@@ -463,13 +455,13 @@
}
}
+
/**
- * For each file in the fileset, do the appropriate action: send,
- * get, delete, or list.
+ * For each file in the fileset, do the appropriate action: send, get,
+ * delete, or list.
*/
protected int transferFiles(FTPClient ftp, FileSet fs)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
FileScanner ds;
if (action == SEND_FILES) {
@@ -482,6 +474,7 @@
String[] dsfiles = ds.getIncludedFiles();
String dir = null;
+
if ((ds.getBasedir() == null)
&& ((action == SEND_FILES) || (action == GET_FILES))) {
throw new BuildException("the dir attribute must be set for send
"
@@ -494,9 +487,11 @@
// If we are doing a listing, we need the output stream created now.
BufferedWriter bw = null;
+
try {
if (action == LIST_FILES) {
File pd = fileUtils.getParentFile(listing);
+
if (!pd.exists()) {
pd.mkdirs();
}
@@ -505,33 +500,39 @@
for (int i = 0; i < dsfiles.length; i++) {
switch (action) {
- case SEND_FILES: {
+ case SEND_FILES:
+ {
sendFile(ftp, dir, dsfiles[i]);
break;
}
- case GET_FILES: {
+ case GET_FILES:
+ {
getFile(ftp, dir, dsfiles[i]);
break;
}
- case DEL_FILES: {
+ case DEL_FILES:
+ {
delFile(ftp, dsfiles[i]);
break;
}
- case LIST_FILES: {
+ case LIST_FILES:
+ {
listFile(ftp, bw, dsfiles[i]);
break;
}
- case CHMOD: {
+ case CHMOD:
+ {
doSiteCommand(ftp, "chmod " + chmod + " " + dsfiles[i]);
transferred++;
break;
}
- default: {
+ default:
+ {
throw new BuildException("unknown ftp action " + action
);
}
}
@@ -545,28 +546,24 @@
return dsfiles.length;
}
+
/**
* Sends all files specified by the configured filesets to the remote
* server.
*/
protected void transferFiles(FTPClient ftp)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
transferred = 0;
skipped=0;
- if (filesets.size() == 0)
- {
+ if (filesets.size() == 0) {
throw new BuildException("at least one fileset must be
specified.");
- }
- else
- {
+ } else {
// get files from filesets
- for (int i = 0; i < filesets.size(); i++)
- {
+ for (int i = 0; i < filesets.size(); i++) {
FileSet fs = (FileSet) filesets.elementAt(i);
- if (fs != null)
- {
+
+ if (fs != null) {
transferFiles(ftp, fs);
}
}
@@ -579,43 +576,39 @@
}
}
+
/**
- * Correct a file path to correspond to the remote host requirements.
- * This implementation currently assumes that the remote end can
- * handle Unix-style paths with forward-slash separators. This can
- * be overridden with the <code>separator</code> task parameter. No
- * attempt is made to determine what syntax is appropriate for the
- * remote host.
+ * Correct a file path to correspond to the remote host requirements.
This
+ * implementation currently assumes that the remote end can handle
+ * Unix-style paths with forward-slash separators. This can be overridden
+ * with the <code>separator</code> task parameter. No attempt is made to
+ * determine what syntax is appropriate for the remote host.
*/
- protected String resolveFile(String file)
- {
+ protected String resolveFile(String file) {
return file.replace(System.getProperty("file.separator").charAt(0),
remoteFileSep.charAt(0));
}
+
/**
* Creates all parent directories specified in a complete relative
* pathname. Attempts to create existing directories will not cause
* errors.
*/
protected void createParents(FTPClient ftp, String filename)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
Vector parents = new Vector();
File dir = new File(filename);
String dirname;
- while ((dirname = dir.getParent()) != null)
- {
+ while ((dirname = dir.getParent()) != null) {
dir = new File(dirname);
parents.addElement(dir);
}
- for (int i = parents.size() - 1; i >= 0; i--)
- {
+ for (int i = parents.size() - 1; i >= 0; i--) {
dir = (File)parents.elementAt(i);
- if (!dirCache.contains(dir))
- {
+ if (!dirCache.contains(dir)) {
log("creating remote directory " +
resolveFile(dir.getPath()),
Project.MSG_VERBOSE);
ftp.makeDirectory(resolveFile(dir.getPath()));
@@ -623,12 +616,11 @@
// to indicate that an attempt to create a directory has
// failed because the directory already exists.
int result=ftp.getReplyCode();
+
if (!FTPReply.isPositiveCompletion(result) &&
(result != 550) && (result!= 553) &&
- !ignoreNoncriticalErrors)
- {
- throw new BuildException(
- "could not create directory: " +
+ !ignoreNoncriticalErrors) {
+ throw new BuildException("could not create directory: " +
ftp.getReplyString());
}
dirCache.addElement(dir);
@@ -636,22 +628,21 @@
}
}
+
/**
- * Checks to see if the remote file is current as compared with the
- * local file. Returns true if the remote file is up to date.
+ * Checks to see if the remote file is current as compared with the local
+ * file. Returns true if the remote file is up to date.
*/
protected boolean isUpToDate(FTPClient ftp, File localFile,
String remoteFile)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
log("checking date for " + remoteFile, Project.MSG_VERBOSE);
FTPFile[] files = ftp.listFiles(remoteFile);
// For Microsoft's Ftp-Service an Array with length 0 is
// returned if configured to return listings in "MS-DOS"-Format
- if (files == null || files.length == 0)
- {
+ if (files == null || files.length == 0) {
// If we are sending files, then assume out of date.
// If we are getting files, then throw an error
@@ -667,6 +658,7 @@
long remoteTimestamp = files[0].getTimestamp().getTime().getTime();
long localTimestamp = localFile.lastModified();
+
if (this.action == SEND_FILES) {
return remoteTimestamp > localTimestamp;
} else {
@@ -674,9 +666,8 @@
}
}
- /**
- * Sends a site command to the ftp server
- */
+
+ /** Sends a site command to the ftp server */
protected void doSiteCommand(FTPClient ftp, String TheCMD)
throws IOException, BuildException {
boolean rc;
@@ -700,22 +691,21 @@
}
}
+
/**
- * Sends a single file to the remote host.
- * <code>filename</code> may contain a relative path specification.
- * When this is the case, <code>sendFile</code> will attempt to create
- * any necessary parent directories before sending the file. The file
- * will then be sent using the entire relative path spec - no attempt
- * is made to change directories. It is anticipated that this may
- * eventually cause problems with some FTP servers, but it simplifies
- * the coding.
+ * Sends a single file to the remote host. <code>filename</code> may
+ * contain a relative path specification. When this is the case,
<code>sendFile</code>
+ * will attempt to create any necessary parent directories before sending
+ * the file. The file will then be sent using the entire relative path
+ * spec - no attempt is made to change directories. It is anticipated
that
+ * this may eventually cause problems with some FTP servers, but it
+ * simplifies the coding.
*/
protected void sendFile(FTPClient ftp, String dir, String filename)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
InputStream instream = null;
- try
- {
+
+ try {
// XXX - why not simply new File(dir, filename)?
File file = project.resolveFile(new File(dir,
filename).getPath());
@@ -723,8 +713,7 @@
return;
}
- if (verbose)
- {
+ if (verbose) {
log("transferring " + file.getAbsolutePath());
}
@@ -733,20 +722,20 @@
createParents(ftp, filename);
ftp.storeFile(resolveFile(filename), instream);
+
boolean
success=FTPReply.isPositiveCompletion(ftp.getReplyCode());
- if (!success)
- {
+
+ if (!success) {
String s="could not put file: " + ftp.getReplyString();
+
if(skipFailedTransfers==true) {
log(s,Project.MSG_WARN);
skipped++;
- }
- else {
+ } else {
throw new BuildException(s);
}
- }
- else {
+ } else {
if (chmod != null) { // see if we should issue a chmod
command
doSiteCommand(ftp,"chmod " + chmod + " " + filename);
}
@@ -754,26 +743,19 @@
Project.MSG_VERBOSE);
transferred++;
}
- }
- finally
- {
- if (instream != null)
- {
- try
- {
+ } finally {
+ if (instream != null) {
+ try {
instream.close();
- }
- catch(IOException ex)
- {
+ } catch (IOException ex) {
// ignore it
}
}
}
}
- /**
- * Delete a file from the remote host.
- */
+
+ /** Delete a file from the remote host. */
protected void delFile(FTPClient ftp, String filename)
throws IOException, BuildException {
if (verbose) {
@@ -782,122 +764,114 @@
if (!ftp.deleteFile(resolveFile(filename))) {
String s="could not delete file: " + ftp.getReplyString();
+
if(skipFailedTransfers==true) {
log(s,Project.MSG_WARN);
skipped++;
- }
- else {
+ } else {
throw new BuildException(s);
}
- }
- else {
+ } else {
log("File " + filename + " deleted from " + server,
Project.MSG_VERBOSE);
transferred++;
}
}
+
/**
- * Retrieve a single file to the remote host.
- * <code>filename</code> may contain a relative path specification.
+ * Retrieve a single file to the remote host. <code>filename</code> may
+ * contain a relative path specification. <p>
*
- * <p>The file will then be retreived using the entire relative
- * path spec - no attempt is made to change directories. It is
- * anticipated that this may eventually cause problems with some
- * FTP servers, but it simplifies the coding.</p>
+ * The file will then be retreived using the entire relative path spec -
+ * no attempt is made to change directories. It is anticipated that this
+ * may eventually cause problems with some FTP servers, but it simplifies
+ * the coding.</p>
*/
protected void getFile(FTPClient ftp, String dir, String filename)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
OutputStream outstream = null;
- try
- {
+
+ try {
File file = project.resolveFile(new File(dir,
filename).getPath());
if (newerOnly && isUpToDate(ftp, file, resolveFile(filename))) {
return;
}
- if (verbose)
- {
+ if (verbose) {
log("transferring " + filename + " to "
+ file.getAbsolutePath());
}
-
File pdir = fileUtils.getParentFile(file);
+
if (!pdir.exists()) {
pdir.mkdirs();
}
outstream = new BufferedOutputStream(new FileOutputStream(file));
ftp.retrieveFile(resolveFile(filename), outstream);
- if (!FTPReply.isPositiveCompletion(ftp.getReplyCode()))
- {
+ if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
String s="could not get file: " + ftp.getReplyString();
+
if(skipFailedTransfers==true) {
log(s,Project.MSG_WARN);
skipped++;
- }
- else {
+ } else {
throw new BuildException(s);
}
- }
- else {
+ } else {
log("File " + file.getAbsolutePath() + " copied from "
+ server, Project.MSG_VERBOSE);
transferred++;
}
- }
- finally
- {
- if (outstream != null)
- {
- try
- {
+ } finally {
+ if (outstream != null) {
+ try {
outstream.close();
- }
- catch(IOException ex)
- {
+ } catch (IOException ex) {
// ignore it
}
}
}
}
+
/**
- * List information about a single file from the remote host.
- * <code>filename</code> may contain a relative path specification.
+ * List information about a single file from the remote host.
<code>filename</code>
+ * may contain a relative path specification. <p>
*
- * <p>The file listing will then be retrieved using the entire
- * relative path spec - no attempt is made to change directories.
- * It is anticipated that this may eventually cause problems with
- * some FTP servers, but it simplifies the coding.</p>
+ * The file listing will then be retrieved using the entire relative path
+ * spec - no attempt is made to change directories. It is anticipated
that
+ * this may eventually cause problems with some FTP servers, but it
+ * simplifies the coding.</p>
*/
protected void listFile(FTPClient ftp, BufferedWriter bw, String
filename)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
if (verbose) {
log("listing " + filename);
}
FTPFile ftpfile = ftp.listFiles(resolveFile(filename))[0];
+
bw.write(ftpfile.toString());
bw.newLine();
transferred++;
}
+
/**
* Create the specified directory on the remote host.
+ *
* @param ftp The FTP client connection
- * @param dir The directory to create (format must be correct for
- * host type)
+ * @param dir The directory to create (format must be correct for host
+ * type)
*/
protected void makeRemoteDir( FTPClient ftp, String dir )
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
if (verbose) {
log("creating directory: " + dir);
}
@@ -908,6 +882,7 @@
// failed because the directory already exists.
int rc = ftp.getReplyCode();
+
if( !(ignoreNoncriticalErrors
&& (rc == 550 || rc == 553 || rc==521))) {
throw new BuildException( "could not create directory: " +
@@ -924,25 +899,21 @@
}
}
- /**
- * Runs the task.
- */
+
+ /** Runs the task. */
public void execute()
- throws BuildException
- {
+ throws BuildException {
checkConfiguration();
FTPClient ftp = null;
- try
- {
+ try {
log("Opening FTP connection to " + server, Project.MSG_VERBOSE);
ftp = new FTPClient();
ftp.connect(server, port);
- if (!FTPReply.isPositiveCompletion(ftp.getReplyCode()))
- {
+ if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
throw new BuildException("FTP connection failed: "
+ ftp.getReplyString());
}
@@ -950,29 +921,24 @@
log("connected", Project.MSG_VERBOSE);
log("logging in to FTP server", Project.MSG_VERBOSE);
- if (!ftp.login(userid, password))
- {
+ if (!ftp.login(userid, password)) {
throw new BuildException("Could not login to FTP server");
}
log("login succeeded", Project.MSG_VERBOSE);
- if (binary)
- {
+ if (binary) {
ftp.setFileType(com.oroinc.net.ftp.FTP.IMAGE_FILE_TYPE);
- if (!FTPReply.isPositiveCompletion(ftp.getReplyCode()))
- {
+ if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
throw new BuildException("could not set transfer type: "
+
ftp.getReplyString());
}
}
- if (passive)
- {
+ if (passive) {
log("entering passive mode", Project.MSG_VERBOSE);
ftp.enterLocalPassiveMode();
- if (!FTPReply.isPositiveCompletion(ftp.getReplyCode()))
- {
+ if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
throw new BuildException("could not enter into passive "
+ "mode: " +
ftp.getReplyString());
@@ -994,12 +960,10 @@
makeRemoteDir( ftp, remotedir );
} else {
- if (remotedir != null)
- {
+ if (remotedir != null) {
log("changing the remote directory",
Project.MSG_VERBOSE);
ftp.changeWorkingDirectory(remotedir);
- if (!FTPReply.isPositiveCompletion(ftp.getReplyCode()))
- {
+ if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
throw new BuildException("could not change remote "
+ "directory: " +
ftp.getReplyString());
@@ -1009,29 +973,22 @@
transferFiles(ftp);
}
- }
- catch(IOException ex)
- {
+ } catch (IOException ex) {
throw new BuildException("error during FTP transfer: " + ex);
- }
- finally
- {
- if (ftp != null && ftp.isConnected())
- {
- try
- {
+ } finally {
+ if (ftp != null && ftp.isConnected()) {
+ try {
log("disconnecting", Project.MSG_VERBOSE);
ftp.logout();
ftp.disconnect();
- }
- catch(IOException ex)
- {
+ } catch (IOException ex) {
// ignore it
}
}
}
}
+
public static class Action extends EnumeratedAttribute {
private final static String[] validActions = {
@@ -1039,12 +996,15 @@
"chmod"
};
+
public String[] getValues() {
return validActions;
}
+
public int getAction() {
String actionL = getValue().toLowerCase(Locale.US);
+
if (actionL.equals("send") ||
actionL.equals("put")) {
return SEND_FILES;
@@ -1065,3 +1025,4 @@
}
}
}
+
1.8 +2 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
Index: MimeMail.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- MimeMail.java 12 Apr 2002 13:26:52 -0000 1.7
+++ MimeMail.java 15 Apr 2002 12:11:49 -0000 1.8
@@ -79,7 +79,8 @@
public void execute()
throws BuildException
{
- log( "DEPRECATED - The " + getTaskName() + " task is deprecated.
Use the mail task instead." );
+ log("DEPRECATED - The " + getTaskName() + " task is deprecated. "
+ + "Use the mail task instead.");
super.execute();
}
}
1.11 +14 -14
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
Index: TelnetTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- TelnetTask.java 5 Apr 2002 03:20:17 -0000 1.10
+++ TelnetTask.java 15 Apr 2002 12:11:49 -0000 1.11
@@ -70,7 +70,7 @@
* Class to provide automated telnet protocol support for the Ant build tool
*
* @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public class TelnetTask extends Task {
1.9 +1 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java
Index: P4Submit.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- P4Submit.java 12 Apr 2002 13:44:36 -0000 1.8
+++ P4Submit.java 15 Apr 2002 12:11:49 -0000 1.9
@@ -90,9 +90,7 @@
public void process(String line) {
log(line, Project.MSG_VERBOSE);
}
- }
- );
-
+ });
} else {
//here we'd parse the output from change -o into submit -i
//in order to support default change.
1.11 +79 -62
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
Index: Pvcs.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- Pvcs.java 12 Apr 2002 13:26:52 -0000 1.10
+++ Pvcs.java 15 Apr 2002 12:11:49 -0000 1.11
@@ -133,7 +133,8 @@
return exe.execute();
}
catch (java.io.IOException e) {
- String msg = "Failed executing: " + cmd.toString() + ".
Exception: "+e.getMessage();
+ String msg = "Failed executing: " + cmd.toString()
+ + ". Exception: " + e.getMessage();
throw new BuildException(msg, location);
}
}
@@ -195,7 +196,8 @@
while (e.hasMoreElements()) {
String projectName =
((PvcsProject)e.nextElement()).getName();
if (projectName == null || (projectName.trim()).equals("")) {
- throw new BuildException("name is a required attribute
of pvcsproject");
+ throw new BuildException("name is a required attribute "
+ + "of pvcsproject");
}
commandLine.createArgument().setValue(projectName);
}
@@ -208,14 +210,18 @@
tmp = new File("pvcs_ant_"+rand.nextLong()+".log");
tmp2 = new File("pvcs_ant_"+rand.nextLong()+".log");
log("Executing " + commandLine.toString(), Project.MSG_VERBOSE);
- result = runCmd(commandLine, new PumpStreamHandler(new
FileOutputStream(tmp), new LogOutputStream(this,Project.MSG_WARN)));
+ result = runCmd(commandLine,
+ new PumpStreamHandler(new FileOutputStream(tmp),
+ new LogOutputStream(this, Project.MSG_WARN)));
if ( result != 0 && !ignorerc) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
}
if(!tmp.exists()) {
- throw new BuildException("Communication between ant and pvcs
failed. No output generated from executing PVCS commandline interface \"pcli\"
and \"get\"");
+ throw new BuildException("Communication between ant and pvcs
"
+ + "failed. No output generated from executing PVCS "
+ + "commandline interface \"pcli\" and \"get\"");
}
// Create folders in workspace
@@ -236,7 +242,8 @@
}
if(getPromotiongroup()!=null) {
-
commandLine.createArgument().setValue("-G"+getPromotiongroup());
+ commandLine.createArgument().setValue("-G"
+ + getPromotiongroup());
} else {
if(getLabel()!=null) {
commandLine.createArgument().setValue("-r"+getLabel());
@@ -250,20 +257,25 @@
commandLine.createArgument().setValue("@"+tmp2.getAbsolutePath());
log("Getting files", Project.MSG_INFO);
log("Executing " + commandLine.toString(), Project.MSG_VERBOSE);
- result = runCmd(commandLine, new
LogStreamHandler(this,Project.MSG_INFO, Project.MSG_WARN));
+ result = runCmd(commandLine,
+ new LogStreamHandler(this, Project.MSG_INFO,
Project.MSG_WARN));
if ( result != 0 && !ignorerc) {
- String msg = "Failed executing: " + commandLine.toString() +
". Return code was "+result;
+ String msg = "Failed executing: " + commandLine.toString()
+ + ". Return code was " + result;
throw new BuildException(msg, location);
}
} catch(FileNotFoundException e) {
- String msg = "Failed executing: " + commandLine.toString() + ".
Exception: "+e.getMessage();
+ String msg = "Failed executing: " + commandLine.toString()
+ + ". Exception: " + e.getMessage();
throw new BuildException(msg,location);
} catch(IOException e) {
- String msg = "Failed executing: " + commandLine.toString() + ".
Exception: "+e.getMessage();
+ String msg = "Failed executing: " + commandLine.toString()
+ + ". Exception: " + e.getMessage();
throw new BuildException(msg,location);
} catch(ParseException e) {
- String msg = "Failed executing: " + commandLine.toString() + ".
Exception: "+e.getMessage();
+ String msg = "Failed executing: " + commandLine.toString()
+ + ". Exception: " + e.getMessage();
throw new BuildException(msg,location);
} finally {
if (tmp != null) {
@@ -294,14 +306,18 @@
if (index > -1) {
File dir = new File(f.substring(0, index));
if(!dir.exists()) {
- log("Creating "+dir.getAbsolutePath(),
Project.MSG_VERBOSE);
+ log("Creating " + dir.getAbsolutePath(),
+ Project.MSG_VERBOSE);
if(dir.mkdirs()) {
- log("Created "+dir.getAbsolutePath(),
Project.MSG_INFO);
+ log("Created " + dir.getAbsolutePath(),
+ Project.MSG_INFO);
} else {
- log("Failed to create "+dir.getAbsolutePath(),
Project.MSG_INFO);
+ log("Failed to create " + dir.getAbsolutePath(),
+ Project.MSG_INFO);
}
} else {
- log(dir.getAbsolutePath() + " exists. Skipping",
Project.MSG_VERBOSE);
+ log(dir.getAbsolutePath() + " exists. Skipping",
+ Project.MSG_VERBOSE);
}
} else {
log("File separator problem with " + line,
@@ -315,10 +331,11 @@
}
/**
- * Simple hack to handle the PVCS command-line tools botch when handling
UNC notation.
+ * Simple hack to handle the PVCS command-line tools botch when
+ * handling UNC notation.
*/
- private void massagePCLI(File in, File out) throws
FileNotFoundException, IOException
- {
+ private void massagePCLI(File in, File out)
+ throws FileNotFoundException, IOException {
BufferedReader inReader = new BufferedReader(new FileReader(in));
BufferedWriter outWriter = new BufferedWriter(new FileWriter(out));
String s = null;
1.16 +342 -390
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java
Index: AntStarTeamCheckOut.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -u -r1.15 -r1.16
--- AntStarTeamCheckOut.java 12 Apr 2002 13:26:53 -0000 1.15
+++ AntStarTeamCheckOut.java 15 Apr 2002 12:11:49 -0000 1.16
@@ -53,7 +53,6 @@
*/
package org.apache.tools.ant.taskdefs.optional.scm;
-
import java.util.StringTokenizer;
import com.starbase.starteam.Folder;
@@ -114,8 +113,7 @@
*
* @ant.task name="starteam" category="scm"
*/
-public class AntStarTeamCheckOut extends org.apache.tools.ant.Task
-{
+public class AntStarTeamCheckOut extends org.apache.tools.ant.Task {
/**
* This constant sets the filter to include all files. This default has
@@ -128,8 +126,8 @@
/**
* This disables the exclude filter by default. In other words, no files
- * are excluded. This setting is equivalent to
- * <CODE>setExcludes(null)</CODE>.
+ * are excluded. This setting is equivalent to
<CODE>setExcludes(null)</CODE>
+ * .
*
* @see #getExcludes()
* @see #setExcludes(String excludes)
@@ -152,47 +150,33 @@
*/
private Folder prevFolder = null;
- /**
- * This field keeps count of the number of files checked out.
- */
+ /** This field keeps count of the number of files checked out. */
private int checkedOut = 0;
// Change these through their GET and SET methods.
- /**
- * The name of the server you wish to connect to.
- */
+ /** The name of the server you wish to connect to. */
private String serverName = null;
- /**
- * The port on the server used for StarTeam.
- */
+ /** The port on the server used for StarTeam. */
private int serverPort = -1;
- /**
- * The name of your project.
- */
+ /** The name of your project. */
private String projectName = null;
/**
- * The name of the folder you want to check out files from. All
- * subfolders will be searched, as well.
+ * The name of the folder you want to check out files from. All
subfolders
+ * will be searched, as well.
*/
private String folderName = DEFAULT_FOLDERSETTING;
- /**
- * The view that the files you want are in.
- */
+ /** The view that the files you want are in. */
private String viewName = null;
- /**
- * Your username on the StarTeam server.
- */
+ /** Your username on the StarTeam server. */
private String username = null;
- /**
- * Your StarTeam password.
- */
+ /** Your StarTeam password. */
private String password = null;
/**
@@ -214,32 +198,26 @@
private boolean verbose = false;
/**
- * Set recursion to false to check out files in only the given folder
- * and not in its subfolders.
+ * Set recursion to false to check out files in only the given folder and
+ * not in its subfolders.
*/
private boolean recursion = true;
// These fields deal with includes and excludes
- /**
- * All files that fit this pattern are checked out.
- */
+ /** All files that fit this pattern are checked out. */
private String includes = DEFAULT_INCLUDESETTING;
- /**
- * All files fitting this pattern are ignored.
- */
+ /** All files fitting this pattern are ignored. */
private String excludes = DEFAULT_EXCLUDESETTING;
- /**
- * The file delimitor on the user's system.
- */
+ /** The file delimitor on the user's system. */
private String delim = Platform.getFilePathDelim();
/**
- * whether to use the Starteam "default folder" when calculating
- * the target paths to which files are checked out (false) or
- * if targetFolder represents an absolute mapping to folderName.
+ * whether to use the Starteam "default folder" when calculating the
+ * target paths to which files are checked out (false) or if targetFolder
+ * represents an absolute mapping to folderName.
*/
private boolean targetFolderAbsolute = false;
@@ -251,6 +229,7 @@
}
}
+
protected void checkParameters() throws BuildException {
// Check all of the properties that are required.
assertTrue( getServerName() != null, "ServerName must be set.");
@@ -265,27 +244,27 @@
// must be NO slash at the end of targetFolder and folderName
// However, if the slash or backslash is the only character, leave
it alone
if ((getTargetFolder().endsWith("/") ||
- getTargetFolder().endsWith("\\")) && getTargetFolder().length()
> 1)
- {
+ getTargetFolder().endsWith("\\"))
+ && getTargetFolder().length() > 1) {
setTargetFolder(getTargetFolder().substring(0,
getTargetFolder().length() - 1));
}
// Check to see if the target directory exists.
java.io.File dirExist = new java.io.File(getTargetFolder());
- if (dirExist.isDirectory() && !getForce())
- {
- throw new BuildException( "Target directory exists. Set
\"force\" to \"true\" " +
- "to continue anyway." );
+
+ if (dirExist.isDirectory() && !getForce()) {
+ throw new BuildException("Target directory exists. Set \"force\"
"
+ + "to \"true\" to continue anyway.");
}
}
+
/**
* Do the execution.
*
* @exception BuildException
*/
- public void execute() throws BuildException
- {
+ public void execute() throws BuildException {
log("DEPRECATED - The starteam task is deprecated. Use stcheckout
instead.",
Project.MSG_WARN);
@@ -307,13 +286,13 @@
log(checkedOut + " files checked out.");
}
+
/**
* Creates and logs in to a StarTeam server.
*
* @return A StarTeam server.
*/
- protected Server getServer()
- {
+ protected Server getServer() {
// Simplest constructor, uses default encryption algorithm and
compression level.
Server s = new Server(getServerName(), getServerPort());
@@ -326,22 +305,20 @@
return s;
}
+
/**
* Searches for the specified project on the server.
*
* @param s A StarTeam server.
*/
- protected void runServer(Server s)
- {
+ protected void runServer(Server s) {
com.starbase.starteam.Project[] projects = s.getProjects();
- for (int i = 0; i < projects.length; i++)
- {
+
+ for (int i = 0; i < projects.length; i++) {
com.starbase.starteam.Project p = projects[i];
- if (p.getName().equals(getProjectName()))
- {
- if (getVerbose())
- {
+ if (p.getName().equals(getProjectName())) {
+ if (getVerbose()) {
log("Found " + getProjectName() + delim);
}
runProject(s, p);
@@ -350,22 +327,21 @@
}
}
+
/**
* Searches for the given view in the project.
*
* @param s A StarTeam server.
* @param p A valid project on the given server.
*/
- protected void runProject(Server s, com.starbase.starteam.Project p)
- {
+ protected void runProject(Server s, com.starbase.starteam.Project p) {
View[] views = p.getViews();
- for (int i = 0; i < views.length; i++)
- {
+
+ for (int i = 0; i < views.length; i++) {
View v = views[i];
- if (v.getName().equals(getViewName()))
- {
- if (getVerbose())
- {
+
+ if (v.getName().equals(getViewName())) {
+ if (getVerbose()) {
log("Found " + getProjectName() + delim + getViewName()
+ delim);
}
runType(s, p, v, s.typeForName(s.getTypeNames().FILE));
@@ -374,6 +350,7 @@
}
}
+
/**
* Searches for folders in the given view.
*
@@ -382,18 +359,14 @@
* @param v A view name from the specified project.
* @param t An item type which is currently always "file".
*/
- protected void runType(Server s, com.starbase.starteam.Project p, View
v, Type t)
- {
+ protected void runType(Server s, com.starbase.starteam.Project p, View
v, Type t) {
// This is ugly; checking for the root folder.
Folder f = v.getRootFolder();
- if ( getFolderName() != null )
- {
- if (getFolderName().equals("\\") || getFolderName().equals("/"))
- {
+
+ if (getFolderName() != null) {
+ if (getFolderName().equals("\\") || getFolderName().equals("/"))
{
setFolderName(null);
- }
- else
- {
+ } else {
f = StarTeamFinder.findFolder(v.getRootFolder(),
getFolderName());
assertTrue(null != f,"ERROR: " + getProjectName() + delim +
getViewName() + delim +
v.getRootFolder() + delim +
getFolderName() + delim +
@@ -401,9 +374,7 @@
}
}
-
- if ( getVerbose() && getFolderName() != null )
- {
+ if (getVerbose() && getFolderName() != null) {
log( "Found " + getProjectName() + delim + getViewName() +
delim + getFolderName() + delim + "\n" );
}
@@ -420,18 +391,18 @@
// Does this item type have a secondary descriptor?
// If so, we'll need it.
Property p2 = getSecondaryDescriptor(t);
- if (p2 != null)
- {
+
+ if (p2 != null) {
nProperties++;
}
// Now, build an array of the property names.
String[] strNames = new String[nProperties];
int iProperty = 0;
+
strNames[iProperty++] = s.getPropertyNames().OBJECT_ID;
strNames[iProperty++] = p1.getName();
- if (p2 != null)
- {
+ if (p2 != null) {
strNames[iProperty++] = p2.getName();
}
@@ -445,22 +416,24 @@
f.discardItems(t.getName(), -1);
}
+
/**
* Returns a file object that defines the root of the local checkout
tree.
- * Depending on the value of targetFolderAbsolute, this will be either
- * the targetFolder exactly as set by the user or the path formed by
appending
+ * Depending on the value of targetFolderAbsolute, this will be either
the
+ * targetFolder exactly as set by the user or the path formed by
appending
* the default folder onto the specified target folder.
*
- * @param v view from which the file is checked out, supplies the
"default folder"
- * @param rootSourceFolder root folder of the checkout operation in
Star Team
+ * @param v view from which the file is checked out, supplies the
"default
+ * folder"
+ * @param rootSourceFolder root folder of the checkout operation in Star
+ * Team
* @return an object referencing the local file
* @see #getTargetFolderAbsolute()
*/
- private java.io.File calcTargetFolder(View v, Folder rootSourceFolder)
- {
+ private java.io.File calcTargetFolder(View v, Folder rootSourceFolder) {
java.io.File root = new java.io.File(getTargetFolder());
- if (!getTargetFolderAbsolute())
- {
+
+ if (!getTargetFolderAbsolute()) {
// Create a variable dir that contains the name of
// the StarTeam folder that is the root folder in this view.
// Get the default path to the current view.
@@ -474,8 +447,7 @@
String dirName = dir.getName();
// If it ends with separator then strip it off
- if (dirName.endsWith(delim))
- {
+ if (dirName.endsWith(delim)) {
dirName = dirName.substring(0, dirName.length()-1);
}
@@ -485,11 +457,10 @@
StringTokenizer pathTokenizer = new
StringTokenizer(rootSourceFolder.getFolderHierarchy(), delim);
String currentToken = null;
boolean foundRoot = false;
- while (pathTokenizer.hasMoreTokens())
- {
+
+ while (pathTokenizer.hasMoreTokens()) {
currentToken = pathTokenizer.nextToken();
- if (currentToken.equals(getProjectName()) && !foundRoot)
- {
+ if (currentToken.equals(getProjectName()) && !foundRoot) {
currentToken = dirName;
foundRoot = true; // only want to do this the first time
}
@@ -500,6 +471,7 @@
return root;
}
+
/**
* Searches for files in the given folder. This method is recursive and
* thus searches all subfolders.
@@ -516,29 +488,28 @@
View v,
Type t,
Folder f,
- java.io.File tgt )
- {
+ java.io.File tgt) {
// Process all items in this folder.
Item[] items = f.getItems(t.getName());
- for (int i = 0; i < items.length; i++)
- {
+
+ for (int i = 0; i < items.length; i++) {
runItem(s, p, v, t, f, items[i], tgt);
}
// Process all subfolders recursively if recursion is on.
- if (getRecursion())
- {
+ if (getRecursion()) {
Folder[] subfolders = f.getSubFolders();
- for (int i = 0; i < subfolders.length; i++)
- {
+
+ for (int i = 0; i < subfolders.length; i++) {
runFolder(s, p, v, t, subfolders[i], new java.io.File(tgt,
subfolders[i].getName()));
}
}
}
+
/**
- * Check out one file if it matches the include filter but not the
- * exclude filter.
+ * Check out one file if it matches the include filter but not the
exclude
+ * filter.
*
* @param s A StarTeam server.
* @param p A valid project on the server.
@@ -554,32 +525,31 @@
Type t,
Folder f,
Item item,
- java.io.File tgt )
- {
+ java.io.File tgt) {
// Get descriptors for this item type.
Property p1 = getPrimaryDescriptor(t);
Property p2 = getSecondaryDescriptor(t);
String pName = (String)item.get(p1.getName());
+
if ( !shouldCheckout(pName) ) {
return;
}
// VERBOSE MODE ONLY
- if (getVerbose())
- {
+ if (getVerbose()) {
// Show folder only if changed.
boolean bShowHeader = (f != prevFolder);
- if (bShowHeader)
- {
+
+ if (bShowHeader) {
// We want to display the folder the same way you would
// enter it on the command line ... so we remove the
// View name (which is also the name of the root folder,
// and therefore shows up at the start of the path).
String strFolder = f.getFolderHierarchy();
int i = strFolder.indexOf(delim);
- if (i >= 0)
- {
+
+ if (i >= 0) {
strFolder = strFolder.substring(i+1);
}
log(" Folder: \"" + strFolder + "\"");
@@ -588,9 +558,9 @@
// If we displayed the project, view, item type, or folder,
// then show the list of relevant item properties.
StringBuffer header = new StringBuffer("
Item");
+
header.append(",\t").append(p1.getDisplayName());
- if (p2 != null)
- {
+ if (p2 != null) {
header.append(",\t").append(p2.getDisplayName());
}
log(header.toString());
@@ -599,6 +569,7 @@
// Finally, show the Item properties ...
// Always show the ItemID.
StringBuffer itemLine = new StringBuffer(" ");
+
itemLine.append(item.getItemID());
// Show the primary descriptor.
@@ -607,19 +578,16 @@
// Show the secondary descriptor, if there is one.
// Some item types have one, some don't.
- if (p2 != null)
- {
+ if (p2 != null) {
itemLine.append(",\t").append(formatForDisplay(p2,
item.get(p2.getName())));
}
// Show if the file is locked.
int locker = item.getLocker();
- if (locker>-1)
- {
+
+ if (locker > -1) {
itemLine.append(",\tLocked by ").append(locker);
- }
- else
- {
+ } else {
itemLine.append(",\tNot locked");
}
log(itemLine.toString());
@@ -635,32 +603,34 @@
// been passed recursively down from the top of the tree, with the
item's name appended.
java.io.File local = new
java.io.File(tgt,(String)item.get(p1.getName()));
- try
- {
+ try {
remote.checkoutTo(local, Item.LockType.UNCHANGED, false, true,
true);
checkedOut++;
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new BuildException("Failed to checkout '" + local + "'",
e);
}
}
+
/**
- * Look if the file should be checked out. Don't check it out
- * if It fits no include filters and It fits an exclude filter.
+ * Look if the file should be checked out. Don't check it out if It fits
+ * no include filters and It fits an exclude filter.
+ *
* @param pName the item name to look for being included.
* @return whether the file should be checked out or not.
*/
protected boolean shouldCheckout(String pName){
boolean includeIt = matchPatterns(getIncludes(), pName);
boolean excludeIt = matchPatterns(getExcludes(), pName);
+
return (includeIt && !excludeIt);
}
+
/**
- * Convenient method to see if a string match a one pattern
- * in given set of space-separated patterns.
+ * Convenient method to see if a string match a one pattern in given set
+ * of space-separated patterns.
+ *
* @param patterns the space-separated list of patterns.
* @param pName the name to look for matching.
* @return whether the name match at least one pattern.
@@ -670,60 +640,59 @@
return false;
}
StringTokenizer exStr = new StringTokenizer(patterns, " ");
- while (exStr.hasMoreTokens())
- {
- if (DirectoryScanner.match(exStr.nextToken(), pName))
- {
+
+ while (exStr.hasMoreTokens()) {
+ if (DirectoryScanner.match(exStr.nextToken(), pName)) {
return true;
}
}
return false;
}
+
/**
- * Get the primary descriptor of the given item type.
- * Returns null if there isn't one.
- * In practice, all item types have a primary descriptor.
+ * Get the primary descriptor of the given item type. Returns null if
+ * there isn't one. In practice, all item types have a primary
descriptor.
*
* @param t An item type. At this point it will always be "file".
* @return The specified item's primary descriptor.
*/
- protected Property getPrimaryDescriptor(Type t)
- {
+ protected Property getPrimaryDescriptor(Type t) {
Property[] properties = t.getProperties();
- for (int i = 0; i < properties.length; i++)
- {
+
+ for (int i = 0; i < properties.length; i++) {
Property p = properties[i];
- if (p.isPrimaryDescriptor())
- {
+
+ if (p.isPrimaryDescriptor()) {
return p;
}
}
return null;
}
+
/**
- * Get the secondary descriptor of the given item type.
- * Returns null if there isn't one.
+ * Get the secondary descriptor of the given item type. Returns null if
+ * there isn't one.
*
* @param t An item type. At this point it will always be "file".
- * @return The specified item's secondary descriptor. There may not be
- * one for every file.
+ * @return The specified item's secondary descriptor. There may not be
one
+ * for every file.
*/
- protected Property getSecondaryDescriptor(Type t)
- {
+ protected Property getSecondaryDescriptor(Type t) {
Property[] properties = t.getProperties();
- for (int i = 0; i < properties.length; i++)
- {
+
+ for (int i = 0; i < properties.length; i++) {
Property p = properties[i];
- if (p.isDescriptor() && !p.isPrimaryDescriptor())
- {
+
+ if (p.isDescriptor() && !p.isPrimaryDescriptor()) {
return p;
}
}
return null;
}
+
/**
* Formats a property value for display to the user.
*
@@ -732,25 +701,18 @@
* @return A string containing the property, which is truncated to 35
* characters for display.
*/
- protected String formatForDisplay(Property p, Object value)
- {
- if (p.getTypeCode() == Property.Types.TEXT)
- {
+ protected String formatForDisplay(Property p, Object value) {
+ if (p.getTypeCode() == Property.Types.TEXT) {
String str = value.toString();
- if (str.length() > 35)
- {
+
+ if (str.length() > 35) {
str = str.substring(0, 32) + "...";
}
return "\"" + str + "\"";
- }
- else
- {
- if (p.getTypeCode() == Property.Types.ENUMERATED)
- {
+ } else {
+ if (p.getTypeCode() == Property.Types.ENUMERATED) {
return "\"" +
p.getEnumDisplayName(((Integer)value).intValue()) + "\"";
- }
- else
- {
+ } else {
return value.toString();
}
}
@@ -764,22 +726,22 @@
* @param serverName The name of the server you wish to connect to.
* @see #getServerName()
*/
- public void setServerName(String serverName)
- {
+ public void setServerName(String serverName) {
this.serverName = serverName;
}
+
/**
* Gets the <CODE>serverName</CODE> attribute.
*
* @return The StarTeam server to log in to.
* @see #setServerName(String serverName)
*/
- public String getServerName()
- {
+ public String getServerName() {
return serverName;
}
+
/**
* Sets the <CODE>serverPort</CODE> attribute to the given value. The
* given value must be a valid integer, but it must be a string object.
@@ -788,80 +750,79 @@
* to use.
* @see #getServerPort()
*/
- public void setServerPort(int serverPort)
- {
+ public void setServerPort(int serverPort) {
this.serverPort = serverPort;
}
+
/**
* Gets the <CODE>serverPort</CODE> attribute.
*
* @return A string containing the port on the StarTeam server to use.
* @see #setServerPort(int)
*/
- public int getServerPort()
- {
+ public int getServerPort() {
return serverPort;
}
+
/**
* Sets the <CODE>projectName</CODE> attribute to the given value.
*
- * @param projectName
- * The StarTeam project to search.
+ * @param projectName The StarTeam project to search.
* @see #getProjectName()
*/
- public void setProjectName(String projectName)
- {
+ public void setProjectName(String projectName) {
this.projectName = projectName;
}
+
/**
* Gets the <CODE>projectName</CODE> attribute.
*
* @return The StarTeam project to search.
* @see #setProjectName(String projectName)
*/
- public String getProjectName()
- {
+ public String getProjectName() {
return projectName;
}
+
/**
* Sets the <CODE>viewName</CODE> attribute to the given value.
*
* @param viewName The view to find the specified folder in.
* @see #getViewName()
*/
- public void setViewName(String viewName)
- {
+ public void setViewName(String viewName) {
this.viewName = viewName;
}
+
/**
* Gets the <CODE>viewName</CODE> attribute.
*
* @return The view to find the specified folder in.
* @see #setViewName(String viewName)
*/
- public String getViewName()
- {
+ public String getViewName() {
return viewName;
}
+
/**
* Sets the <CODE>folderName</CODE> attribute to the given value. To
- * search the root folder, use a slash or backslash, or simply don't set
- * a folder at all.
+ * search the root folder, use a slash or backslash, or simply don't set
a
+ * folder at all.
*
* @param folderName The subfolder from which to check out files.
* @see #getFolderName()
*/
- public void setFolderName(String folderName)
- {
+ public void setFolderName(String folderName) {
this.folderName = folderName;
}
+
/**
* Gets the <CODE>folderName</CODE> attribute.
*
@@ -869,186 +830,179 @@
* will be searched, as well.
* @see #setFolderName(String folderName)
*/
- public String getFolderName()
- {
+ public String getFolderName() {
return folderName;
}
+
/**
* Sets the <CODE>username</CODE> attribute to the given value.
*
* @param username Your username for the specified StarTeam server.
* @see #getUsername()
*/
- public void setUsername(String username)
- {
+ public void setUsername(String username) {
this.username = username;
}
+
/**
* Gets the <CODE>username</CODE> attribute.
*
* @return The username given by the user.
* @see #setUsername(String username)
*/
- public String getUsername()
- {
+ public String getUsername() {
return username;
}
+
/**
* Sets the <CODE>password</CODE> attribute to the given value.
*
* @param password Your password for the specified StarTeam server.
* @see #getPassword()
*/
- public void setPassword(String password)
- {
+ public void setPassword(String password) {
this.password = password;
}
+
/**
* Gets the <CODE>password</CODE> attribute.
*
* @return The password given by the user.
* @see #setPassword(String password)
*/
- public String getPassword()
- {
+ public String getPassword() {
return password;
}
+
/**
* Sets the <CODE>targetFolder</CODE> attribute to the given value.
*
* @param target The target path on the local machine to check out to.
* @see #getTargetFolder()
*/
- public void setTargetFolder(String targetFolder)
- {
+ public void setTargetFolder(String targetFolder) {
this.targetFolder = targetFolder;
}
+
/**
* Gets the <CODE>targetFolder</CODE> attribute.
*
* @return The target path on the local machine to check out to.
- *
* @see #setTargetFolder(String targetFolder)
*/
- public String getTargetFolder()
- {
+ public String getTargetFolder() {
return targetFolder;
}
+
/**
* Sets the <CODE>force</CODE> attribute to the given value.
*
- * @param force if true, it overwrites files in the target
- * directory. By default it set to false as a safeguard.
- * Note that if the target directory does not exist, this
- * setting has no effect.
+ * @param force if true, it overwrites files in the target directory. By
+ * default it set to false as a safeguard. Note that if the target
+ * directory does not exist, this setting has no effect.
* @see #getForce()
*/
- public void setForce(boolean force)
- {
+ public void setForce(boolean force) {
this.force = force;
}
+
/**
* Gets the <CODE>force</CODE> attribute.
*
* @return whether to continue if the target directory exists.
* @see #setForce(boolean)
*/
- public boolean getForce()
- {
+ public boolean getForce() {
return force;
}
+
/**
* Turns recursion on or off.
*
* @param recursion if it is true, the default, subfolders are searched
- * recursively for files to check out. Otherwise, only
- * files specified by <CODE>folderName</CODE> are scanned.
+ * recursively for files to check out. Otherwise, only files
+ * specified by <CODE>folderName</CODE> are scanned.
* @see #getRecursion()
*/
- public void setRecursion(boolean recursion)
- {
+ public void setRecursion(boolean recursion) {
this.recursion = recursion;
}
+
/**
* Gets the <CODE>recursion</CODE> attribute, which tells
* AntStarTeamCheckOut whether to search subfolders when checking out
* files.
*
* @return whether to search subfolders when checking out files.
- *
* @see #setRecursion(boolean)
*/
- public boolean getRecursion()
- {
+ public boolean getRecursion() {
return recursion;
}
+
/**
* Sets the <CODE>verbose</CODE> attribute to the given value.
*
- * @param verbose whether to display all files as it checks them out.
- * By default it is false, so the
- * program only displays the total number of files unless
- * you override this default.
+ * @param verbose whether to display all files as it checks them out. By
+ * default it is false, so the program only displays the total
number
+ * of files unless you override this default.
* @see #getVerbose()
*/
- public void setVerbose(boolean verbose)
- {
+ public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
+
/**
* Gets the <CODE>verbose</CODE> attribute.
*
* @return whether to display all files as it checks them out.
* @see #setVerbose(boolean verbose)
*/
- public boolean getVerbose()
- {
+ public boolean getVerbose() {
return verbose;
}
// Begin filter getters and setters
/**
- * Sets the include filter. When filtering files, AntStarTeamCheckOut
- * uses an unmodified version of <CODE>DirectoryScanner</CODE>'s
- * <CODE>match</CODE> method, so here are the patterns straight from the
- * Ant source code:
- * <BR><BR>
+ * Sets the include filter. When filtering files, AntStarTeamCheckOut
uses
+ * an unmodified version of <CODE>DirectoryScanner</CODE>'s
<CODE>match</CODE>
+ * method, so here are the patterns straight from the Ant source code:
+ * <BR>
+ * <BR>
* Matches a string against a pattern. The pattern contains two special
- * characters:
- * <BR>'*' which means zero or more characters,
- * <BR>'?' which means one and only one character.
- * <BR><BR>
+ * characters: <BR>
+ * '*' which means zero or more characters, <BR>
+ * '?' which means one and only one character. <BR>
+ * <BR>
* Separate multiple inlcude filters by <I>spaces</I>, not commas as Ant
* uses. For example, if you want to check out all .java and .class\
- * files, you would put the following line in your program:
- * <CODE>setIncludes("*.java *.class");</CODE>
+ * files, you would put the following line in your program:
<CODE>setIncludes("*.java *.class");</CODE>
* Finally, note that filters have no effect on the <B>directories</B>
* that are scanned; you could not check out files from directories with
- * names beginning only with "build," for instance. Of course, you
- * could limit AntStarTeamCheckOut to a particular folder and its
- * subfolders with the <CODE>setFolderName(String folderName)</CODE>
- * command.
- * <BR><BR>
+ * names beginning only with "build," for instance. Of course, you could
+ * limit AntStarTeamCheckOut to a particular folder and its subfolders
+ * with the <CODE>setFolderName(String folderName)</CODE> command. <BR>
+ * <BR>
* Treatment of overlapping inlcudes and excludes: To give a simplistic
- * example suppose that you set your include filter to "*.htm *.html"
- * and your exclude filter to "index.*". What happens to index.html?
+ * example suppose that you set your include filter to "*.htm *.html" and
+ * your exclude filter to "index.*". What happens to index.html?
* AntStarTeamCheckOut will not check out index.html, as it matches an
- * exclude filter ("index.*"), even though it matches the include
- * filter, as well.
- * <BR><BR>
+ * exclude filter ("index.*"), even though it matches the include filter,
+ * as well. <BR>
+ * <BR>
* Please also read the following sections before using filters:
*
* @param includes A string of filter patterns to include. Separate the
@@ -1057,52 +1011,50 @@
* @see #setExcludes(String excludes)
* @see #getExcludes()
*/
- public void setIncludes(String includes)
- {
+ public void setIncludes(String includes) {
this.includes = includes;
}
+
/**
* Gets the patterns from the include filter. Rather that duplicate the
- * details of AntStarTeanCheckOut's filtering here, refer to these
- * links:
+ * details of AntStarTeanCheckOut's filtering here, refer to these links:
*
* @return A string of filter patterns separated by spaces.
* @see #setIncludes(String includes)
* @see #setExcludes(String excludes)
* @see #getExcludes()
*/
- public String getIncludes()
- {
+ public String getIncludes() {
return includes;
}
+
/**
- * Sets the exclude filter. When filtering files, AntStarTeamCheckOut
- * uses an unmodified version of <CODE>DirectoryScanner</CODE>'s
- * <CODE>match</CODE> method, so here are the patterns straight from the
- * Ant source code:
- * <BR><BR>
+ * Sets the exclude filter. When filtering files, AntStarTeamCheckOut
uses
+ * an unmodified version of <CODE>DirectoryScanner</CODE>'s
<CODE>match</CODE>
+ * method, so here are the patterns straight from the Ant source code:
+ * <BR>
+ * <BR>
* Matches a string against a pattern. The pattern contains two special
- * characters:
- * <BR>'*' which means zero or more characters,
- * <BR>'?' which means one and only one character.
- * <BR><BR>
+ * characters: <BR>
+ * '*' which means zero or more characters, <BR>
+ * '?' which means one and only one character. <BR>
+ * <BR>
* Separate multiple exlcude filters by <I>spaces</I>, not commas as Ant
* uses. For example, if you want to check out all files except .XML and
- * .HTML files, you would put the following line in your program:
- * <CODE>setExcludes("*.XML *.HTML");</CODE>
+ * .HTML files, you would put the following line in your program:
<CODE>setExcludes("*.XML *.HTML");</CODE>
* Finally, note that filters have no effect on the <B>directories</B>
* that are scanned; you could not skip over all files in directories
- * whose names begin with "project," for instance.
- * <BR><BR>
+ * whose names begin with "project," for instance. <BR>
+ * <BR>
* Treatment of overlapping inlcudes and excludes: To give a simplistic
- * example suppose that you set your include filter to "*.htm *.html"
- * and your exclude filter to "index.*". What happens to index.html?
+ * example suppose that you set your include filter to "*.htm *.html" and
+ * your exclude filter to "index.*". What happens to index.html?
* AntStarTeamCheckOut will not check out index.html, as it matches an
- * exclude filter ("index.*"), even though it matches the include
- * filter, as well.
- * <BR><BR>
+ * exclude filter ("index.*"), even though it matches the include filter,
+ * as well. <BR>
+ * <BR>
* Please also read the following sections before using filters:
*
* @param excludes A string of filter patterns to exclude. Separate the
@@ -1111,52 +1063,52 @@
* @see #getIncludes()
* @see #getExcludes()
*/
- public void setExcludes(String excludes)
- {
+ public void setExcludes(String excludes) {
this.excludes = excludes;
}
+
/**
* Gets the patterns from the exclude filter. Rather that duplicate the
- * details of AntStarTeanCheckOut's filtering here, refer to these
- * links:
+ * details of AntStarTeanCheckOut's filtering here, refer to these links:
*
* @return A string of filter patterns separated by spaces.
* @see #setExcludes(String excludes)
* @see #setIncludes(String includes)
* @see #getIncludes()
*/
- public String getExcludes()
- {
+ public String getExcludes() {
return excludes;
}
/**
- * returns whether the StarTeam default path is factored into
- * calculated target path locations (false) or whether
- * targetFolder is an absolute mapping to the root folder
- * named by folderName
+ * returns whether the StarTeam default path is factored into calculated
+ * target path locations (false) or whether targetFolder is an absolute
+ * mapping to the root folder named by folderName
*
- * @return returns true if absolute mapping is used, false if it is
- * not used.
+ * @return returns true if absolute mapping is used, false if it is not
+ * used.
* @see #setTargetFolderAbsolute(boolean)
*/
- public boolean getTargetFolderAbsolute()
- {
+ public boolean getTargetFolderAbsolute() {
return this.targetFolderAbsolute;
}
+
+
/**
- * sets the property that indicates whether or not the Star Team
- * "default folder" is to be used when calculation paths for items on
- * the target (false) or if targetFolder is an absolute mapping to the
- * root folder named by foldername.
- *
- * @param targetFolderAbsolute <tt>true</tt> if the absolute mapping is
to be used.
- * <tt>false</tt> (the default) if the "default folder" is
to be factored in.
+ * sets the property that indicates whether or not the Star Team "default
+ * folder" is to be used when calculation paths for items on the target
+ * (false) or if targetFolder is an absolute mapping to the root folder
+ * named by foldername.
+ *
+ * @param targetFolderAbsolute <tt>true</tt> if the absolute mapping is
to
+ * be used. <tt>false</tt> (the default) if the "default folder" is
+ * to be factored in.
* @see #getTargetFolderAbsolute()
*/
public void setTargetFolderAbsolute(boolean targetFolderAbsolute) {
this.targetFolderAbsolute = targetFolderAbsolute;
}
}
+
1.8 +4 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
Index: AntSoundPlayer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- AntSoundPlayer.java 26 Jan 2002 20:38:13 -0000 1.7
+++ AntSoundPlayer.java 15 Apr 2002 12:11:49 -0000 1.8
@@ -87,7 +87,7 @@
* I have only tested this with .WAV and .AIFF sound file formats. Both seem
to work fine.
*
* @author Nick Pellow
- * @version $Revision: 1.7 $, $Date: 2002/01/26 20:38:13 $
+ * @version $Revision: 1.8 $, $Date: 2002/04/15 12:11:49 $
*/
public class AntSoundPlayer implements LineListener, BuildListener {
@@ -141,7 +141,8 @@
audioInputStream = AudioSystem.getAudioInputStream(file);
}
catch (UnsupportedAudioFileException uafe) {
- project.log("Audio format is not yet supported:
"+uafe.getMessage());
+ project.log("Audio format is not yet supported: "
+ + uafe.getMessage());
}
catch (IOException ioe) {
ioe.printStackTrace();
1.7 +8 -8
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java
Index: SoundTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- SoundTask.java 10 Jan 2002 13:59:39 -0000 1.6
+++ SoundTask.java 15 Apr 2002 12:11:49 -0000 1.7
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -79,7 +79,7 @@
* Ant play them back
*
* @author Nick Pellow
- * @version $Revision: 1.6 $, $Date: 2002/01/10 13:59:39 $
+ * @version $Revision: 1.7 $, $Date: 2002/04/15 12:11:49 $
*/
public class SoundTask extends Task {
1.3 +9 -9
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashScreen.java
Index: SplashScreen.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashScreen.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
1.3 +13 -11
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
Index: SplashTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- SplashTask.java 10 Apr 2002 00:19:55 -0000 1.2
+++ SplashTask.java 15 Apr 2002 12:11:49 -0000 1.3
@@ -151,8 +151,10 @@
// in the event of a problem etc
} catch(Throwable ioe) {
- log("Unable to download image, trying default Ant Logo",
Project.MSG_DEBUG);
- log("(Exception was \""+ioe.getMessage()+"\"",
Project.MSG_DEBUG);
+ log("Unable to download image, trying default Ant Logo",
+ Project.MSG_DEBUG);
+ log("(Exception was \"" + ioe.getMessage() + "\"",
+ Project.MSG_DEBUG);
}
}
1.6 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamTask.java
Index: StarTeamTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamTask.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
1.18 +7 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
Index: MSVSS.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -u -r1.17 -r1.18
1.4 +10 -10
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSADD.java
Index: MSVSSADD.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSADD.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
1.8 +15 -13
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java
Index: MSVSSCHECKIN.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- MSVSSCHECKIN.java 3 Mar 2002 01:46:23 -0000 1.7
+++ MSVSSCHECKIN.java 15 Apr 2002 12:11:49 -0000 1.8
@@ -142,14 +142,16 @@
if (!dir.exists()) {
boolean done = dir.mkdirs();
if (!done) {
- String msg = "Directory " + m_LocalPath + " creation was
not " +
- "succesful for an unknown reason";
+ String msg = "Directory " + m_LocalPath
+ + " creation was not "
+ + "succesful for an unknown reason";
throw new BuildException(msg, location);
}
project.log("Created dir: " + dir.getAbsolutePath());
}
- cmd.createArgument().setValue(FLAG_OVERRIDE_WORKING_DIR +
m_LocalPath);
+ cmd.createArgument().setValue(FLAG_OVERRIDE_WORKING_DIR
+ + m_LocalPath);
}
}
1.8 +12 -12
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java
Index: MSVSSCHECKOUT.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
1.3 +6 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCP.java
Index: MSVSSCP.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCP.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
1.3 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCREATE.java
Index: MSVSSCREATE.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCREATE.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
1.17 +14 -15
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java
Index: MSVSSGET.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -u -r1.16 -r1.17
--- MSVSSGET.java 3 Mar 2002 01:46:23 -0000 1.16
+++ MSVSSGET.java 15 Apr 2002 12:11:49 -0000 1.17
@@ -360,6 +360,5 @@
} // end of else
}
-
}
1.8 +18 -18
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSHISTORY.java
Index: MSVSSHISTORY.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSHISTORY.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- MSVSSHISTORY.java 3 Mar 2002 01:46:23 -0000 1.7
+++ MSVSSHISTORY.java 15 Apr 2002 12:11:49 -0000 1.8
@@ -233,12 +233,14 @@
* @param cmd the commandline the command is to be added to
*/
private void getVersionDateCommand(Commandline cmd) throws
BuildException {
- if ( m_FromDate == null && m_ToDate == null && m_NumDays ==
Integer.MIN_VALUE) {
+ if (m_FromDate == null && m_ToDate == null
+ && m_NumDays == Integer.MIN_VALUE) {
return;
}
if ( m_FromDate != null && m_ToDate != null) {
- cmd.createArgument().setValue(FLAG_VERSION_DATE + m_ToDate +
VALUE_FROMDATE + m_FromDate);
+ cmd.createArgument().setValue(FLAG_VERSION_DATE + m_ToDate
+ + VALUE_FROMDATE + m_FromDate);
} else if (m_ToDate != null && m_NumDays != Integer.MIN_VALUE) {
String startDate = null;
try {
@@ -376,6 +378,4 @@
return new String[] {"brief", "codediff", "nofile", "default"};
}
}
-
-
}
1.9 +12 -13
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java
Index: MSVSSLABEL.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- MSVSSLABEL.java 3 Mar 2002 01:46:23 -0000 1.8
+++ MSVSSLABEL.java 15 Apr 2002 12:11:49 -0000 1.9
@@ -284,6 +284,5 @@
}else {
cmd.createArgument().setValue(FLAG_AUTORESPONSE_DEF);
} // end of else
-
}
}
1.16 +18 -19
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
Index: DefaultRmicAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -u -r1.15 -r1.16
--- DefaultRmicAdapter.java 12 Apr 2002 11:44:31 -0000 1.15
+++ DefaultRmicAdapter.java 15 Apr 2002 12:11:50 -0000 1.16
@@ -413,5 +413,4 @@
return target;
}
}
-
}
1.8 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
Index: KaffeRmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
1.7 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapter.java
Index: RmicAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapter.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
1.6 +12 -12
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java
Index: RmicAdapterFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
1.6 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
Index: SunRmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
1.10 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
Index: WLRmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
1.4 +6 -6
jakarta-ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
Index: AbstractFileSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
1.20 +16 -16
jakarta-ant/src/main/org/apache/tools/ant/types/Commandline.java
Index: Commandline.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Commandline.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -u -r1.19 -r1.20
1.33 +6 -4
jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java
Index: CommandlineJava.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -w -u -r1.32 -r1.33
--- CommandlineJava.java 10 Apr 2002 00:19:55 -0000 1.32
+++ CommandlineJava.java 15 Apr 2002 12:11:50 -0000 1.33
@@ -144,7 +144,9 @@
SysProperties c = (SysProperties) super.clone();
c.variables = (Vector) variables.clone();
return c;
- } catch(CloneNotSupportedException e){return null;}
+ } catch (CloneNotSupportedException e) {
+ return null;
+ }
}
}
1.7 +10 -8
jakarta-ant/src/main/org/apache/tools/ant/types/DataType.java
Index: DataType.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/DataType.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- DataType.java 10 Jan 2002 11:21:20 -0000 1.6
+++ DataType.java 15 Apr 2002 12:11:50 -0000 1.7
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -187,8 +187,8 @@
* only attribute if it is set.
*/
protected BuildException tooManyAttributes() {
- return new BuildException( "You must not specify more than one
attribute" +
- " when using refid" );
+ return new BuildException("You must not specify more than one "
+ + "attribute when using refid");
}
/**
@@ -196,7 +196,8 @@
* not have child elements if the refid attribute is set.
*/
protected BuildException noChildrenAllowed() {
- return new BuildException("You must not specify nested elements when
using refid");
+ return new BuildException("You must not specify nested elements "
+ + "when using refid");
}
/**
@@ -204,6 +205,7 @@
* loop of data types referencing each other.
*/
protected BuildException circularReference() {
- return new BuildException("This data type contains a circular
reference.");
+ return new BuildException("This data type contains a circular "
+ + "reference.");
}
}
1.7 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/types/Environment.java
Index: Environment.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Environment.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- Environment.java 23 May 2001 16:58:12 -0000 1.6
+++ Environment.java 15 Apr 2002 12:11:50 -0000 1.7
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000,2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.6 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/types/FileList.java
Index: FileList.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FileList.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- FileList.java 12 Apr 2002 13:26:53 -0000 1.5
+++ FileList.java 15 Apr 2002 12:11:50 -0000 1.6
@@ -72,7 +72,7 @@
* exists in the file system.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Craeg Strong</a>
- * @version $Revision: 1.5 $ $Date: 2002/04/12 13:26:53 $
+ * @version $Revision: 1.6 $ $Date: 2002/04/15 12:11:50 $
*/
public class FileList extends DataType {
1.11 +21 -15
jakarta-ant/src/main/org/apache/tools/ant/types/FilterSet.java
Index: FilterSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FilterSet.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- FilterSet.java 25 Feb 2002 15:33:19 -0000 1.10
+++ FilterSet.java 15 Apr 2002 12:11:50 -0000 1.11
@@ -308,7 +308,8 @@
}
}
catch (Exception e) {
- throw new BuildException( "Could not read filters from file: "
+ filtersFile );
+ throw new BuildException("Could not read filters from file: "
+ + filtersFile);
}
finally {
if ( in != null ) {
@@ -321,7 +322,8 @@
}
}
else {
- throw new BuildException( "Must specify a file not a directory in
the filtersfile attribute:" + filtersFile );
+ throw new BuildException("Must specify a file not a directory in
"
+ + "the filtersfile attribute:" + filtersFile);
}
}
@@ -346,17 +348,21 @@
String value = null;
do {
- int endIndex = line.indexOf(endToken, index +
beginToken.length() + 1 );
+ int endIndex = line.indexOf(endToken,
+ index + beginToken.length() + 1);
if (endIndex == -1) {
break;
}
- token = line.substring(index + beginToken.length(),
endIndex );
+ token
+ = line.substring(index + beginToken.length(),
endIndex);
b.append(line.substring(i, index));
if (tokens.containsKey(token)) {
value = (String)tokens.get(token);
- log( "Replacing: " + beginToken + token + endToken +
" -> " + value, Project.MSG_VERBOSE );
+ log("Replacing: " + beginToken + token + endToken
+ + " -> " + value, Project.MSG_VERBOSE);
b.append(value);
- i = index + beginToken.length() + token.length() +
endToken.length();
+ i = index + beginToken.length() + token.length()
+ + endToken.length();
}
else {
// just append beginToken and search further
1.8 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/types/FilterSetCollection.java
Index: FilterSetCollection.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FilterSetCollection.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
1.10 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/types/Mapper.java
Index: Mapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Mapper.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- Mapper.java 10 Jan 2002 11:21:20 -0000 1.9
+++ Mapper.java 15 Apr 2002 12:11:50 -0000 1.10
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.34 +21 -18 jakarta-ant/src/main/org/apache/tools/ant/types/Path.java
Index: Path.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Path.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -w -u -r1.33 -r1.34
--- Path.java 3 Apr 2002 11:24:54 -0000 1.33
+++ Path.java 15 Apr 2002 12:11:50 -0000 1.34
@@ -305,7 +305,8 @@
} else if (o instanceof PathElement) {
String[] parts = ((PathElement) o).getParts();
if (parts == null) {
- throw new BuildException("You must either set location
or path on <pathelement>");
+ throw new BuildException("You must either set location
or"
+ + " path on <pathelement>");
}
for (int j=0; j<parts.length; j++) {
addUnlessPresent(result, parts[j]);
@@ -385,7 +386,8 @@
element.append(resolveFile(project, pathElement));
}
catch (BuildException e) {
- project.log("Dropping path element " + pathElement + " as it
is not valid relative to the project",
+ project.log("Dropping path element " + pathElement
+ + " as it is not valid relative to the project",
Project.MSG_VERBOSE);
}
for (int i=0; i<element.length(); i++) {
@@ -571,7 +573,8 @@
if
(System.getProperty("java.vendor").toLowerCase(Locale.US).indexOf("microsoft")
>= 0) {
// Pull in *.zip from packages directory
FileSet msZipFiles = new FileSet();
- msZipFiles.setDir(new File(System.getProperty("java.home") +
File.separator + "Packages"));
+ msZipFiles.setDir(new File(System.getProperty("java.home")
+ + File.separator + "Packages"));
msZipFiles.setIncludes("*.ZIP");
addFileset(msZipFiles);
} else if("Kaffe".equals(System.getProperty("java.vm.name"))) {
1.23 +11 -11
jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java
Index: PatternSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -u -r1.22 -r1.23
1.10 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/types/Reference.java
Index: Reference.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Reference.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
1.9 +2 -1
jakarta-ant/src/main/org/apache/tools/ant/types/RegularExpression.java
Index: RegularExpression.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/RegularExpression.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- RegularExpression.java 12 Apr 2002 13:26:53 -0000 1.8
+++ RegularExpression.java 15 Apr 2002 12:11:50 -0000 1.9
@@ -153,7 +153,8 @@
Object o = ref.getReferencedObject(p);
if (!(o instanceof RegularExpression))
{
- String msg = ref.getRefId() + " doesn\'t denote a
"+DATA_TYPE_NAME;
+ String msg = ref.getRefId() + " doesn\'t denote a "
+ + DATA_TYPE_NAME;
throw new BuildException(msg);
}
else
1.6 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/types/XMLCatalog.java
Index: XMLCatalog.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/XMLCatalog.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- XMLCatalog.java 4 Apr 2002 13:53:13 -0000 1.5
+++ XMLCatalog.java 15 Apr 2002 12:11:50 -0000 1.6
@@ -91,7 +91,7 @@
* elements, or use Norman Walsh's entity resolver from xml-commons</p>
*
* @author dIon Gillard
- * @version $Id: XMLCatalog.java,v 1.5 2002/04/04 13:53:13 conor Exp $
+ * @version $Id: XMLCatalog.java,v 1.6 2002/04/15 12:11:50 conor Exp $
*/
public class XMLCatalog extends DataType implements Cloneable,
EntityResolver {
/** File utilities instance */
1.8 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/types/ZipFileSet.java
Index: ZipFileSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/ZipFileSet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
1.10 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java
Index: ClassfileSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
1.11 +4 -4
jakarta-ant/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java
Index: DependScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
1.11 +10 -9
jakarta-ant/src/main/org/apache/tools/ant/util/DOMElementWriter.java
Index: DOMElementWriter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/DOMElementWriter.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- DOMElementWriter.java 9 Apr 2002 12:13:25 -0000 1.10
+++ DOMElementWriter.java 15 Apr 2002 12:11:51 -0000 1.11
@@ -296,7 +296,8 @@
* Is the given character allowed inside an XML document?
*
* <p>See XML 1.0 2.2 <a
- *
href="http://www.w3.org/TR/1998/REC-xml-19980210#charsets">http://www.w3.org/TR/1998/REC-xml-19980210#charsets</a>.</p>
+ * href="http://www.w3.org/TR/1998/REC-xml-19980210#charsets">
+ * http://www.w3.org/TR/1998/REC-xml-19980210#charsets</a>.</p>
*
* @since 1.10, Ant 1.5
*/
1.3 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/util/DateUtils.java
Index: DateUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/DateUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- DateUtils.java 19 Feb 2002 07:51:12 -0000 1.2
+++ DateUtils.java 15 Apr 2002 12:11:51 -0000 1.3
@@ -71,7 +71,7 @@
*
* @since Ant 1.5
*
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class DateUtils {
1.22 +17 -25
jakarta-ant/src/main/org/apache/tools/ant/util/FileUtils.java
Index: FileUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/FileUtils.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -w -u -r1.21 -r1.22
--- FileUtils.java 2 Apr 2002 08:42:44 -0000 1.21
+++ FileUtils.java 15 Apr 2002 12:11:51 -0000 1.22
@@ -95,7 +95,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jeff Tulley</a>
*
- * @version $Revision: 1.21 $
+ * @version $Revision: 1.22 $
*/
public class FileUtils {
@@ -489,13 +489,10 @@
// deal with absolute files
if (!onNetWare) {
- if (filename.startsWith(File.separator) ||
-
- (filename.length() >= 2 &&
- Character.isLetter(filename.charAt(0)) &&
- filename.charAt(1) == ':')
-
- ) {
+ if (filename.startsWith(File.separator)
+ || (filename.length() >= 2
+ && Character.isLetter(filename.charAt(0))
+ && filename.charAt(1) == ':')) {
return normalize(filename);
}
} else {
@@ -503,9 +500,8 @@
// the path name breaks down when NetWare is a supported
platform.
// Netware volumes are of the pattern: "data:\"
int colon = filename.indexOf(":");
- if (filename.startsWith(File.separator) ||
- (colon > -1)
- ) {
+ if (filename.startsWith(File.separator)
+ || (colon > -1)) {
return normalize(filename);
}
}
@@ -564,15 +560,13 @@
if (!path.startsWith(File.separator) &&
! (path.length() >= 2 &&
Character.isLetter(path.charAt(0)) &&
- colon == 1)
- ) {
+ colon == 1)) {
String msg = path + " is not an absolute path";
throw new BuildException(msg);
}
} else {
- if (!path.startsWith(File.separator) &&
- (colon == -1)
- ) {
+ if (!path.startsWith(File.separator)
+ && (colon == -1)) {
String msg = path + " is not an absolute path";
throw new BuildException(msg);
}
@@ -585,8 +579,7 @@
path.length() >= 2 &&
Character.isLetter(path.charAt(0)) &&
path.charAt(1) == ':') ||
- (onNetWare && colon > -1)
- ) {
+ (onNetWare && colon > -1)) {
dosWithDrive = true;
@@ -605,8 +598,7 @@
StringBuffer sbPath = new StringBuffer();
for (int i = colon+1; i < ca.length; i++) {
if ((ca[i] != '\\') ||
- (ca[i] == '\\' && ca[i - 1] != '\\')
- ) {
+ (ca[i] == '\\' && ca[i - 1] != '\\')) {
sbPath.append(ca[i]);
}
}
1.3 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/util/GlobPatternMapper.java
Index: GlobPatternMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/GlobPatternMapper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- GlobPatternMapper.java 3 Jan 2001 14:18:47 -0000 1.2
+++ GlobPatternMapper.java 15 Apr 2002 12:11:51 -0000 1.3
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000,2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.4 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/util/LoaderUtils.java
Index: LoaderUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/LoaderUtils.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
1.5 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java
Index: RegexpPatternMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- RegexpPatternMapper.java 28 Oct 2001 21:27:20 -0000 1.4
+++ RegexpPatternMapper.java 15 Apr 2002 12:11:51 -0000 1.5
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000,2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.13 +11 -11
jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java
Index: SourceFileScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -u -r1.12 -r1.13
--- SourceFileScanner.java 10 Jan 2002 11:21:21 -0000 1.12
+++ SourceFileScanner.java 15 Apr 2002 12:11:51 -0000 1.13
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -137,13 +137,13 @@
File dest = fileUtils.resolveFile(destDir, targets[j]);
if (!dest.exists()) {
- task.log(files[i]+" added as "+dest.getAbsolutePath()+"
doesn\'t exist.",
- Project.MSG_VERBOSE);
+ task.log(files[i] + " added as " + dest.getAbsolutePath()
+ + " doesn\'t exist.", Project.MSG_VERBOSE);
v.addElement(files[i]);
added = true;
} else if (src.lastModified() > dest.lastModified()) {
- task.log(files[i]+" added as "+dest.getAbsolutePath()+"
is outdated.",
- Project.MSG_VERBOSE);
+ task.log(files[i] + " added as " + dest.getAbsolutePath()
+ + " is outdated.", Project.MSG_VERBOSE);
v.addElement(files[i]);
added = true;
} else {
1.3 +8 -8
jakarta-ant/src/main/org/apache/tools/ant/util/StringUtils.java
Index: StringUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/StringUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- StringUtils.java 29 Dec 2001 20:21:34 -0000 1.2
+++ StringUtils.java 15 Apr 2002 12:11:51 -0000 1.3
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.5 +8 -8
jakarta-ant/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java
Index: AncestorAnalyzer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
1.5 +9 -10
jakarta-ant/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java
Index: FullAnalyzer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- FullAnalyzer.java 5 Apr 2002 15:57:33 -0000 1.4
+++ FullAnalyzer.java 15 Apr 2002 12:11:51 -0000 1.5
@@ -159,6 +159,5 @@
protected boolean supportsFileDependencies() {
return true;
}
-
}
1.7 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
Index: JakartaOroMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
1.6 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java
Index: JakartaOroRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
1.9 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java
Index: JakartaRegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
1.7 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java
Index: JakartaRegexpRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
1.8 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java
Index: Jdk14RegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
1.8 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java
Index: Jdk14RegexpRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
1.9 +61 -61
jakarta-ant/src/main/org/apache/tools/bzip2/CBZip2InputStream.java
Index: CBZip2InputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/bzip2/CBZip2InputStream.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- CBZip2InputStream.java 26 Jan 2002 20:05:34 -0000 1.8
+++ CBZip2InputStream.java 15 Apr 2002 12:11:51 -0000 1.9
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.10 +113 -113
jakarta-ant/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java
Index: CBZip2OutputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- CBZip2OutputStream.java 26 Jan 2002 20:05:34 -0000 1.9
+++ CBZip2OutputStream.java 15 Apr 2002 12:11:51 -0000 1.10
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.4 +2 -2 jakarta-ant/src/main/org/apache/tools/bzip2/CRC.java
Index: CRC.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/bzip2/CRC.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- CRC.java 10 Jan 2002 10:40:47 -0000 1.3
+++ CRC.java 15 Apr 2002 12:11:52 -0000 1.4
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.11 +3 -3 jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java
Index: TarEntry.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- TarEntry.java 10 Jan 2002 10:40:48 -0000 1.10
+++ TarEntry.java 15 Apr 2002 12:11:52 -0000 1.11
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.2 +10 -10
jakarta-ant/src/main/org/apache/tools/zip/AsiExtraField.java
Index: AsiExtraField.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/zip/AsiExtraField.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
--- AsiExtraField.java 23 Apr 2001 16:12:19 -0000 1.1
+++ AsiExtraField.java 15 Apr 2002 12:11:52 -0000 1.2
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -82,7 +82,7 @@
* word order, device numbers are currently not supported.</p>
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class AsiExtraField implements ZipExtraField, UnixStat, Cloneable {
1.2 +23 -21
jakarta-ant/src/main/org/apache/tools/zip/ExtraFieldUtils.java
Index: ExtraFieldUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/zip/ExtraFieldUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
--- ExtraFieldUtils.java 23 Apr 2001 16:12:20 -0000 1.1
+++ ExtraFieldUtils.java 15 Apr 2002 12:11:52 -0000 1.2
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,7 +62,7 @@
* ZipExtraField related methods
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ExtraFieldUtils {
@@ -131,7 +131,8 @@
ZipShort headerId = new ZipShort(data, start);
int length = (new ZipShort(data, start+2)).getValue();
if (start+4+length > data.length) {
- throw new ZipException("data starting at "+start+" is in
unknown format");
+ throw new ZipException("data starting at " + start
+ + " is in unknown format");
}
try {
ZipExtraField ze = createExtraField(headerId);
@@ -145,7 +146,8 @@
start += (length+4);
}
if (start != data.length) { // array not exhausted
- throw new ZipException("data starting at "+start+" is in unknown
format");
+ throw new ZipException("data starting at " + start
+ + " is in unknown format");
}
ZipExtraField[] result = new ZipExtraField[v.size()];
1.2 +8 -4
jakarta-ant/src/main/org/apache/tools/zip/UnrecognizedExtraField.java
Index: UnrecognizedExtraField.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/zip/UnrecognizedExtraField.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
--- UnrecognizedExtraField.java 23 Apr 2001 16:12:21 -0000 1.1
+++ UnrecognizedExtraField.java 15 Apr 2002 12:11:52 -0000 1.2
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,7 +62,7 @@
* identical - unless told the opposite.</p>
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class UnrecognizedExtraField implements ZipExtraField {
@@ -77,7 +77,9 @@
this.headerId = headerId;
}
- public ZipShort getHeaderId() {return headerId;}
+ public ZipShort getHeaderId() {
+ return headerId;
+ }
/**
* Extra field data in local file data - without
@@ -95,7 +97,9 @@
return new ZipShort(localData.length);
}
- public byte[] getLocalFileDataData() {return localData;}
+ public byte[] getLocalFileDataData() {
+ return localData;
+ }
/**
* Extra field data in central directory - without
1.3 +5 -5 jakarta-ant/src/main/org/apache/tools/zip/ZipEntry.java
Index: ZipEntry.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/zip/ZipEntry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- ZipEntry.java 24 Apr 2001 08:41:58 -0000 1.2
+++ ZipEntry.java 15 Apr 2002 12:11:52 -0000 1.3
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,7 @@
* access to the internal and external file attributes.
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class ZipEntry extends java.util.zip.ZipEntry {
1.2 +5 -5 jakarta-ant/src/main/org/apache/tools/zip/ZipLong.java
Index: ZipLong.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/zip/ZipLong.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
--- ZipLong.java 23 Apr 2001 16:12:22 -0000 1.1
+++ ZipLong.java 15 Apr 2002 12:11:52 -0000 1.2
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -59,7 +59,7 @@
* rules for the big endian byte order of ZIP files.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ZipLong implements Cloneable {
1.6 +8 -6
jakarta-ant/src/main/org/apache/tools/zip/ZipOutputStream.java
Index: ZipOutputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/zip/ZipOutputStream.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- ZipOutputStream.java 8 Feb 2002 14:17:24 -0000 1.5
+++ ZipOutputStream.java 15 Apr 2002 12:11:52 -0000 1.6
@@ -80,7 +80,7 @@
* will be called.</p>
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class ZipOutputStream extends DeflaterOutputStream {
@@ -237,7 +237,9 @@
*
* @since 1.3
*/
- public String getEncoding() {return encoding;}
+ public String getEncoding() {
+ return encoding;
+ }
/*
* Found out by experiment, that DeflaterOutputStream.close()
1.2 +3 -3 jakarta-ant/src/main/org/apache/tools/zip/ZipShort.java
Index: ZipShort.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/zip/ZipShort.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
--- ZipShort.java 23 Apr 2001 16:12:22 -0000 1.1
+++ ZipShort.java 15 Apr 2002 12:11:52 -0000 1.2
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -59,7 +59,7 @@
* rules for the big endian byte order of ZIP files.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ZipShort implements Cloneable {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>