refactor Storage to use getPathFrag

This commit is contained in:
Colin Kuskie 2007-07-23 16:40:09 +00:00
parent 99d7037532
commit 1d8c55dc58

View file

@ -764,14 +764,13 @@ sub getPath {
$self->_addError("storage object malformed");
return undef;
}
my $path = $self->session->config->get("uploadsPath")
.'/'.$self->{_part1}
.'/'.$self->{_part2}
.'/'.$id;
if (defined $file) {
$path .= '/'.$file;
}
return $path;
my $path = $self->session->config->get("uploadsPath")
. '/'
. $self->getPathFrag();
if (defined $file) {
$path .= '/'.$file;
}
return $path;
}
@ -804,7 +803,9 @@ If specified, we'll return a URL to the file rather than the storage location.
sub getUrl {
my $self = shift;
my $file = shift;
my $url = $self->session->config->get("uploadsURL").'/'.$self->{_part1}.'/'.$self->{_part2}.'/'.$self->getFileId;
my $url = $self->session->config->get("uploadsURL")
. '/'
. $self->getPathFrag;
if (defined $file) {
$url .= '/'.$file;
}