Java 类org.apache.http.impl.cookie.DateParseException 实例源码

项目:purecloud-iot    文件:CachingHttpClient.java   
private boolean revalidationResponseIsTooOld(final HttpResponse backendResponse,
        final HttpCacheEntry cacheEntry) {
    final Header entryDateHeader = cacheEntry.getFirstHeader(HTTP.DATE_HEADER);
    final Header responseDateHeader = backendResponse.getFirstHeader(HTTP.DATE_HEADER);
    if (entryDateHeader != null && responseDateHeader != null) {
        try {
            final Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
            final Date respDate = DateUtils.parseDate(responseDateHeader.getValue());
            if (respDate.before(entryDate)) {
                return true;
            }
        } catch (final DateParseException e) {
            // either backend response or cached entry did not have a valid
            // Date header, so we can't tell if they are out of order
            // according to the origin clock; thus we can skip the
            // unconditional retry recommended in 13.2.6 of RFC 2616.
        }
    }
    return false;
}
项目:apigee-android-sdk    文件:CacheEntryUpdater.java   
private boolean entryDateHeaderNewerThenResponse(HttpCacheEntry entry,
        HttpResponse response) {
    try {
        Date entryDate = DateUtils.parseDate(entry.getFirstHeader(
                HTTP.DATE_HEADER).getValue());
        Date responseDate = DateUtils.parseDate(response.getFirstHeader(
                HTTP.DATE_HEADER).getValue());

        if (!entryDate.after(responseDate)) {
            return false;
        }
    } catch (DateParseException e) {
        return false;
    }

    return true;
}
项目:apigee-android-sdk    文件:CachingHttpClient.java   
private boolean alreadyHaveNewerCacheEntry(HttpHost target,
        HttpRequest request, HttpResponse backendResponse)
        throws IOException {
    HttpCacheEntry existing = null;
    try {
        existing = responseCache.getCacheEntry(target, request);
    } catch (IOException ioe) {
        // nop
    }
    if (existing == null)
        return false;
    Header entryDateHeader = existing.getFirstHeader("Date");
    if (entryDateHeader == null)
        return false;
    Header responseDateHeader = backendResponse.getFirstHeader("Date");
    if (responseDateHeader == null)
        return false;
    try {
        Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
        Date responseDate = DateUtils.parseDate(responseDateHeader
                .getValue());
        return responseDate.before(entryDate);
    } catch (DateParseException e) {
    }
    return false;
}
项目:GitHub    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:GitHub    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:publicProject    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:airgram    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:Codeforces    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:GeekZone    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:iosched-reader    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:PlusGram    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:boohee_v5.6    文件:HttpHeaderParser.java   
public static long parseDateAsEpoch(String dateStr) {
    try {
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        return 0;
    }
}
项目:VoV    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:Android-Application-ZJB    文件:HttpHeaderParser.java   
public static long parseDateAsEpoch(String dateStr) {
    try {
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException var2) {
        return 0L;
    }
}
项目:smconf-android    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:volley    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:MeifuGO    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:nenlvse1.0    文件:DateUtil.java   
/**
 * 将指定字符串转换成日期
 *
 * @param date        String 日期字符串
 * @return Date
 */
public static Date getFormatDate8(String date) throws DateParseException {
    if(date == null || date.length() == 0) return null;
    date = date.replaceAll("[-\\s/:]+","");

    if(date.length()<8) throw new DateParseException("日期格式错误");
    if(date.length()>8) date = date.substring(0,8);

    SimpleDateFormat sd = new SimpleDateFormat("yyyyMMdd");
    return sd.parse(date, new java.text.ParsePosition(0));
}
项目:apker    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:pearl    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:InfoQ-Android-App    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:AndroidProjects    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:volley-public-key-pinning    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:device-database    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:RenewPass    文件:InMemoryCacheEntry.java   
protected Date parseDate(final String expires) {
    try {
        return DateUtils.parseDate(expires);
    } catch (DateParseException e) {
        throw MechanizeExceptionFactory.newException(e);
    }
}
项目:ShoppingApp    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:2015-Google-I-O-app    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:msb-android    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:Simplified-Zhihu-Daily    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:SimplifyReader2    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:TastySnake    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:android.java    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:SaveVolley    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
/*
 * 解析时间,将 RFC1123 的时间格式,解析成 epoch 时间
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        // 耦合了 Apache 的时间工具类
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:purecloud-iot    文件:CachingHttpClient.java   
private boolean alreadyHaveNewerCacheEntry(final HttpHost target, final HttpRequest request,
        final HttpResponse backendResponse) {
    HttpCacheEntry existing = null;
    try {
        existing = responseCache.getCacheEntry(target, request);
    } catch (final IOException ioe) {
        // nop
    }
    if (existing == null) {
        return false;
    }
    final Header entryDateHeader = existing.getFirstHeader(HTTP.DATE_HEADER);
    if (entryDateHeader == null) {
        return false;
    }
    final Header responseDateHeader = backendResponse.getFirstHeader(HTTP.DATE_HEADER);
    if (responseDateHeader == null) {
        return false;
    }
    try {
        final Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
        final Date responseDate = DateUtils.parseDate(responseDateHeader.getValue());
        return responseDate.before(entryDate);
    } catch (final DateParseException e) {
        // Empty on Purpose
    }
    return false;
}
项目:Jacket-    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:android-project-wo2b    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:ots15-companion    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}
项目:FMTech    文件:HttpHeaderParser.java   
private static long parseDateAsEpoch(String paramString)
{
  try
  {
    long l = DateUtils.parseDate(paramString).getTime();
    return l;
  }
  catch (DateParseException localDateParseException) {}
  return 0L;
}
项目:FMTech    文件:zzx.java   
private static long zzg(String paramString)
{
  try
  {
    long l = DateUtils.parseDate(paramString).getTime();
    return l;
  }
  catch (DateParseException localDateParseException) {}
  return 0L;
}
项目:FMTech    文件:HttpHeaderParser.java   
/**
 * Parse date in RFC1123 format, and return its value as epoch
 */
public static long parseDateAsEpoch(String dateStr) {
    try {
        // Parse date in RFC1123 format if this header contains one
        return DateUtils.parseDate(dateStr).getTime();
    } catch (DateParseException e) {
        // Date in invalid format, fallback to 0
        return 0;
    }
}