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