+
+ /**
+ * Read a template. We first look in the storage directory. If we can't
+ * find one, we look among the resources.
+ * @param tName The name of the template.
+ * @return The contents of the template file, or an empty string.
+ */
+ private String readTemplate(String tName)
+ {
+ File templateFile = new File(VimCoder.getStorageDirectory(), tName);
+ try
+ {
+ if (templateFile.canRead()) return Util.readFile(templateFile);
+ return Util.readResource(tName);
+ }
+ catch (IOException exception)
+ {
+ return "";
+ }
+ }
+
+