______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif
Index: HttpUtils.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-maven/src/java/org/apache/maven/util/HttpUtils.java,v
retrieving revision 1.4
diff -r1.4 HttpUtils.java
66a67
> import java.net.Authenticator;
67a69
> import java.net.PasswordAuthentication;
80a83,111
> * Use a proxy to bypass the firewall with or without authentication
> *
> * @param proxyHost Proxy Host (if proxy is required), or null
> * @param proxyPort Proxy Port (if proxy is required), or null
> * @param proxyUserName Proxy Username (if authentification is required), or null
> * @param proxyPassword Proxy Password (if authentification is required), or null
> */
> public static void useProxyUser(final String proxyHost, final String proxyPort,
> final String proxyUserName, final String proxyPassword)
> {
> if (proxyHost != null && proxyPort != null)
> {
> System.getProperties().put("proxySet", "true");
> System.getProperties().put("proxyHost", proxyHost);
> System.getProperties().put("proxyPort", proxyPort);
>
> if (proxyUserName != null)
> {
> Authenticator.setDefault(new Authenticator() {
> protected PasswordAuthentication getPasswordAuthentication() {
> return new PasswordAuthentication(proxyUserName,
> proxyPassword == null ? new char[0] :
>proxyPassword.toCharArray());
> }
> });
> }
> }
> }
>
> /**
97c128,129
< String uname, String pword)
---
> String uname, String pword,
> String proxyHost, String proxyPort, String proxyUserName, String
>proxyPassword)
117a150,152
>
> //set proxy connection
> useProxyUser(proxyHost, proxyPort, proxyUserName, proxyPassword);
256a292,317
> /**
> * Retrieve a remote file. Returns true if the file was successfully
> * retrieved or if it is up to date (when the useTimestamp flag is set).
> * @param source the {@link URL} of the file to retrieve
> * @param destinationFile where to store it
> * @param file <strong>doesn't appear to be used</strong>
> * @param verbose the amount of logging to be displayed
> * @param ignoreErrors whether to ignore errors during I/O or throw an
> * exception when they happen
> * @param useTimestamp whether to check the modified timestamp on the
> * <code>destinationFile</code> against the remote <code>source</code>
> * @param uname the user name to use for basic authentication
> * @param pword the password to use for basic authentication
> * @return true if the retrieval succeeded, false otherwise
> * @deprecated
> * @see
>#getFile(url,file,string,boolean,boolean,boolean,string,string,string,string,string,string)
> */
> public static boolean getFile(URL source, File destinationFile, String file,
> boolean verbose, boolean ignoreErrors, boolean useTimestamp,
> String uname, String pword)
> {
> return getFile(source, destinationFile, file,
> verbose, ignoreErrors, useTimestamp,
> uname, pword, null, null, null, null);
> }
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>