diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2007-11-11 06:55:13 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2007-11-11 06:55:13 +0000 |
| commit | 3282be229999dc36c197b264d63063a18d136331 (patch) | |
| tree | 98a42db29d955b39e7bed1b599fdcc56c3a29de9 /lib/URI/file/Base.pm | |
| parent | cfdd733c17cfa4f1a43b827a656e9e53cc2524ac (diff) | |
| download | xxv-3282be229999dc36c197b264d63063a18d136331.tar.gz xxv-3282be229999dc36c197b264d63063a18d136331.tar.bz2 | |
* Update installation list with required modules
* Remove unused/doubled provided external perl moduls
Diffstat (limited to 'lib/URI/file/Base.pm')
| -rw-r--r-- | lib/URI/file/Base.pm | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/lib/URI/file/Base.pm b/lib/URI/file/Base.pm deleted file mode 100644 index 51030c2..0000000 --- a/lib/URI/file/Base.pm +++ /dev/null @@ -1,80 +0,0 @@ -package URI::file::Base; - -use strict; -use URI::Escape qw(); - -sub new -{ - my $class = shift; - my $path = shift; - $path = "" unless defined $path; - - my($auth, $escaped_auth, $escaped_path); - - ($auth, $escaped_auth) = $class->_file_extract_authority($path); - ($path, $escaped_path) = $class->_file_extract_path($path); - - if (defined $auth) { - $auth =~ s,%,%25,g unless $escaped_auth; - $auth =~ s,([/?\#]),$URI::Escape::escapes{$1},g; - $auth = "//$auth"; - if (defined $path) { - $path = "/$path" unless substr($path, 0, 1) eq "/"; - } else { - $path = ""; - } - } else { - return undef unless defined $path; - $auth = ""; - } - - $path =~ s,([%;?]),$URI::Escape::escapes{$1},g unless $escaped_path; - $path =~ s/\#/%23/g; - - my $uri = $auth . $path; - $uri = "file:$uri" if substr($uri, 0, 1) eq "/"; - - URI->new($uri, "file"); -} - -sub _file_extract_authority -{ - my($class, $path) = @_; - return undef unless $class->_file_is_absolute($path); - return $URI::file::DEFAULT_AUTHORITY; -} - -sub _file_extract_path -{ - return undef; -} - -sub _file_is_absolute -{ - return 0; -} - -sub _file_is_localhost -{ - shift; # class - my $host = lc(shift); - return 1 if $host eq "localhost"; - eval { - require Net::Domain; - lc(Net::Domain::hostfqdn()) eq $host || - lc(Net::Domain::hostname()) eq $host; - }; -} - -sub file -{ - undef; -} - -sub dir -{ - my $self = shift; - $self->file(@_); -} - -1; |
