Ignore:
Timestamp:
2013-05-06T15:29:38+12:00 (11 years ago)
Author:
jmt12
Message:

Moving the critical file-related functions (copy, rm, etc) out of util.pm into their own proper class FileUtils. Use of the old functions in util.pm will prompt deprecated warning messages. There may be further functions that could be moved across in the future, but these are the critical ones when considering supporting other filesystems (HTTP, HDFS, WebDav, etc). Updated some key files to use the new functions so now deprecated messages thrown when importing/building demo collection 'out of the box'

File:
1 edited

Legend:

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

    r23753 r27306  
    3636
    3737use ReadXMLFile;
     38use util;
     39use FileUtils;
    3840
    3941use strict;
     
    118120
    119121        my $dirname = dirname($filename_full_path);
    120         my $full_gsdl_assoc_filename = &util::filename_cat($dirname,$gsdl_assoc_file);
     122        my $full_gsdl_assoc_filename = &FileUtils::filenameConcatenate($dirname,$gsdl_assoc_file);
    121123        if ($self->{'verbosity'}>2) {
    122124            print $outhandle "  Storing block list item: $full_gsdl_assoc_filename\n";
     
    316318          {
    317319            # And if not, append it so as to make this absolute
    318             $assoc_filepath = &util::filename_cat($self->{'base_dir'}, $assoc_filepath);
     320            $assoc_filepath = &FileUtils::filenameConcatenate($self->{'base_dir'}, $assoc_filepath);
    319321          }
    320322      }
     
    331333        #rint STDERR "mime_type: $mime_type\n";
    332334        #rint STDERR "dir: $dir\n";
    333     my $real_dir = &util::filename_cat($assoc_filepath, $assoc_file),
     335    my $real_dir = &FileUtils::filenameConcatenate($assoc_filepath, $assoc_file),
    334336    my $assoc_dir = (defined $dir && $dir ne "")
    335         ? &util::filename_cat($dir, $assoc_file) : $assoc_file;
     337        ? &FileUtils::filenameConcatenate($dir, $assoc_file) : $assoc_file;
    336338    $self->{'doc_obj'}->associate_file($real_dir, $assoc_dir, $mime_type);
    337339        #rint STDERR "According to me the real assoc_filepath is: $real_dir\n";
Note: See TracChangeset for help on using the changeset viewer.