Author: dsakovich
Date: 2008-08-29 12:46:27 -0400 (Fri, 29 Aug 2008)
New Revision: 9967
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2684
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2008-08-29
14:51:12 UTC (rev 9966)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2008-08-29
16:46:27 UTC (rev 9967)
@@ -108,7 +108,15 @@
}
try {
- IFile iFile = VpeCreatorUtil.getFile(srcValue, pageContext);
+ IFile iFile = VpeCreatorUtil.getFile(srcValue, pageContext);
+ if (iFile==null || !iFile.isAccessible()) {
+ div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ ERROR_MESSAGE_STYLE);
+ nsIDOMText text = visualDocument
+ .createTextNode(RESOURCE_READING_ERROR_MESSAGE);
+ div.appendChild(text);
+ return vpeCreationData;
+ }
File file = new File(iFile.getLocation().toOSString());
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(file)));
@@ -116,8 +124,10 @@
finalStr += buf + "\n"; //$NON-NLS-1$
} catch (IOException e) {
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, ERROR_MESSAGE_STYLE);
- nsIDOMText text = visualDocument.createTextNode(RESOURCE_READING_ERROR_MESSAGE);
+ div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ ERROR_MESSAGE_STYLE);
+ nsIDOMText text = visualDocument
+ .createTextNode(RESOURCE_READING_ERROR_MESSAGE);
div.appendChild(text);
return vpeCreationData;
}