Index: /trunk/DataStore/lib/DataStore/FileSet/Parser.pm
===================================================================
--- /trunk/DataStore/lib/DataStore/FileSet/Parser.pm	(revision 6496)
+++ /trunk/DataStore/lib/DataStore/FileSet/Parser.pm	(revision 6497)
@@ -1,5 +1,5 @@
 # Copyright (C) 2006  Joshua Hoblitt
 #
-# $Id: Parser.pm,v 1.4 2006-02-25 00:11:19 jhoblitt Exp $
+# $Id: Parser.pm,v 1.5 2006-02-25 04:48:25 jhoblitt Exp $
 
 package DataStore::FileSet::Parser;
@@ -11,6 +11,9 @@
 $VERSION = '0.01';
 
+use base qw( Class::Accessor::Fast );
+
 use Carp qw( carp );
-use Params::Validate qw( validate_pos SCALAR);
+use Data::Validate::URI qw( is_http_uri );
+use Params::Validate qw( validate validate_pos SCALAR);
 
 my $time_field = qr/^ (\d{4})-(\d\d)-(\d\d) T (\d\d):(\d\d):(\d\d) Z $/x;
@@ -18,4 +21,6 @@
 #my %known_types = map { $_ => 1 } qw( OBJECT DOMEFLAT SKYFLAT BIAS DARK );
 my %known_types = map { $_ => 1 } qw( object domeflat skyflat bias dark );
+
+__PACKAGE__->mk_ro_accessors(qw(base_uri));
 
 =pod
@@ -58,9 +63,21 @@
     my $class = shift;
 
-    my $self = bless {}, ref $class || $class;
+    my %p = validate(@_,
+        {
+            base_uri => {
+                type        => SCALAR,
+                callbacks   => {
+                    'is valid http uri' => sub { is_http_uri($_[0]) },
+                    'uri ends with /'   => sub { $_[0] =~ m|/$| },
+                },
+                default =>  'http://example.org/',
+            },
+        },
+    );
+
+    my $self = bless \%p, ref $class || $class;
 
     return $self;
 }
-
 
 =back
@@ -138,4 +155,5 @@
             datetime    => $datetime,
             type        => $type,
+            uri         => $self->base_uri . $fileset,
         });
     } continue {
@@ -152,5 +170,5 @@
 use vars qw( @BASE_FIELDS );
 
-@BASE_FIELDS = qw( fileset datetime type );
+@BASE_FIELDS = qw( fileset datetime type uri );
 
 __PACKAGE__->mk_accessors(@BASE_FIELDS);
Index: /trunk/DataStore/t/02_fileset_parse.t
===================================================================
--- /trunk/DataStore/t/02_fileset_parse.t	(revision 6496)
+++ /trunk/DataStore/t/02_fileset_parse.t	(revision 6497)
@@ -3,5 +3,5 @@
 # Copyright (C) 2006  Joshua Hoblitt
 #
-# $Id: 02_fileset_parse.t,v 1.3 2006-02-25 00:13:36 jhoblitt Exp $
+# $Id: 02_fileset_parse.t,v 1.4 2006-02-25 04:48:25 jhoblitt Exp $
 
 use strict;
@@ -10,5 +10,5 @@
 use lib qw( ./lib ./t );
 
-use Test::More tests => 38;
+use Test::More tests => 42;
 use Test::Warn;
 
@@ -114,5 +114,8 @@
 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
 END
-    my $results = DataStore::FileSet::Parser->new->parse($example1);
+    my $parser  = DataStore::FileSet::Parser->new(
+        base_uri => 'http://foo.com/'
+    );
+    my $results = $parser->parse($example1);
 
     is(scalar @$results, 4, "correct number of item returned");
@@ -122,4 +125,5 @@
     is(@$results[0]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
     is(@$results[0]->type, 'object', 'correct type');
+    is(@$results[0]->uri, 'http://foo.com/otis0123456', 'correct uri');
 
     isa_ok(@$results[1], 'DataStore::FileSet::Record');
@@ -127,4 +131,5 @@
     is(@$results[1]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
     is(@$results[1]->type, 'object', 'correct type');
+    is(@$results[1]->uri, 'http://foo.com/otis0123456', 'correct uri');
 
     isa_ok(@$results[2], 'DataStore::FileSet::Record');
@@ -132,4 +137,5 @@
     is(@$results[2]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
     is(@$results[2]->type, 'object', 'correct type');
+    is(@$results[2]->uri, 'http://foo.com/otis0123456', 'correct uri');
 
     isa_ok(@$results[3], 'DataStore::FileSet::Record');
@@ -137,4 +143,5 @@
     is(@$results[3]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
     is(@$results[3]->type, 'object', 'correct type');
+    is(@$results[3]->uri, 'http://foo.com/otis0123456', 'correct uri');
 }
 
