At Wed, 27 Feb 2002 23:12:20 -0500, Stephen Adkins wrote: > Your question seems to suggest that there should be a class > (perhaps P5EEx::Blue::UniversalResource) which has the > properties that you suggest. (On the other hand, it should > almost certainly be developed outside the P5EE namespace > because it has general value.) > > It might have a usage as follows. > > use UniversalResource; > > $uri = "http://www.officevision.com/pub/p5ee/index.html"; > $ur = UniversalResource->new($uri); > $content_type = $ur->content_type(); > $content = $ur->content(); # return the binary data > $handle = $ur->handle(); # return an IO::Handle to read the data > > $uri2 = "http://www.officevision.com/pub/p5ee/images/logo.png"; > $ur2 = UniversalResource->new($uri2); > $img = $ur->content_as_object(); # return a Perl class often used > # to operate on such data (such as "GD") > > Is this what you are getting at?
Exactly. UniversalResource->new("http://hostname/path/"); # HTTP UniversalResource->new("file://path/to/file"); # FileHandle UniversalResource->new("data:image/png;..."); # raw data (see URI::data) UniversalResource->new("ftp://user:pass@hostname/path"); # FTP Then we can handle these resource transparently with single common API. > I intend that all Entity Widgets will be identifiable by URL's so that > they can be accessed from anywhere within the network (by reference or > by value).