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/BasePlugin.pm

    r26893 r27306  
    3939use ghtml;
    4040use gsprintf 'gsprintf';
     41use util;
     42use FileUtils;
    4143
    4244use PrintInfo;
     
    447449    return if $coverfile eq $filename;
    448450   
    449     if (!&util::fd_exists($coverfile)) {
     451    if (!&FileUtils::fileExists($coverfile)) {
    450452        $coverfile =~ s/jpg$/JPG/;
    451453    }   
    452     if (&util::fd_exists($coverfile)) {
     454    if (&FileUtils::fileExists($coverfile)) {
    453455        &util::block_filename($block_hash,$coverfile);
    454456    }
     
    14181420    my $top_section=$doc_obj->get_top_section();
    14191421
    1420     if (&util::fd_exists($upgraded_filename)) {
     1422    if (&FileUtils::fileExists($upgraded_filename)) {
    14211423    $doc_obj->associate_source_file($filename);
    14221424        $doc_obj->associate_file($filename, "cover.jpg", "image/jpeg");
     
    14291431    $upgraded_upper_filename =~ s/jpg$/JPG/;
    14301432
    1431     if (&util::fd_exists($upgraded_upper_filename)) {
     1433    if (&FileUtils::fileExists($upgraded_upper_filename)) {
    14321434        $doc_obj->associate_source_file($upper_filename);
    14331435        $doc_obj->associate_file($upper_filename, "cover.jpg",
Note: See TracChangeset for help on using the changeset viewer.