long resourceLastMod = 0;
InputStream resourceStream = null;
// first, see if we have a preview theme to operate from
if(resourceRequest.getThemeName() != null) {
Theme theme = resourceRequest.getTheme();
File resource = theme.getResource(resourceRequest.getResourcePath());
resourceLastMod = resource.lastModified();
resourceStream = new FileInputStream(resource);
}
// second, see if resource comes from weblog's configured shared theme
if(resourceStream == null && !Theme.CUSTOM.equals(weblog.getEditorTheme())) {
try {
ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
Theme weblogTheme = themeMgr.getTheme(weblog.getEditorTheme());
File resource = weblogTheme.getResource(resourceRequest.getResourcePath());
if(resource != null) {
resourceLastMod = resource.lastModified();
resourceStream = new FileInputStream(resource);
}
} catch (Exception ex) {