/** * Formats the given date according to the RFC 1123 pattern. * * @param date The date to format. * @return An RFC 1123 formatted date string. * * @see #PATTERN_RFC1123 */ public static String formatDate(Date date) { return formatDate(date, PATTERN_RFC1123); }
public boolean equals(final Object object) { if (object == null) return false; if (this == object) return true; if (object instanceof NameValuePair) { NameValuePair that = (NameValuePair) object; return LangUtils.equals(this.name, that.name) && LangUtils.equals(this.value, that.value); } else { return false; } }
/** * Parses a date value. The formats used for parsing the date value are retrieved from * the default http params. * * @param dateValue the date value to parse * * @return the parsed date * * @throws DateParseException if the value could not be parsed using any of the * supported date formats */ public static Date parseDate(String dateValue) throws DateParseException { return parseDate(dateValue, null, null); }
/** Default constructor */ public RFC2109Spec() { super(); this.formatter = new ParameterFormatter(); this.formatter.setAlwaysUseQuotes(true); }
/** * Converts the byte array of HTTP content characters to a string. If * the specified charset is not supported, default system encoding * is used. * * @param data the byte array to be encoded * @param charset the desired character encoding * @return The result of the conversion. * * @since 3.0 */ public static String getString(final byte[] data, String charset) { return getString(data, 0, data.length, charset); }
/** * Converts the byte array of ASCII characters to a string. This method is * to be used when decoding content of HTTP elements (such as response * headers) * * @param data the byte array to be encoded * @return The string representation of the byte array * * @since 3.0 */ public static String getAsciiString(final byte[] data) { return getAsciiString(data, 0, data.length); }
/** * Closes idle connections. * @param idleTimeout */ public synchronized void closeIdleConnections(long idleTimeout) { idleConnectionHandler.closeIdleConnections(idleTimeout); }
/** * Default constructor for the digest authetication scheme. * * @since 3.0 */ public DigestScheme() { super(); this.complete = false; this.formatter = new ParameterFormatter(); }
/** * Parses a date value. The formats used for parsing the date value are retrieved from * the default http params. * * @param dateValue the date value to parse * * @return the parsed date * * @throws DateParseException if the value could not be parsed using any of the * supported date formats */ public static Date parseDate(String dateValue) throws DateParseException { return parseDate(dateValue, null); }
private static boolean isUnsafeChar(char ch) { return isOneOf(UNSAFE_CHARS, ch); }
/** * Creates a new ConnectTimeoutException with the specified detail message and cause. * * @param message the exception detail message * @param cause the <tt>Throwable</tt> that caused this exception, or <tt>null</tt> * if the cause is unavailable, unknown, or not a <tt>Throwable</tt> */ public ConnectTimeoutException(String message, Throwable cause) { super(message); // If we're running on JDK 1.4 or later, tell Throwable what the cause was ExceptionUtil.initCause(this, cause); }
public IdleConnectionTimeoutThread() { setDaemon(true); }
/** * Parses the date value using the given date formats. * * @param dateValue the date value to parse * @param dateFormats the date formats to use * * @return the parsed date * * @throws DateParseException if none of the dataFormats could parse the dateValue */ public static Date parseDate(String dateValue, Collection dateFormats) throws DateParseException { return parseDate(dateValue, dateFormats, null); }
private static boolean isSeparator(char ch) { return isOneOf(SEPARATORS, ch); }
public static int hashCode(final int seed, final boolean b) { return hashCode(seed, b ? 1 : 0); }