[greenstone-devel] Re: GLI 2.6 bug or feature?

From Michael Dewsnip
DateThu, 23 Jun 2005 11:55:51 +1200
Subject [greenstone-devel] Re: GLI 2.6 bug or feature?
In-Reply-To (Pine-GSO-4-61-0506221606200-4614-diogenis-ceid-upatras-gr)
Dear Papadimitropoulos,

Yes, you're quite right, thanks for reporting this bug. I have committed
a fix for this, similar to what you suggested but modified so it works
on both Linux and Windows.

All the best,

Michael

Papadimitropoulos Petros wrote:

> Dear list,
>
> I found a potential problem with metadata when using gli 2.6 with
> winXP. The problem appears when the names of folders of the same level
> of my collection start with the same characters. Example: i have a
> folder /magazine and underneath /magazine/article and
> magazine/article 2 (or "articlestng" or even "article stng else").
> Then gli assigns the folder level metadata of article to article 2 as
> if it were under article.
>
> Thankfully, i found an easy fix: in MetadataXmlFileManager.java i
> changed the getMetadataAssignedToFile method around in line 130 to:
>
> String filedir = file_directory.getAbsolutePath();
> String metadir = metadata_xml_file.getParentFile().getAbsolutePath();
>
> if ( filedir.startsWith(metadir) && (metadir.lastIndexOf("\")
> < filedir.lastIndexOf("\") ) )
> {
> applicable_metadata_xml_files.add(metadata_xml_file);
> }
>
> if ( filedir.equals(metadir) )
> {
> applicable_metadata_xml_files.add(metadata_xml_file);
> }
>
> so it works perfect (i think:) ) with windows.
>
> Regards
>