Author: markt
Date: Wed Mar 22 10:48:20 2017
New Revision: 1788087
URL: http://svn.apache.org/viewvc?rev=1788087&view=rev
Log:
Trivial commit to test CI system.
Experimenting with automatic formatting.
No functional change.
Modified:
tomcat/tc8.5.x/trunk/java/org/apache/catalina/ant/DeployTask.java
Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/ant/DeployTask.java
URL:
http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/ant/DeployTask.java?rev=1788087&r1=1788086&r2=1788087&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/catalina/ant/DeployTask.java (original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/ant/DeployTask.java Wed Mar
22 10:48:20 2017
@@ -14,11 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
package org.apache.catalina.ant;
-
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
@@ -30,20 +27,16 @@ import java.util.regex.Pattern;
import org.apache.tools.ant.BuildException;
-
/**
- * Ant task that implements the <code>/deploy</code> command, supported by
- * the Tomcat manager application.
+ * Ant task that implements the <code>/deploy</code> command, supported by the
+ * Tomcat manager application.
*
* @author Craig R. McClanahan
* @since 4.1
*/
public class DeployTask extends AbstractCatalinaCommandTask {
- private static final Pattern PROTOCOL_PATTERN =
Pattern.compile("\\w{3,5}\\:");
-
-
- // ------------------------------------------------------------- Properties
+ private static final Pattern PROTOCOL_PATTERN =
Pattern.compile("\\w{3,5}\\:");
/**
* URL of the context configuration file for this application, if any.
@@ -51,7 +44,7 @@ public class DeployTask extends Abstract
protected String config = null;
public String getConfig() {
- return (this.config);
+ return this.config;
}
public void setConfig(String config) {
@@ -60,13 +53,13 @@ public class DeployTask extends Abstract
/**
- * URL of the server local web application archive (WAR) file
- * to be deployed.
+ * URL of the server local web application archive (WAR) file to be
+ * deployed.
*/
protected String localWar = null;
public String getLocalWar() {
- return (this.localWar);
+ return this.localWar;
}
public void setLocalWar(String localWar) {
@@ -80,7 +73,7 @@ public class DeployTask extends Abstract
protected String tag = null;
public String getTag() {
- return (this.tag);
+ return this.tag;
}
public void setTag(String tag) {
@@ -94,7 +87,7 @@ public class DeployTask extends Abstract
protected boolean update = false;
public boolean getUpdate() {
- return (this.update);
+ return this.update;
}
public void setUpdate(boolean update) {
@@ -108,7 +101,7 @@ public class DeployTask extends Abstract
protected String war = null;
public String getWar() {
- return (this.war);
+ return this.war;
}
public void setWar(String war) {
@@ -116,9 +109,6 @@ public class DeployTask extends Abstract
}
- // --------------------------------------------------------- Public Methods
-
-
/**
* Execute the requested operation.
*
@@ -126,17 +116,14 @@ public class DeployTask extends Abstract
*/
@Override
public void execute() throws BuildException {
-
super.execute();
if (path == null) {
- throw new BuildException
- ("Must specify 'path' attribute");
+ throw new BuildException("Must specify 'path' attribute");
}
if ((war == null) && (localWar == null) && (config == null) && (tag ==
null)) {
- throw new BuildException
- ("Must specify either 'war', 'localWar', 'config', or 'tag'
attribute");
+ throw new BuildException(
+ "Must specify either 'war', 'localWar', 'config',
or 'tag' attribute");
}
-
// Building an input stream on the WAR to upload, if any
BufferedInputStream stream = null;
String contentType = null;
@@ -147,8 +134,7 @@ public class DeployTask extends Abstract
URL url = new URL(war);
URLConnection conn = url.openConnection();
contentLength = conn.getContentLengthLong();
- stream = new BufferedInputStream
- (conn.getInputStream(), 1024);
+ stream = new BufferedInputStream(conn.getInputStream(),
1024);
} catch (IOException e) {
throw new BuildException(e);
}
@@ -171,7 +157,6 @@ public class DeployTask extends Abstract
}
contentType = "application/octet-stream";
}
-
// Building URL
StringBuilder sb = createQueryString("/deploy");
try {
@@ -190,7 +175,6 @@ public class DeployTask extends Abstract
sb.append("&tag=");
sb.append(URLEncoder.encode(tag, getCharset()));
}
-
execute(sb.toString(), stream, contentType, contentLength);
} catch (UnsupportedEncodingException e) {
throw new BuildException("Invalid 'charset' attribute: " +
getCharset());
@@ -203,8 +187,5 @@ public class DeployTask extends Abstract
}
}
}
-
}
-
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]