[
http://issues.apache.org/jira/browse/NUTCH-65?page=comments#action_12315010 ]
Lutischán Ferenc commented on NUTCH-65:
---------------------------------------
Dear Developers,
I have a finally solution (I have a firewall, I can't make patch with svn), I
suggested please commit it:
In the import section:
import java.util.Locale;
Replace getTime function with:
private long getTime(String date, String url) {
long time = -1;
try {
time = HttpDateFormat.toLong(date);
} catch (ParseException e) {
// try to parse it as date in alternative format
String date2 = date;
try {
if (date.length() > 25 ) date2 = date.substring(0, 25);
DateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss",
Locale.US);
time = df.parse(date2).getTime();
} catch (Exception e1) {
try {
if (date.length() > 24 ) date2 = date.substring(0, 24);
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy",
Locale.US);
time = df.parse(date2).getTime();
} catch (Exception e2) {
LOG.warning(url+": can't parse erroneous date: "+date);
}
}
}
return time;
}
> index-more plugin can't parse large set of modification-date
> -------------------------------------------------------------
>
> Key: NUTCH-65
> URL: http://issues.apache.org/jira/browse/NUTCH-65
> Project: Nutch
> Type: Bug
> Components: indexer
> Environment: nutch 0.7, java 1.5, linux
> Reporter: Lutischán Ferenc
>
> I found a problem in MoreIndexingFilter.java.
> When I indexing segments, I get large list of error messages:
> can't parse errorenous date: Wed, 10 Sep 2003 11:59:14 or
> can't parse errorenous date: Wed, 10 Sep 2003 11:59:14GMT
> I modifiing source code (I don't make a 'patch'):
> Original (lines 137-138):
> DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy zzz");
> Date d = df.parse(date);
> New:
> DateFormat df = new SimpleDateFormat("EEE, MMM dd HH:mm:ss yyyy", Locale.US);
> Date d = df.parse(date.substring(0,25));
> The modified code works fine.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Nutch-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-developers