Changeset 28562

Show
Ignore:
Timestamp:
31.10.2013 11:27:57 (6 years ago)
Author:
kjdon
Message:

changing some util:: methods to FileUtils:: methods

Location:
main/trunk/greenstone2/perllib/plugouts
Files:
3 modified

Legend:

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

    r24829 r28562  
    137137    $section_fnum =~ s/\./_/g; 
    138138 
    139     my $doc_txt_file = &util::filename_cat ($working_dir,"doctxt$section_fnum.xml");     
     139    my $doc_txt_file = &FileUtils::filenameConcatenate ($working_dir,"doctxt$section_fnum.xml");     
    140140     
    141141    $self->open_xslt_pipe($doc_txt_file,$self->{'xslt_txt'}); 
     
    280280    if ($num_subsections>0) { 
    281281 
    282     my $doc_txt_file = &util::filename_cat ($working_dir,"doctoc.xml"); 
     282    my $doc_txt_file = &FileUtils::filenameConcatenate ($working_dir,"doctoc.xml"); 
    283283     
    284284    $self->open_xslt_pipe($doc_txt_file,$self->{'xslt_txt'}); 
     
    601601    if (defined $ENV{'GSDL3SRCHOME'}) { # we're dealing with a GS3 server 
    602602        if(defined $ENV{'GSDL3HOME'}) { # in case the web directory is located in a separate place 
    603         $collectparent = &util::filename_cat($ENV{'GSDL3HOME'},"sites","localsite"); 
     603        $collectparent = &FileUtils::filenameConcatenate($ENV{'GSDL3HOME'},"sites","localsite"); 
    604604        }  
    605605        else { # try the default location for the web directory 
    606         $collectparent = &util::filename_cat($ENV{'GSDL3SRCHOME'},"web","sites","localsite"); 
     606        $collectparent = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'},"web","sites","localsite"); 
    607607        } 
    608608    } 
     
    612612    } 
    613613     
    614     my $gsdl_href = &util::filename_cat($working_dir, $fname); 
     614    my $gsdl_href = &FileUtils::filenameConcatenate($working_dir, $fname); 
    615615    $collectparent = &util::filename_to_regex($collectparent); # escape reserved metacharacter \ in path (by replacing it with \\) for substitution 
    616616    $gsdl_href =~ s/^$collectparent(\/|\\)?//; # remove the collectparent path in gsdl_href and any trailing slash 
    617617    $gsdl_href =~ s/\\/\//g;                   # make sure we have url paths (which only use / not \) 
    618     my $localfedora = &util::filename_cat($ENV{'GSDL3SRCHOME'}, "packages", "tomcat", "conf", "Catalina", "localhost", "fedora.xml"); 
     618    my $localfedora = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'}, "packages", "tomcat", "conf", "Catalina", "localhost", "fedora.xml"); 
    619619     
    620620    my $greenstone_url_prefix = &util::get_greenstone_url_prefix(); 
     
    732732           if (defined $ENV{'GSDL3SRCHOME'}) { # we're dealing with a GS3 server 
    733733           if(defined $ENV{'GSDL3HOME'}) { # in case the web directory is located in a separate place 
    734                $collectparent = &util::filename_cat($ENV{'GSDL3HOME'},"sites","localsite"); 
     734               $collectparent = &FileUtils::filenameConcatenate($ENV{'GSDL3HOME'},"sites","localsite"); 
    735735           }  
    736736           else { # try the default location for the web directory 
    737                $collectparent = &util::filename_cat($ENV{'GSDL3SRCHOME'},"web","sites","localsite"); 
     737               $collectparent = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'},"web","sites","localsite"); 
    738738           } 
    739739           }           
     
    743743           } 
    744744 
    745            my $gsdl_href = &util::filename_cat($working_dir,$assfilePath); 
     745           my $gsdl_href = &FileUtils::filenameConcatenate($working_dir,$assfilePath); 
    746746           $collectparent = &util::filename_to_regex($collectparent); # escape reserved metacharacter \ in path (by replacing it with \\) for substitution 
    747747           $gsdl_href =~ s/^$collectparent(\/|\\)?//; # remove the collectparent path in gsdl_href and any trailing slash 
    748748           $gsdl_href =~ s/\\/\//g;                   # make sure we have url paths (which only use / not \) 
    749            my $localfedora = &util::filename_cat($ENV{'GSDL3SRCHOME'}, "packages", "tomcat", "conf", "Catalina", "localhost", "fedora.xml"); 
     749           my $localfedora = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'}, "packages", "tomcat", "conf", "Catalina", "localhost", "fedora.xml"); 
    750750 
    751751           my $greenstone_url_prefix = &util::get_greenstone_url_prefix(); 
  • main/trunk/greenstone2/perllib/plugouts/MARCXMLPlugout.pm

    r20962 r28562  
    3131eval {require bytes}; 
    3232use util; 
     33use FileUtils; 
    3334use BasePlugout; 
    3435use docprint; # for escape_text 
     
    103104 
    104105    my $output_dir = $self->get_output_dir(); 
    105     &util::mk_all_dir ($output_dir) unless -e $output_dir; 
     106    &FileUtils::makeAllDirectories ($output_dir) unless -e $output_dir; 
    106107     
    107     my $working_dir = &util::filename_cat ($output_dir, $doc_dir);     
    108     &util::mk_all_dir ($working_dir) unless -e $working_dir; 
     108    my $working_dir = &FileUtils::filenameConcatenate ($output_dir, $doc_dir);     
     109    &FileUtils::makeAllDirectories ($working_dir) unless -e $working_dir; 
    109110 
    110     my $output_file = util::filename_cat ($working_dir, "marc.xml"); 
     111    my $output_file = &FileUtils::filenameConcatenate ($working_dir, "marc.xml"); 
    111112  
    112113    $self->open_xslt_pipe($output_file,$self->{'xslt_file'}); 
     
    119120    $self->close_xslt_pipe();  
    120121 
    121     $self->{'short_doc_file'} = util::filename_cat ($doc_dir, "marc.xml");   
     122    $self->{'short_doc_file'} = &FileUtils::filenameConcatenate ($doc_dir, "marc.xml");   
    122123 
    123124    $self->store_output_info_reference($doc_obj);               
     
    154155 
    155156    my $output_dir = $self->get_output_dir(); 
    156     &util::mk_all_dir ($output_dir) unless -e $output_dir; 
     157    &FileUtils::makeAllDirectories ($output_dir) unless -e $output_dir; 
    157158 
    158     my $output_file = util::filename_cat($output_dir, "marc.xml"); 
     159    my $output_file = &FileUtils::filenameConcatenate($output_dir, "marc.xml"); 
    159160  
    160161    $self->open_xslt_pipe($output_file,$self->{'xslt_file'}); 
  • main/trunk/greenstone2/perllib/plugouts/METSPlugout.pm

    r22839 r28562  
    3333 
    3434eval {require bytes}; 
    35 use util; 
     35use FileUtils; 
    3636use BasePlugout; 
    3737use docprint; # for escape_text 
     
    8282    my $is_recursive = 1; 
    8383 
    84     my $doc_txt_file = &util::filename_cat ($working_dir,"doctxt.xml");  
     84    my $doc_txt_file = &FileUtils::filenameConcatenate ($working_dir,"doctxt.xml");  
    8585     
    8686    $self->open_xslt_pipe($doc_txt_file,$self->{'xslt_txt'}); 
     
    117117    my ($doc_obj,$working_dir) = @_; 
    118118 
    119     my $doc_mets_file = &util::filename_cat ($working_dir, "docmets.xml"); 
     119    my $doc_mets_file = &FileUtils::filenameConcatenate ($working_dir, "docmets.xml"); 
    120120     
    121121    my $doc_title = $doc_obj->get_metadata_element($doc_obj->get_top_section(),"dc.Title"); 
     
    161161 
    162162    my $output_dir = $self->get_output_dir(); 
    163     &util::mk_all_dir ($output_dir) unless -e $output_dir; 
    164   
    165     my $working_dir = &util::filename_cat ($output_dir, $doc_dir);               
     163    &FileUtils::makeAllDirectories ($output_dir) unless -e $output_dir; 
     164  
     165    my $working_dir = &FileUtils::filenameConcatenate ($output_dir, $doc_dir);               
    166166    
    167     &util::mk_all_dir ($working_dir) unless -e $working_dir; 
     167    &FileUtils::makeAllDirectories ($working_dir) unless -e $working_dir; 
    168168 
    169169    ### 
     
    177177    $self->saveas_docmets($doc_obj,$working_dir); 
    178178 
    179     $self->{'short_doc_file'} =  &util::filename_cat ($doc_dir, "docmets.xml"); 
     179    $self->{'short_doc_file'} =  &FileUtils::filenameConcatenate ($doc_dir, "docmets.xml"); 
    180180   
    181181    $self->store_output_info_reference($doc_obj);