Revision: | 1.1.2.1 |
Committed: | Fri Aug 4 08:21:24 2000 UTC (24 years, 9 months ago) by williamc |
Content type: | text/plain |
Branch: | HPWbranch |
CVS Tags: | BuildSystemProto1, V0_18_0, V0_18_0model, V0_17_1, V0_18_0alpha, V0_17_0, V0_16_4, V0_16_3, V0_16_2, V0_16_1, V0_16_0, V0_15_1, V0_15_0, V0_15_0beta, V0_14_0 |
Branch point for: | V0_17branch, V0_16branch, V0_15branch |
Changes since 1.1: | +0 -0 lines |
Log Message: | Add to branch |
# | User | Rev | Content |
---|---|---|---|
1 | williamc | 1.1 | # |
2 | # standard url interface for local file - direct use no copying to cache | ||
3 | # | ||
4 | # Interface | ||
5 | # --------- | ||
6 | # new() : | ||
7 | # setbase() : | ||
8 | # unsetbase() : | ||
9 | # get(url, destination) : | ||
10 | |||
11 | package URL::URL_filed; | ||
12 | require 5.001; | ||
13 | use File::Copy; | ||
14 | use URL::URL_base; | ||
15 | @ISA=qw(URL::URL_base); | ||
16 | |||
17 | sub new { | ||
18 | my $class=shift; | ||
19 | $self={}; | ||
20 | bless $self, $class; | ||
21 | $self->{path}=""; | ||
22 | return $self; | ||
23 | } | ||
24 | |||
25 | sub setbase { | ||
26 | my $self=shift; | ||
27 | my $varhash=shift; | ||
28 | |||
29 | if ( exists $$varhash{'base'} ) { | ||
30 | $self->{path}=$$varhash{'base'}; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | sub unsetbase { | ||
35 | my $self=shift; | ||
36 | $self->{path}=""; | ||
37 | } | ||
38 | |||
39 | sub get { | ||
40 | my $self=shift; | ||
41 | my $file=shift; | ||
42 | my $dir=shift; # Were not copying anything so this is irrelevant | ||
43 | |||
44 | my $rv=""; | ||
45 | my $urlfile=$file; | ||
46 | |||
47 | if ( $file!~/^\// ) { | ||
48 | $urlfile=$self->{path}."/".$file; | ||
49 | } | ||
50 | if ( -e "$urlfile" ) { | ||
51 | $rv=$urlfile; | ||
52 | } | ||
53 | return $rv; | ||
54 | } |