Browse Source

javadoc + linelength

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277938 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
68e66cfb34
1 changed files with 19 additions and 2 deletions
  1. +19
    -2
      src/main/org/apache/tools/ant/taskdefs/Unpack.java

+ 19
- 2
src/main/org/apache/tools/ant/taskdefs/Unpack.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,6 +39,7 @@ public abstract class Unpack extends Task {
* mechanism do the work and also to encapsulate operations on
* the type in its own class.
* @ant.attribute ignore="true"
* @param src a <code>String</code> value
*/
public void setSrc(String src) {
log("DEPRECATED - The setSrc(String) method has been deprecated."
@@ -52,6 +53,7 @@ public abstract class Unpack extends Task {
* mechanism do the work and also to encapsulate operations on
* the type in its own class.
* @ant.attribute ignore="true"
* @param dest a <code>String</code> value
*/
public void setDest(String dest) {
log("DEPRECATED - The setDest(String) method has been deprecated."
@@ -103,7 +105,8 @@ public abstract class Unpack extends Task {
int len = sourceName.length();
if (defaultExtension != null
&& len > defaultExtension.length()
&& defaultExtension.equalsIgnoreCase(sourceName.substring(len - defaultExtension.length()))) {
&& defaultExtension.equalsIgnoreCase(
sourceName.substring(len - defaultExtension.length()))) {
dest = new File(dest, sourceName.substring(0,
len - defaultExtension.length()));
} else {
@@ -111,6 +114,10 @@ public abstract class Unpack extends Task {
}
}

/**
* Execute the task.
* @throws BuildException on error
*/
public void execute() throws BuildException {
File savedDest = dest; // may be altered in validate
try {
@@ -121,6 +128,16 @@ public abstract class Unpack extends Task {
}
}

/**
* Get the extension.
* This is to be overridden by subclasses.
* @return the default extension.
*/
protected abstract String getDefaultExtension();

/**
* Do the uncompressing.
* This is to be overridden by subclasses.
*/
protected abstract void extract();
}

Loading…
Cancel
Save