You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2010/12/31 11:29:22 UTC
svn commit: r1054084 -
/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
Author: xuhaihong
Date: Fri Dec 31 10:29:21 2010
New Revision: 1054084
URL: http://svn.apache.org/viewvc?rev=1054084&view=rev
Log:
Configure the resource attributes from bundle info
Modified:
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java?rev=1054084&r1=1054083&r2=1054084&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java Fri Dec 31 10:29:21 2010
@@ -224,8 +224,18 @@ public class BundleDirContext extends Ba
}
@Override
- protected Attributes doGetAttributes(String arg0, String[] arg1) throws NamingException {
- return new ResourceAttributes();
+ protected Attributes doGetAttributes(String name, String[] attrIds) throws NamingException {
+ name = getName(name);
+ URL url = BundleUtils.getEntry(bundle, name);
+ if (url == null) {
+ return null;
+ }
+ ResourceAttributes resourceAttributes = new ResourceAttributes();
+ resourceAttributes.setLastModified(bundle.getLastModified());
+ resourceAttributes.setCreation(bundle.getLastModified());
+ resourceAttributes.setName(url.toString());
+ //TODO How to set content length ?
+ return resourceAttributes;
}
@Override