Ignore:
Timestamp:
2012-01-24T16:19:58+13:00 (12 years ago)
Author:
ak19
Message:
  1. Introduced the util::filepath_to_url_format subroutine which will be used to convert filenames to URL style filenames to match the slashes used in the filename regex-es in extrameta keys used to index into extrameta data structures. 2. Fixed bug on windows where metadata.xml specifies filenames as regex with backslash in front of the file extension's period mark: DirectoryPlugin needed to unregex the filepath before calling fileparse on it, else the escaping backslash would interfere with perl's fileparse routine (only on windows, since backslash also represents a dirsep here). 3. Updated all those perl plugins where the new util::filepath_to_url_format needs to be called so that they use URL style filenames (thereafter regexed) to index into the extrameta data structures.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/DSpacePlugin.pm

    r24951 r24971  
    5050use ReadTextFile;
    5151use plugin;
     52use util;
    5253use XMLParser;
    5354use strict;
     
    249250    my @fname_list = map { "(".$_->{'file'}.")" } @$fnamemime_list;
    250251    my $fname_re = join("|",@fname_list);
     252   
     253    # Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format
     254    # Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for
     255    # protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone".
     256    $fname_re = &util::filepath_to_url_format($fname_re); # just in case there are slashes in there
     257   
    251258    $fname_re =~ s/\./\\\./g;
    252259
Note: See TracChangeset for help on using the changeset viewer.