Browse Source

javadoc

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277461 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
94fc48515a
2 changed files with 44 additions and 8 deletions
  1. +8
    -1
      src/main/org/apache/tools/ant/taskdefs/BUnzip2.java
  2. +36
    -7
      src/main/org/apache/tools/ant/taskdefs/Chmod.java

+ 8
- 1
src/main/org/apache/tools/ant/taskdefs/BUnzip2.java View File

@@ -1,5 +1,5 @@
/*
* Copyright 2001-2002,2004 The Apache Software Foundation
* Copyright 2001-2002,2004-2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,10 +39,17 @@ public class BUnzip2 extends Unpack {

private static final String DEFAULT_EXTENSION = ".bz2";

/**
* Get the default extension.
* @return the string ".bz2"
*/
protected String getDefaultExtension() {
return DEFAULT_EXTENSION;
}

/**
* Do the unbzipping.
*/
protected void extract() {
if (source.lastModified() > dest.lastModified()) {
log("Expanding " + source.getAbsolutePath() + " to "


+ 36
- 7
src/main/org/apache/tools/ant/taskdefs/Chmod.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");
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ public class Chmod extends ExecuteOn {

/**
* The file or single directory of which the permissions must be changed.
* @param src
* @param src the source file or directory.
*/
public void setFile(File src) {
FileSet fs = new FileSet();
@@ -70,15 +70,15 @@ public class Chmod extends ExecuteOn {

/**
* The directory which holds the files whose permissions must be changed.
* @param src
* @param src the directory.
*/
public void setDir(File src) {
defaultSet.setDir(src);
}

/**
* The new permissions.
* @param perm
* Set the new permissions.
* @param perm the new permissions.
*/
public void setPerm(String perm) {
createArg().setValue(perm);
@@ -87,6 +87,7 @@ public class Chmod extends ExecuteOn {

/**
* Add a name entry on the include list.
* @return a NameEntry to be configured.
*/
public PatternSet.NameEntry createInclude() {
defaultSetDefined = true;
@@ -95,6 +96,7 @@ public class Chmod extends ExecuteOn {

/**
* Add a name entry on the exclude list.
* @return a nameentry to be configured.
*/
public PatternSet.NameEntry createExclude() {
defaultSetDefined = true;
@@ -103,6 +105,7 @@ public class Chmod extends ExecuteOn {

/**
* Add a set of patterns.
* @return a patternset to be configured.
*/
public PatternSet createPatternSet() {
defaultSetDefined = true;
@@ -113,7 +116,7 @@ public class Chmod extends ExecuteOn {
* Sets the set of include patterns. Patterns may be separated by a comma
* or a space.
*
* @param includes the string containing the include patterns
* @param includes the string containing the include patterns.
*/
public void setIncludes(String includes) {
defaultSetDefined = true;
@@ -124,7 +127,7 @@ public class Chmod extends ExecuteOn {
* Sets the set of exclude patterns. Patterns may be separated by a comma
* or a space.
*
* @param excludes the string containing the exclude patterns
* @param excludes the string containing the exclude patterns.
*/
public void setExcludes(String excludes) {
defaultSetDefined = true;
@@ -143,6 +146,9 @@ public class Chmod extends ExecuteOn {
defaultSet.setDefaultexcludes(useDefaultExcludes);
}

/**
* Check the attributes and nested elements.
*/
protected void checkConfiguration() {
if (!havePerm) {
throw new BuildException("Required attribute perm not set in chmod",
@@ -155,6 +161,10 @@ public class Chmod extends ExecuteOn {
super.checkConfiguration();
}

/**
* Carry out the chmoding.
* @throws BuildException on error.
*/
public void execute() throws BuildException {
/*
* In Ant 1.1, <chmod dir="foo" /> means, change the permissions
@@ -189,6 +199,10 @@ public class Chmod extends ExecuteOn {
}

/**
* Set the executable.
* This is not allowed for Chmod.
* @param e ignored.
* @throws BuildException always.
* @ant.attribute ignore="true"
*/
public void setExecutable(String e) {
@@ -197,6 +211,10 @@ public class Chmod extends ExecuteOn {
}

/**
* Set the command.
* This is not allowed for Chmod.
* @param cmdl ignored.
* @throws BuildException always.
* @ant.attribute ignore="true"
*/
public void setCommand(Commandline cmdl) {
@@ -205,6 +223,9 @@ public class Chmod extends ExecuteOn {
}

/**
* This is not allowed for Chmod.
* @param skip ignored.
* @throws BuildException always.
* @ant.attribute ignore="true"
*/
public void setSkipEmptyFilesets(boolean skip) {
@@ -213,6 +234,9 @@ public class Chmod extends ExecuteOn {
}

/**
* This is not allowed for Chmod.
* @param b ignored.
* @throws BuildException always.
* @ant.attribute ignore="true"
*/
public void setAddsourcefile(boolean b) {
@@ -220,6 +244,11 @@ public class Chmod extends ExecuteOn {
+ " doesn\'t support the addsourcefile attribute", getLocation());
}

/**
* Check if the os is valid.
* Always include unix.
* @return true if the os is valid.
*/
protected boolean isValidOs() {
return Os.isFamily("unix") && super.isValidOs();
}


Loading…
Cancel
Save