GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
URI::Nested(3) User Contributed Perl Documentation URI::Nested(3)

URI::Nested - Nested URIs

  package URI::jdbc;
  use parent 'URI::Nested';
  sub prefix       { 'jdbc' }
  sub nested_class { undef  }
  sub subprotocol  { shift->nested_uri->scheme(@_) }

  package main;
  my $jdbc_uri = URI->new('jdbc:oracle:scott/tiger@//myhost:1521/myservicename');
  my $nested_uri = $jdbc_uri->nested_uri;

This class provides support for nested URIs, where the scheme is a prefix, and the remainder of the URI is another URI. Examples include JDBC URIs <http://docs.oracle.com/cd/B14117_01/java.101/b10979/urls.htm#BEIJFHHB> and database URIs <https://github.com/theory/uri-db>.

The following differences exist compared to the "URI" class interface:

"prefix"

Returns the prefix to be used, which corresponds to the URI's scheme. Defaults to the last part of class name.

"nested_class"

Returns the URI subclass to use for the nested URI. If defined, the nested URI will always be coerced into this class if it is not naturally an instance of this class or one of its subclasses.

"new"

  my $uri = URI::Nested->new($string);
  my $uri = URI::Nested->new($string, $base);

Always returns a URI::Nested object. $base may be another URI object or string. Unlike in URI's "new()", schemes will always be applied to the URI and the nested URI if they does not already schemes. And if "nested_class" is defined, the nested URI will be coerced into that class.

"scheme"

  my $scheme = $uri->scheme;
  $uri->scheme( $new_scheme );

Gets or sets the scheme part of the URI. When setting the scheme, it must always be the same as the value returned by "prefix" or an exception will be thrown -- although the letter casing may vary. The returned value is always lowercase.

"nested_uri"

  my $nested_uri = $uri->nested_uri;

Returns the nested URI.

"abs"

  my $abs = $uri->abs( $base_uri );

Returns the URI::Nested object itself. Unlike URI's "abs()", $URI::ABS_ALLOW_RELATIVE_SCHEME is ignored.

"rel"

  my $rel = $uri->rel( $base_uri );

Returns the URI::Nested object itself.

This module is stored in an open GitHub repository <http://github.com/theory/uri-db/>. Feel free to fork and contribute!

Please file bug reports via GitHub Issues <http://github.com/theory/uri-db/issues/> or by sending mail to bug-URI-db@rt.cpan.org <mailto:bug-URI-db@rt.cpan.org>.

David E. Wheeler <david@justatheory.com>

Copyright (c) 2013 David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.