- Timestamp:
- 2013-09-10T15:37:45+12:00 (11 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/download.pm
r17527 r28250 44 44 if ($ENV{'GSDLCOLLECTDIR'}){ 45 45 46 $coldownloadname = & util::filename_cat($ENV{'GSDLCOLLECTDIR'},46 $coldownloadname = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, 47 47 "perllib","downloaders", 48 48 "${download_name}.pm"); … … 50 50 } 51 51 52 my $maindownloadname = & util::filename_cat($ENV{'GSDLHOME'},52 my $maindownloadname = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, 53 53 "perllib","downloaders", 54 54 "${download_name}.pm"); -
main/trunk/greenstone2/perllib/downloaders/MediaWikiDownload.pm
r17207 r28250 128 128 # check css files for HTML pages are downloaded as well 129 129 $self->{'url'} =~ /http:\/\/([^\/]*)\//; 130 my $base_url = & util::filename_cat($hashGeneralOptions->{"cache_dir"}, $1);130 my $base_url = &FileUtils::filenameConcatenate($hashGeneralOptions->{"cache_dir"}, $1); 131 131 &check_file($base_url, $self); 132 132 -
main/trunk/greenstone2/perllib/downloaders/OAIDownload.pm
r27012 r28250 112 112 my $tmp_dir = "$ENV{GSDLHOME}/tmp"; 113 113 if (! -e $tmp_dir) { 114 & util::mk_dir($tmp_dir);114 &FileUtils::makeDirectory($tmp_dir); 115 115 } 116 116 … … 171 171 $self->getOAIRecords($aryIDs, $strOutputDir, $strBasURL, $self->{'max_records'}, $blnDownloadDoc); 172 172 173 # my $tmp_file = & util::filename_cat($ENV{'GSDLHOME'},"tmp","oai.tmp");174 # & util::rm($tmp_file);173 # my $tmp_file = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"tmp","oai.tmp"); 174 # &FileUtils::removeFiles($tmp_file); 175 175 176 176 return 1; … … 318 318 } 319 319 320 321 my $is_page_html = 0; 322 if($id_file_ext =~ m/^html?$/i) { 323 $is_page_html = 1; 324 } elsif ($doc_id_url) { # important: if no doc id has currently been typed into the url field, skip this block 320 325 321 if ((!$primary_doc_match) && ($id_file_ext =~ m/^html?$/i)) { 326 # get the page and check the header's content-type and see if this is text/html 327 # if so, $is_page_html is true 328 # See http://superuser.com/questions/197009/wget-head-request 329 330 my $wget_opts3 = $self->getWgetOptions(); 331 my $wget_header_cmd = "$wget_opts3 -S --spider \"$doc_id_url\""; 332 my $page_content = $self->useWget($wget_header_cmd); 333 334 if($page_content && $page_content =~ m@Content-Type:\s*text/html@i) { 335 $is_page_html = 1; 336 } 337 } 338 339 if (!$primary_doc_match && $is_page_html) { 340 322 341 # Download this doc if HTML, scan through it looking for a link 323 342 # that does match get_doc_exts … … 387 406 388 407 if (-e $tmp_filename) { 389 & util::rm($tmp_filename);408 &FileUtils::removeFiles($tmp_filename); 390 409 } 391 410 } … … 474 493 ($strSubDirPath,$unused) = $self->dirFileSplit($strFileURL); 475 494 476 & util::mk_all_dir($strSubDirPath);495 &FileUtils::makeAllDirectories($strSubDirPath); 477 496 478 497 my $ds = &util::get_dirsep(); … … 559 578 560 579 #Open a temporary file to store OAI information, and store the information to the temp file 561 my $name = & util::filename_cat($ENV{GSDLHOME},"tmp","oai.tmp");580 my $name = &FileUtils::filenameConcatenate($ENV{GSDLHOME},"tmp","oai.tmp"); 562 581 563 582 open(*OAIOUT,"> $name"); -
main/trunk/greenstone2/perllib/downloaders/SRWDownload.pm
r17230 r28250 127 127 $host =~ s/http:\/\///; 128 128 $strOutputDir =~ s/"//g; #" 129 my $strOutputFile = & util::filename_cat($strOutputDir,$host,"$strFileName.xml");129 my $strOutputFile = &FileUtils::filenameConcatenate($strOutputDir,$host,"$strFileName.xml"); 130 130 131 131 # prepare subdirectory for record (if needed) 132 132 133 133 my ($strSubDirPath,$unused) = $self->dirFileSplit($strOutputFile); 134 & util::mk_all_dir($strSubDirPath);134 &FileUtils::makeAllDirectories($strSubDirPath); 135 135 136 136 print STDERR "Saving records to \"$strOutputFile\"\n"; -
main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm
r17840 r28250 238 238 } 239 239 240 my $wget_file_path = & util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wget");240 my $wget_file_path = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wget"); 241 241 $command = "\"$wget_file_path\" $cmdWget"; 242 242 #print STDOUT "Command is: $command\n"; … … 387 387 } 388 388 389 my $wget_file_path = & util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wget");389 my $wget_file_path = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wget"); 390 390 my $command = "\"$wget_file_path\" $cmdWget"; 391 391 #print STDOUT "Command is: $command\n"; … … 538 538 539 539 1; 540 -
main/trunk/greenstone2/perllib/downloaders/Z3950Download.pm
r24386 r28250 97 97 $self->{'url'} = $self->{'host'}.":".$self->{'port'}; 98 98 99 $self->{'yaz'} = & util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "yaz-client");99 $self->{'yaz'} = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "yaz-client"); 100 100 101 101 return bless $self, $class; … … 278 278 $strOutputDir =~ s/"//g; #" 279 279 280 my $strOutputFile = & util::filename_cat($strOutputDir,$self->{'host'},"$strFileName.marc");280 my $strOutputFile = &FileUtils::filenameConcatenate($strOutputDir,$self->{'host'},"$strFileName.marc"); 281 281 # prepare subdirectory for record (if needed) 282 282 my ($strSubDirPath,$unused) = $self->dirFileSplit($strOutputFile); 283 283 284 & util::mk_all_dir($strSubDirPath);284 &FileUtils::makeAllDirectories($strSubDirPath); 285 285 286 286 print STDERR "Saving records to \"$strOutputFile\"\n";
Note:
See TracChangeset
for help on using the changeset viewer.