[freenet-cvs] r15195 - in trunk/plugins/Echo/src/plugins/echo: . editor i18n

fred at freenetproject.org fred at freenetproject.org
Sat Sep 15 19:17:06 UTC 2007


Author: fred
Date: 2007-09-15 19:17:06 +0000 (Sat, 15 Sep 2007)
New Revision: 15195

Modified:
   trunk/plugins/Echo/src/plugins/echo/Echo.java
   trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java
   trunk/plugins/Echo/src/plugins/echo/editor/StaticPage.java
   trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java
Log:
Load the files from the jar instead of the disk

Modified: trunk/plugins/Echo/src/plugins/echo/Echo.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/Echo.java	2007-09-15 19:09:49 UTC (rev 15194)
+++ trunk/plugins/Echo/src/plugins/echo/Echo.java	2007-09-15 19:17:06 UTC (rev 15195)
@@ -84,7 +84,7 @@
 			parser = new Builder();
 			
 			Document styleSheet = parser.build(getClass().getResourceAsStream("/xml/edit2.xsl"));
-// 			Document styleSheet = parser.build("/home/fred/prog/soc/trunk/plugins/Echo/src/xml/edit.xsl");
+
 			i18n.translateXML(styleSheet);
 			transform = new XSLTransform(styleSheet);
 
@@ -184,7 +184,6 @@
 			
 			try {
 				InputStream in = getClass().getResourceAsStream("/" + fileName);
-// 				InputStream in = new FileInputStream("/home/fred/prog/soc/trunk/plugins/Echo/src/test/" + fileName);
 
 				int read;
 				int off = 0;

Modified: trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java	2007-09-15 19:09:49 UTC (rev 15194)
+++ trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java	2007-09-15 19:17:06 UTC (rev 15195)
@@ -10,7 +10,6 @@
 
 public class SiteGenerator {
 	
-// 	public static final File BASE_DIR = new File("/home/fred/Freenet/plugins/Echo");
 	public static final int POSTS_PER_PAGE = 5;
 	
 	private NodesManager nodesManager;
@@ -33,12 +32,12 @@
 		parser = new Builder();
 		
 		template = parser.build(getClass().getResourceAsStream("/xml/test.xsl"));
-// 		template = parser.build("/home/fred/prog/soc/trunk/plugins/Echo/src/xml/test.xsl");
+
 		transform = new XSLTransform(template);
 		transform.setParameter("basedir", project.getProjectDir().getAbsolutePath() + "/");
 		transform.setParameter("project-title", project.getTitle());
 
-// 		rssTransform = new XSLTransform(parser.build("/home/fred/prog/soc/trunk/plugins/Echo/src/xml/rss.xsl"));
+
 		
 		serializer = new Serializer(System.out); 
 		serializer.setIndent(4);

Modified: trunk/plugins/Echo/src/plugins/echo/editor/StaticPage.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/editor/StaticPage.java	2007-09-15 19:09:49 UTC (rev 15194)
+++ trunk/plugins/Echo/src/plugins/echo/editor/StaticPage.java	2007-09-15 19:17:06 UTC (rev 15195)
@@ -21,7 +21,8 @@
 		
 		try {
 			Builder parser = new Builder();
-			Document doc = parser.build("/home/fred/prog/soc/trunk/plugins/Echo/src/xml/" + fileName);
+			Document doc = parser.build(ClassLoader.getSystemClassLoader().getResourceAsStream("/xml/" + fileName));
+
 			I18n.translateXML(doc);
 			page.appendContent(doc.getRootElement().copy());
 

Modified: trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java	2007-09-15 19:09:49 UTC (rev 15194)
+++ trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java	2007-09-15 19:17:06 UTC (rev 15195)
@@ -60,8 +60,7 @@
 		if(props == null)
 			props = new Properties();
 		try {
-// 			props.load(ClassLoader.getSystemClassLoader().getResourceAsStream("/i18n/" + PREFIX + language + SUFFIX));
-			props.load(new FileInputStream("/home/fred/prog/soc/trunk/plugins/Echo/src/plugins/echo/i18n/" + PREFIX + language + SUFFIX));
+			props.load(ClassLoader.getSystemClassLoader().getResourceAsStream("/i18n/" + PREFIX + language + SUFFIX));
 		} catch (IOException ioe) {
 			Logger.error("I18n", "IOException while accessing the " + language +"file" + ioe.getMessage(), ioe);
 			throw new MissingResourceException("Unable to load the translation file for " + language, "i18n", language);




More information about the cvs mailing list