Changeset 26f8939


Ignore:
Timestamp:
Apr 25, 2015 10:56:51 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
40c4a42
Parents:
aaae72c
Message:

Mods to remove additional Apache dependencies
and unneeded code, now compiles

Location:
core/java/src/org/apache/http
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/org/apache/http/conn/ssl/DefaultHostnameVerifier.java

    raaae72c r26f8939  
    5050import javax.security.auth.x500.X500Principal;
    5151
    52 import org.apache.commons.logging.Log;
    53 import org.apache.commons.logging.LogFactory;
    54 import org.apache.http.annotation.Immutable;
    5552import org.apache.http.conn.util.InetAddressUtils;
    5653import org.apache.http.conn.util.PublicSuffixMatcher;
    5754
     55import net.i2p.I2PAppContext;
     56import net.i2p.util.Log;
     57
    5858/**
    5959 * Default {@link javax.net.ssl.HostnameVerifier} implementation.
     
    6161 * @since 4.4
    6262 */
    63 @Immutable
    6463public final class DefaultHostnameVerifier implements HostnameVerifier {
    6564
     
    6766    final static int IP_ADDRESS_TYPE      = 7;
    6867
    69     private final Log log = LogFactory.getLog(getClass());
     68    private final Log log = I2PAppContext.getGlobalContext().logManager().getLog(getClass());
    7069
    7170    private final PublicSuffixMatcher publicSuffixMatcher;
     
    8786            return true;
    8887        } catch(final SSLException ex) {
    89             if (log.isDebugEnabled()) {
    90                 log.debug(ex.getMessage(), ex);
     88            if (log.shouldWarn()) {
     89                log.warn(ex.getMessage(), ex);
    9190            }
    9291            return false;
  • core/java/src/org/apache/http/conn/util/InetAddressUtils.java

    raaae72c r26f8939  
    3030import java.util.regex.Pattern;
    3131
    32 import org.apache.http.annotation.Immutable;
    3332
    3433/**
     
    3736 * @since 4.0
    3837 */
    39 @Immutable
    4038public class InetAddressUtils {
    4139
  • core/java/src/org/apache/http/conn/util/PublicSuffixList.java

    raaae72c r26f8939  
    3030import java.util.List;
    3131
    32 import org.apache.http.annotation.Immutable;
    3332import org.apache.http.util.Args;
    3433
     
    4241 * @since 4.4
    4342 */
    44 @Immutable
    4543public final class PublicSuffixList {
    4644
  • core/java/src/org/apache/http/conn/util/PublicSuffixListParser.java

    raaae72c r26f8939  
    3333import java.util.List;
    3434
    35 import org.apache.http.annotation.Immutable;
    3635
    3736/**
     
    4140 * @since 4.4
    4241 */
    43 @Immutable
    4442public final class PublicSuffixListParser {
    4543
  • core/java/src/org/apache/http/conn/util/PublicSuffixMatcher.java

    raaae72c r26f8939  
    3333import java.util.concurrent.ConcurrentHashMap;
    3434
    35 import org.apache.http.annotation.ThreadSafe;
    3635import org.apache.http.util.Args;
    3736
     
    4645 * @since 4.4
    4746 */
    48 @ThreadSafe
    4947public final class PublicSuffixMatcher {
    5048
  • core/java/src/org/apache/http/util/Args.java

    raaae72c r26f8939  
    2828package org.apache.http.util;
    2929
    30 import java.util.Collection;
    31 
    3230public class Args {
    33 
    34     public static void check(final boolean expression, final String message) {
    35         if (!expression) {
    36             throw new IllegalArgumentException(message);
    37         }
    38     }
    39 
    40     public static void check(final boolean expression, final String message, final Object... args) {
    41         if (!expression) {
    42             throw new IllegalArgumentException(String.format(message, args));
    43         }
    44     }
    45 
    46     public static void check(final boolean expression, final String message, final Object arg) {
    47         if (!expression) {
    48             throw new IllegalArgumentException(String.format(message, arg));
    49         }
    50     }
    5131
    5232    public static <T> T notNull(final T argument, final String name) {
     
    5636        return argument;
    5737    }
    58 
    59     public static <T extends CharSequence> T notEmpty(final T argument, final String name) {
    60         if (argument == null) {
    61             throw new IllegalArgumentException(name + " may not be null");
    62         }
    63         if (TextUtils.isEmpty(argument)) {
    64             throw new IllegalArgumentException(name + " may not be empty");
    65         }
    66         return argument;
    67     }
    68 
    69     public static <T extends CharSequence> T notBlank(final T argument, final String name) {
    70         if (argument == null) {
    71             throw new IllegalArgumentException(name + " may not be null");
    72         }
    73         if (TextUtils.isBlank(argument)) {
    74             throw new IllegalArgumentException(name + " may not be blank");
    75         }
    76         return argument;
    77     }
    78 
    79     public static <T extends CharSequence> T containsNoBlanks(final T argument, final String name) {
    80         if (argument == null) {
    81             throw new IllegalArgumentException(name + " may not be null");
    82         }
    83         if (TextUtils.containsBlanks(argument)) {
    84             throw new IllegalArgumentException(name + " may not contain blanks");
    85         }
    86         return argument;
    87     }
    88 
    89     public static <E, T extends Collection<E>> T notEmpty(final T argument, final String name) {
    90         if (argument == null) {
    91             throw new IllegalArgumentException(name + " may not be null");
    92         }
    93         if (argument.isEmpty()) {
    94             throw new IllegalArgumentException(name + " may not be empty");
    95         }
    96         return argument;
    97     }
    98 
    99     public static int positive(final int n, final String name) {
    100         if (n <= 0) {
    101             throw new IllegalArgumentException(name + " may not be negative or zero");
    102         }
    103         return n;
    104     }
    105 
    106     public static long positive(final long n, final String name) {
    107         if (n <= 0) {
    108             throw new IllegalArgumentException(name + " may not be negative or zero");
    109         }
    110         return n;
    111     }
    112 
    113     public static int notNegative(final int n, final String name) {
    114         if (n < 0) {
    115             throw new IllegalArgumentException(name + " may not be negative");
    116         }
    117         return n;
    118     }
    119 
    120     public static long notNegative(final long n, final String name) {
    121         if (n < 0) {
    122             throw new IllegalArgumentException(name + " may not be negative");
    123         }
    124         return n;
    125     }
    126 
    12738}
Note: See TracChangeset for help on using the changeset viewer.