407
|
1 package IMPL::Config::Path;
|
|
2 use strict;
|
|
3 use IMPL::Config();
|
|
4
|
|
5 use IMPL::require {
|
|
6 Exception => 'IMPL::Exception',
|
|
7 OpException => '-IMPL::InvalidOperationException'
|
|
8 };
|
|
9
|
|
10 sub restore {
|
|
11 my ($self,$data,$surrogate) = @_;
|
|
12
|
|
13 die OpException->new("Invalid content") unless ref $data eq 'ARRAY' && @$data == 2;
|
|
14
|
|
15 my ($base,$path) = @$data;
|
|
16
|
|
17 my %types = (
|
|
18 appBase => 'AppDir',
|
|
19 configBase => 'ConfigDir'
|
|
20 );
|
|
21
|
|
22 my $method = $types{$base};
|
|
23
|
|
24 die OpException->new("Unsupported path type",$base) unless $method;
|
|
25
|
|
26 return IMPL::Config->$method($path);
|
|
27 }
|
|
28
|
|
29 1; |