From 1d8c55dc580ea714f474d0d89b52c8e4824bdf5d Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 23 Jul 2007 16:40:09 +0000 Subject: [PATCH] refactor Storage to use getPathFrag --- lib/WebGUI/Storage.pm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index 793c74f42..9291d0c79 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -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; }