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/util/ProxySetup.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.util;
import org.apache.tools.ant.Project;
/**
* Code to do proxy setup. This is just factored out of the main system just to
* keep everything else less convoluted.
* @since Ant1.7
*/
public class ProxySetup {
/**
* owner project; used for logging and extracting properties
*/
private Project owner;
/**
* Java1.5 property that enables use of system proxies.
*/
public static final String USE_SYSTEM_PROXIES = "java.net.useSystemProxies";
/** the http proxyhost property */
public static final String HTTP_PROXY_HOST = "http.proxyHost";
/** the http proxyport property */
public static final String HTTP_PROXY_PORT = "http.proxyPort";
/** the https proxyhost property */
public static final String HTTPS_PROXY_HOST = "https.proxyHost";
/** the https proxyport property */
public static final String HTTPS_PROXY_PORT = "https.proxyPort";
/** the ftp proxyhost property */
public static final String FTP_PROXY_HOST = "ftp.proxyHost";
/** the ftp proxyport property */
public static final String FTP_PROXY_PORT = "ftp.proxyPort";
/** the ftp proxyport property */
public static final String HTTP_NON_PROXY_HOSTS = "http.nonProxyHosts";
/** the http hosts not to be proxied property */
public static final String HTTPS_NON_PROXY_HOSTS = "https.nonProxyHosts";
/** the ftp hosts not to be proxied property */
public static final String FTP_NON_PROXY_HOSTS = "ftp.nonProxyHosts";
/** the http proxy username property */
public static final String HTTP_PROXY_USERNAME = "http.proxyUser";
/** the http proxy password property */
public static final String HTTP_PROXY_PASSWORD = "http.proxyPassword"; //NOSONAR
/** the socks proxy host property */
public static final String SOCKS_PROXY_HOST = "socksProxyHost";
/** the socks proxy port property */
public static final String SOCKS_PROXY_PORT = "socksProxyPort";
/** the socks proxy username property */
public static final String SOCKS_PROXY_USERNAME = "java.net.socks.username";
/** the socks proxy password property */
public static final String SOCKS_PROXY_PASSWORD = "java.net.socks.password"; //NOSONAR
/**
* create a proxy setup class bound to this project
* @param owner the project that owns this setup.
*/
public ProxySetup(Project owner) {
this.owner = owner;
}
/**
* Get the current system property settings
* @return current value; null for none or no access
*/
public static String getSystemProxySetting() {
try {
return System.getProperty(USE_SYSTEM_PROXIES);
} catch (SecurityException e) {
//if you cannot read it, you won't be able to write it either
return null;
}
}
/**
* turn proxies on;
* if the proxy key is already set to some value: leave alone.
* if an ant property of the value {@link #USE_SYSTEM_PROXIES}
* is set, use that instead. Else set to "true".
*/
public void enableProxies() {
if (getSystemProxySetting() == null) {
String proxies = owner.getProperty(USE_SYSTEM_PROXIES);
if (proxies == null || Project.toBoolean(proxies)) {
proxies = "true";
}
String message = "setting " + USE_SYSTEM_PROXIES + " to " + proxies;
try {
owner.log(message, Project.MSG_DEBUG);
System.setProperty(USE_SYSTEM_PROXIES, proxies);
} catch (SecurityException e) {
//log security exceptions and continue; it aint that
//important and may be quite common running Ant embedded.
owner.log("Security Exception when " + message);
}
}
}
}
⏎ org/apache/tools/ant/util/ProxySetup.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, ≈1557🔥, 0💬
Popular Posts:
What Is HttpComponents commons-httpclient-3.1.j ar?HttpComponents commons-httpclient-3.1.j aris the ...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
What JAR files are required to run sax\Writer.java provided in the Apache Xerces package? 1 JAR file...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...