Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Apache Ant Source Code Files
Apache Ant Source Code Files are inside the Apache Ant source package file
like apache-ant-1.10.10-src.zip.
Unzip the source package file and go to the "src/main" sub-directory,
you will see source code files.
Here is the list of Java source code files of the Apache Ant 1.10.10 in \Users\fyicenter\apache-ant-1.10.10\src\main:
✍: FYIcenter.com
⏎ org/apache/tools/ant/taskdefs/Echo.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs;
import java.io.File;
import java.io.IOException;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.LogLevel;
import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.resources.FileProvider;
import org.apache.tools.ant.types.resources.FileResource;
import org.apache.tools.ant.types.resources.LogOutputResource;
import org.apache.tools.ant.types.resources.StringResource;
import org.apache.tools.ant.util.ResourceUtils;
/**
* Writes a message to the Ant logging facilities.
*
* @since Ant 1.1
*
* @ant.task category="utility"
*/
public class Echo extends Task {
// CheckStyle:VisibilityModifier OFF - bc
protected String message = "";
protected File file = null;
protected boolean append = false;
/** encoding; set to null or empty means 'default' */
private String encoding = "";
private boolean force = false;
// by default, messages are always displayed
protected int logLevel = Project.MSG_WARN;
// CheckStyle:VisibilityModifier ON
private Resource output;
/**
* Does the work.
*
* @exception BuildException if something goes wrong with the build
*/
public void execute() throws BuildException {
try {
ResourceUtils.copyResource(
new StringResource(message.isEmpty() ? System.lineSeparator() : message),
output == null ? new LogOutputResource(this, logLevel) : output,
null, null, false, false, append, null,
encoding.isEmpty() ? null : encoding, getProject(), force);
} catch (IOException ioe) {
throw new BuildException(ioe, getLocation());
}
}
/**
* Message to write.
*
* @param msg Sets the value for the message variable.
*/
public void setMessage(String msg) {
this.message = msg == null ? "" : msg;
}
/**
* File to write to.
* @param file the file to write to, if not set, echo to
* standard output
*/
public void setFile(File file) {
setOutput(new FileResource(getProject(), file));
}
/**
* Resource to write to.
* @param output the Resource to write to.
* @since Ant 1.8
*/
public void setOutput(Resource output) {
if (this.output != null) {
throw new BuildException("Cannot set > 1 output target");
}
this.output = output;
FileProvider fp = output.as(FileProvider.class);
this.file = fp != null ? fp.getFile() : null;
}
/**
* If true, append to existing file.
* @param append if true, append to existing file, default
* is false.
*/
public void setAppend(boolean append) {
this.append = append;
}
/**
* Set a multiline message.
* @param msg the CDATA text to append to the output text
*/
public void addText(String msg) {
message += getProject().replaceProperties(msg);
}
/**
* Set the logging level. Level should be one of
* <ul>
* <li>error</li>
* <li>warning</li>
* <li>info</li>
* <li>verbose</li>
* <li>debug</li>
* </ul>
* <p>The default is "warning" to ensure that messages are
* displayed by default when using the -quiet command line option.</p>
* @param echoLevel the logging level
*/
public void setLevel(EchoLevel echoLevel) {
logLevel = echoLevel.getLevel();
}
/**
* Declare the encoding to use when outputting to a file;
* Use "" for the platform's default encoding.
* @param encoding the character encoding to use.
* @since 1.7
*/
public void setEncoding(String encoding) {
this.encoding = encoding;
}
/**
* Whether read-only destinations will be overwritten.
*
* <p>Defaults to false</p>
*
* @param f boolean
* @since Ant 1.8.2
*/
public void setForce(boolean f) {
force = f;
}
/**
* The enumerated values for the level attribute.
*/
public static class EchoLevel extends LogLevel {
}
}
⏎ org/apache/tools/ant/taskdefs/Echo.java
Or download all of them as a single archive file:
File name: apache-ant-1.10.10-fyi.zip File size: 2392938 bytes Release date: 2021-04-17 Download
⇐ Download Apache Ant Source Package
2021-07-10, ≈220🔥, 0💬
Popular Posts:
What Is junit-3.8.1.jar? junit-3.8.1.jar is the version 3.8.1 of JUnit JAR library file. JUnit is a ...
JDK 17 jdk.hotspot.agent.jmod is the JMOD file for JDK 17 Hotspot Agent module. JDK 17 Hotspot Agent...
maven-core-3.5.4.jar is the JAR file for Apache Maven 3.5.4 Core module. Apache Maven is a software ...
JDK 11 jdk.aot.jmod is the JMOD file for JDK 11 Ahead-of-Time (AOT) Compiler module. JDK 11 AOT Comp...
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...