[Yanel-commits] rev 26235 -
public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils
michi at wyona.com
michi at wyona.com
Tue Jul 24 09:56:10 CEST 2007
Author: michi
Date: 2007-07-24 09:56:10 +0200 (Tue, 24 Jul 2007)
New Revision: 26235
Modified:
public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/InstallInfo.java
Log:
public method in order to get install RDF filename added
Modified: public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/InstallInfo.java
===================================================================
--- public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/InstallInfo.java 2007-07-24 07:55:37 UTC (rev 26234)
+++ public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/InstallInfo.java 2007-07-24 07:56:10 UTC (rev 26235)
@@ -5,15 +5,18 @@
package org.wyona.yanel.impl.resources.updatefinder.utils;
import org.apache.log4j.Category;
+
import java.io.File;
import java.io.InputStream;
import java.io.FileInputStream;
import java.util.ArrayList;
+import javax.servlet.http.HttpServletRequest;
+
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.vocabulary.*;
import com.hp.hpl.jena.rdf.model.impl.PropertyImpl;
-import javax.servlet.http.HttpServletRequest;
+
/**
*
*/
@@ -34,7 +37,12 @@
private ArrayList protectedFiles = new ArrayList();
private String updateManagerNS = "http://www.wyona.org/update-manager/1.0#";
+
+ private File installRdfFile;
+ /**
+ *
+ */
public InstallInfo(HttpServletRequest request) throws java.io.FileNotFoundException{
String WEBINFPath = request.getSession().getServletContext().getRealPath("WEB-INF");
webappName = new File(request.getSession().getServletContext().getRealPath(".")).getParentFile().getName();
@@ -44,7 +52,8 @@
} else {
contextPrefix = contextPrefix.toLowerCase();
}
- InputStream installRdfIn = new FileInputStream(new File(WEBINFPath + File.separator + "classes" + File.separator + "install.rdf"));
+ installRdfFile = new File(WEBINFPath + File.separator + "classes" + File.separator + "install.rdf");
+ InputStream installRdfIn = new FileInputStream(installRdfFile);
Model model = ModelFactory.createDefaultModel();
//read the RDF/XML file
model.read(installRdfIn, "");
@@ -67,7 +76,8 @@
} else {
contextPrefix = contextPrefix.toLowerCase();
}
- InputStream installRdfIn = new FileInputStream(new File(webappsDirectoryPath + webapp + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + "install.rdf"));
+ installRdfFile = new File(webappsDirectoryPath + webapp + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + "install.rdf");
+ InputStream installRdfIn = new FileInputStream(installRdfFile);
Model model = ModelFactory.createDefaultModel();
//read the RDF/XML file
model.read(installRdfIn, "");
@@ -177,5 +187,11 @@
public ArrayList getProtectedFiles() {
return protectedFiles;
}
-
-}
\ No newline at end of file
+
+ /**
+ * Get filename of install RDF
+ */
+ public String getInstallRdfFilename() {
+ return installRdfFile.getAbsolutePath();
+ }
+}
More information about the Yanel-commits
mailing list