Browse Source

javadoc

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277897 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
ae1fc52171
5 changed files with 68 additions and 9 deletions
  1. +21
    -1
      src/main/org/apache/tools/ant/taskdefs/Copydir.java
  2. +24
    -1
      src/main/org/apache/tools/ant/taskdefs/Copyfile.java
  3. +6
    -3
      src/main/org/apache/tools/ant/taskdefs/Dirname.java
  4. +14
    -1
      src/main/org/apache/tools/ant/taskdefs/Ear.java
  5. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Echo.java

+ 21
- 1
src/main/org/apache/tools/ant/taskdefs/Copydir.java View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2000,2002-2004 The Apache Software Foundation
* Copyright 2000,2002-2005 The Apache Software Foundation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -60,18 +60,38 @@ public class Copydir extends MatchingTask {
destDir = dest; destDir = dest;
} }


/**
* The filtering attribute.
* Default is false.
* @param filter if true use filtering
*/
public void setFiltering(boolean filter) { public void setFiltering(boolean filter) {
filtering = filter; filtering = filter;
} }


/**
* The flattening attribute.
* Default is false.
* @param flatten if true use flattening
*/
public void setFlatten(boolean flatten) { public void setFlatten(boolean flatten) {
this.flatten = flatten; this.flatten = flatten;
} }


/**
* The forceoverwrite attribute.
* Default is false.
* @param force if true overwrite even if the destination file
* is newer that the source file
*/
public void setForceoverwrite(boolean force) { public void setForceoverwrite(boolean force) {
forceOverwrite = force; forceOverwrite = force;
} }


/**
* Execute the task.
* @throws BuildException on error
*/
public void execute() throws BuildException { public void execute() throws BuildException {
log("DEPRECATED - The copydir task is deprecated. Use copy instead."); log("DEPRECATED - The copydir task is deprecated. Use copy instead.");




+ 24
- 1
src/main/org/apache/tools/ant/taskdefs/Copyfile.java View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2000,2002,2004 The Apache Software Foundation
* Copyright 2000,2002,2004-2005 The Apache Software Foundation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -39,22 +39,45 @@ public class Copyfile extends Task {
private boolean filtering = false; private boolean filtering = false;
private boolean forceOverwrite = false; private boolean forceOverwrite = false;


/**
* Set the source file.
* @param src the source file.
*/
public void setSrc(File src) { public void setSrc(File src) {
srcFile = src; srcFile = src;
} }


/**
* The forceoverwrite attribute.
* Default is false.
* @param force if true overwrite even if the destination file
* is newer that the source file
*/
public void setForceoverwrite(boolean force) { public void setForceoverwrite(boolean force) {
forceOverwrite = force; forceOverwrite = force;
} }


/**
* Set the destination file.
* @param dest the destination file.
*/
public void setDest(File dest) { public void setDest(File dest) {
destFile = dest; destFile = dest;
} }


/**
* The filtering attribute.
* Default is false.
* @param filter if true use filtering
*/
public void setFiltering(String filter) { public void setFiltering(String filter) {
filtering = Project.toBoolean(filter); filtering = Project.toBoolean(filter);
} }


/**
* Execute the task.
* @throws BuildException on error
*/
public void execute() throws BuildException { public void execute() throws BuildException {
log("DEPRECATED - The copyfile task is deprecated. Use copy instead."); log("DEPRECATED - The copyfile task is deprecated. Use copy instead.");




+ 6
- 3
src/main/org/apache/tools/ant/taskdefs/Dirname.java View File

@@ -48,7 +48,7 @@ public class Dirname extends Task {


/** /**
* Path to take the dirname of. * Path to take the dirname of.
* @param file
* @param file a <code>File</code> value
*/ */
public void setFile(File file) { public void setFile(File file) {
this.file = file; this.file = file;
@@ -56,14 +56,17 @@ public class Dirname extends Task {


/** /**
* The name of the property to set. * The name of the property to set.
* @param property
* @param property the name of the property
*/ */
public void setProperty(String property) { public void setProperty(String property) {
this.property = property; this.property = property;
} }




// The method executing the task
/**
* Execute this task.
* @throws BuildException on error
*/
public void execute() throws BuildException { public void execute() throws BuildException {
if (property == null) { if (property == null) {
throw new BuildException("property attribute required", getLocation()); throw new BuildException("property attribute required", getLocation());


+ 14
- 1
src/main/org/apache/tools/ant/taskdefs/Ear.java View File

@@ -37,7 +37,6 @@ public class Ear extends Jar {
private File deploymentDescriptor; private File deploymentDescriptor;
private boolean descriptorAdded; private boolean descriptorAdded;



/** /**
* Create an Ear task. * Create an Ear task.
*/ */
@@ -48,6 +47,8 @@ public class Ear extends Jar {
} }


/** /**
* Set the destination file.
* @param earFile the destination file
* @deprecated Use setDestFile(destfile) instead * @deprecated Use setDestFile(destfile) instead
*/ */
public void setEarfile(File earFile) { public void setEarfile(File earFile) {
@@ -56,6 +57,7 @@ public class Ear extends Jar {


/** /**
* File to incorporate as application.xml. * File to incorporate as application.xml.
* @param descr the descriptor file
*/ */
public void setAppxml(File descr) { public void setAppxml(File descr) {
deploymentDescriptor = descr; deploymentDescriptor = descr;
@@ -86,6 +88,12 @@ public class Ear extends Jar {
} }




/**
* Initialize the output stream.
* @param zOut the zip output stream.
* @throws IOException on I/O errors
* @throws BuildException on other errors
*/
protected void initZipOutputStream(ZipOutputStream zOut) protected void initZipOutputStream(ZipOutputStream zOut)
throws IOException, BuildException { throws IOException, BuildException {
// If no webxml file is specified, it's an error. // If no webxml file is specified, it's an error.
@@ -98,6 +106,11 @@ public class Ear extends Jar {


/** /**
* Overridden from Zip class to deal with application.xml * Overridden from Zip class to deal with application.xml
* @param file the file to add to the archive
* @param zOut the stream to write to
* @param vPath the name this entry shall have in the archive
* @param mode the Unix permissions to set.
* @throws IOException on error
*/ */
protected void zipFile(File file, ZipOutputStream zOut, String vPath, protected void zipFile(File file, ZipOutputStream zOut, String vPath,
int mode) int mode)


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/Echo.java View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2004 The Apache Software Foundation
* Copyright 2000-2005 The Apache Software Foundation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -134,7 +134,7 @@ public class Echo extends Task {
/** /**
* mapping of enumerated values to log levels * mapping of enumerated values to log levels
*/ */
private static int levels[] = {
private static int[] levels = {
Project.MSG_ERR, Project.MSG_ERR,
Project.MSG_WARN, Project.MSG_WARN,
Project.MSG_INFO, Project.MSG_INFO,
@@ -144,7 +144,7 @@ public class Echo extends Task {


/** /**
* get the level of the echo of the current value * get the level of the echo of the current value
* @return
* @return the level
*/ */
public int getLevel() { public int getLevel() {
return levels[getIndex()]; return levels[getIndex()];


Loading…
Cancel
Save