lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <>
Subject Re: Using example Lucene 2.0 index class
Date Fri, 22 Sep 2006 19:46:07 GMT
Not to step out of Lucene world, but I would love to know the truth of 
the matter on this...the first site that search brings up on google 
seems to claim that was the behavior back at 1.2 or so and it is not the 
case anymore.

The javadocs don't seem to mention it:


public long *lastModified*()

    Returns the time that the file denoted by this abstract pathname was
    last modified.

        A |long| value representing the time the file was last modified,
        measured in milliseconds since the epoch (00:00:00 GMT, January
        1, 1970), or |0L| if the file does not exist or if an I/O error
        - If a security manager exists and its
        method denies read access to the file

Erick Erickson wrote:
> Ya gotta use google, man <G>. This took about 15 seconds to find by 
> googling
> java file modification date
> Get the "last modified" date from a file Simply use the lastModified()
> method from a file object. but the return value is system dependent and
> should only be used to compare with other values returned by last 
> modified.
> It should not be interpreted as an absolute time.
> String s1 = "file1.dat";
> String s2 = "file2.dat";
> File f1 = new File(s1);
> File f2 = new File(s2);
> if (f1.lastModified() < f2.lastModified())
>   System.out.println(s1 + " is older than " + s2);
> On 9/22/06, Mag Gam <> wrote:
>> Hi All,
>> I have been using the Lucene 2.0 distro Index to index my files, 
>> currently
>> it indexes filepath and contents. I want to index, lastModified() 
>> (Returns
>> the time that the file denoted by this abstract pathname was last
>> modified.), and file length, length().
>> Can someone please show me how to do that? I am not too strong with 
>> Java,
>> some example code would be nice!
>> TIA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message