Changeset 27882

Show
Ignore:
Timestamp:
16.07.2013 21:51:50 (6 years ago)
Author:
ak19
Message:

Replacing deprecated calls to util:: subroutines with calls to FileUtils? variants.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/DSpacePlugout.pm

    r24829 r27882  
    3131eval {require bytes}; 
    3232use util; 
     33use FileUtils; 
    3334use BasePlugout; 
    3435 
     
    7475    my $docroot_attributes = "schema=\"$metadata_prefix\""; 
    7576  
    76     my $doc_dc_file = &util::filename_cat ($working_dir, $metadata_file); 
     77    my $doc_dc_file = &FileUtils::filenameConcatenate ($working_dir, $metadata_file); 
    7778    $self->open_xslt_pipe($doc_dc_file,$self->{'xslt_file'}); 
    7879 
     
    165166 
    166167    my $output_dir = $self->get_output_dir(); 
    167     &util::mk_all_dir ($output_dir) unless -e $output_dir; 
    168  
    169     my $working_dir = &util::filename_cat ($output_dir, $doc_dir);     
    170     &util::mk_all_dir ($working_dir, $doc_dir); 
     168    &FileUtils::makeAllDirectories ($output_dir) unless -e $output_dir; 
     169 
     170    my $working_dir = &FileUtils::filenameConcatenate ($output_dir, $doc_dir);     
     171    &FileUtils::makeAllDirectories ($working_dir, $doc_dir); 
    171172 
    172173    ######################### 
     
    179180        # Genereate handle file  
    180181        # (Note: this section of code would benefit from being restructured) 
    181         my $doc_handle_file = &util::filename_cat ($working_dir, "handle"); 
     182        my $doc_handle_file = &FileUtils::filenameConcatenate ($working_dir, "handle"); 
    182183     
    183184        my $env_hp = $ENV{'DSPACE_HANDLE_PREFIX'}; 
     
    196197    # save the content file 
    197198    ######################### 
    198     my $doc_contents_file = &util::filename_cat ($working_dir, "contents"); 
     199    my $doc_contents_file = &FileUtils::filenameConcatenate ($working_dir, "contents"); 
    199200     
    200201    my $outhandler =  $self->get_output_handler($doc_contents_file); 
     
    209210    # save the dublin_core.xml file 
    210211    ############################### 
    211 #      my $doc_dc_file = &util::filename_cat ($working_dir, "dublin_core.xml"); 
     212#      my $doc_dc_file = &FileUtils::filenameConcatenate ($working_dir, "dublin_core.xml"); 
    212213#      $self->open_xslt_pipe($doc_dc_file,$self->{'xslt_file'}); 
    213214 
     
    245246    } 
    246247 
    247     $self->{'short_doc_file'} =  &util::filename_cat ($doc_dir, "dublin_core.xml");  
     248    $self->{'short_doc_file'} =  &FileUtils::filenameConcatenate ($doc_dir, "dublin_core.xml");  
    248249    $self->store_output_info_reference($doc_obj); 
    249250} 
     
    258259    return if (!defined $output_dir); 
    259260 
    260     my $working_dir = &util::filename_cat($output_dir, $doc_dir); 
     261    my $working_dir = &FileUtils::filenameConcatenate($output_dir, $doc_dir); 
    261262 
    262263    my @assoc_files = (); 
     
    276277    # This test is never going to fail on Windows -- is this a problem? 
    277278    if ($source_filename !~ /^$dirsep_regexp/) { 
    278         $source_filename = &util::filename_cat($collect_dir, $source_filename); 
     279        $source_filename = &FileUtils::filenameConcatenate($collect_dir, $source_filename); 
    279280    } 
    280281    } 
     
    284285    print $handle "$tail_filename\n"; 
    285286     
    286     $filename = &util::filename_cat($working_dir, $tail_filename); 
    287     &util::hard_link ($source_filename, $filename, $self->{'verbosity'}); 
     287    $filename = &FileUtils::filenameConcatenate($working_dir, $tail_filename); 
     288    &FileUtils::hardLink ($source_filename, $filename, $self->{'verbosity'}); 
    288289              
    289290    # set the assocfile path (even if we have no assoc files - need this for lucene) 
     
    318319        } 
    319320     
    320         $filename = &util::filename_cat($working_dir, $afile); 
     321        $filename = &FileUtils::filenameConcatenate($working_dir, $afile); 
    321322         
    322323        if ($afile ne "cover.jpg") { 
    323             &util::hard_link ($real_filename, $filename, $self->{'verbosity'}); 
     324            &FileUtils::hardLink ($real_filename, $filename, $self->{'verbosity'}); 
    324325            $doc_obj->add_utf8_metadata ($doc_obj->get_top_section(), 
    325326                 "gsdlassocfile",