diff options
Diffstat (limited to 'reportbuilder/java/com/sun/star/report/StorageRepository.java')
-rw-r--r-- | reportbuilder/java/com/sun/star/report/StorageRepository.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/reportbuilder/java/com/sun/star/report/StorageRepository.java b/reportbuilder/java/com/sun/star/report/StorageRepository.java index da0c7fe9e123..b25d481ddc98 100644 --- a/reportbuilder/java/com/sun/star/report/StorageRepository.java +++ b/reportbuilder/java/com/sun/star/report/StorageRepository.java @@ -55,26 +55,31 @@ import org.apache.commons.logging.LogFactory; */ public class StorageRepository implements InputRepository, OutputRepository { + private static final Log LOGGER = LogFactory.getLog(SDBCReportDataFactory.class); private static final String REPORT_PROCESSING_FAILED = "ReportProcessing failed"; private XStorage input; private XStorage output; + private final String rootURL; /** * * @param input * @param output + * @param rootURL * @throws java.io.IOException */ - public StorageRepository(final XStorage input, final XStorage output) + public StorageRepository(final XStorage input, final XStorage output, final String rootURL) { this.input = input; this.output = output; + this.rootURL = rootURL; } - public StorageRepository(final XStorage storage, final boolean isOutput) + public StorageRepository(final XStorage storage, final boolean isOutput, final String rootURL) { + this.rootURL = rootURL; if (isOutput) { this.output = storage; @@ -150,7 +155,7 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (NoSuchElementException e) { - // We expect this exception, no need to log it. + // We expect this exception, no need to log it. } return false; } @@ -204,7 +209,7 @@ public class StorageRepository implements InputRepository, OutputRepository throw new IOException(); } final XStorage storage = (XStorage) UnoRuntime.queryInterface(XStorage.class, input.openStorageElement(temp, ElementModes.READ)); - return new StorageRepository(storage, false); + return new StorageRepository(storage, false, rootURL); } catch (NoSuchElementException ex) { @@ -254,7 +259,7 @@ public class StorageRepository implements InputRepository, OutputRepository final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, storage); prop.setPropertyValue("MediaType", mimeType); } - return new StorageRepository(storage, true); + return new StorageRepository(storage, true, rootURL); } catch (UnknownPropertyException ex) { @@ -333,8 +338,13 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (NoSuchElementException ex) { - // We expect this exception, no need to log it. + // We expect this exception, no need to log it. } return false; } + + public String getRootURL() + { + return rootURL; + } } |