use of mondrian.olap.Util.PropertyList in project pentaho-platform by pentaho.
the class MondrianCatalogHelper method docAtUrlToString.
protected String docAtUrlToString(final String urlStr, final IPentahoSession pentahoSession) {
// String relPath = getSolutionRepositoryRelativePath(urlStr, pentahoSession);
String res = null;
InputStream in = null;
try {
LocalizingDynamicSchemaProcessor schemaProcessor = new LocalizingDynamicSchemaProcessor();
PropertyList localeInfo = new PropertyList();
// $NON-NLS-1$
localeInfo.put("Locale", getLocale().toString());
FileSystemManager fsManager = VFS.getManager();
FileObject mondrianDS = fsManager.resolveFile(urlStr);
in = mondrianDS.getContent().getInputStream();
res = schemaProcessor.filter(null, localeInfo, in);
} catch (FileNotFoundException fnfe) {
throw new MondrianCatalogServiceException(Messages.getInstance().getErrorString("MondrianCatalogHelper.ERROR_0007_FILE_NOT_FOUND"), // $NON-NLS-1$
fnfe);
} catch (Exception e) {
throw new MondrianCatalogServiceException(Messages.getInstance().getErrorString("MondrianCatalogHelper.ERROR_0006_IO_PROBLEM"), // $NON-NLS-1$
e);
} finally {
IOUtils.closeQuietly(in);
}
return res;
}
Aggregations