taylor 2004/08/16 22:53:37
Modified: portal/src/java/org/apache/jetspeed Jetspeed.java
portal/src/java/org/apache/jetspeed/util/descriptor
PortletApplicationWar.java
Log:
NPE checks
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.7 +5 -1
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/Jetspeed.java
Index: Jetspeed.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/Jetspeed.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Jetspeed.java 20 Jul 2004 13:46:59 -0000 1.6
+++ Jetspeed.java 17 Aug 2004 05:53:37 -0000 1.7
@@ -107,6 +107,10 @@
*/
public static String getRealPath(String path)
{
+ if (engine == null)
+ {
+ return null;
+ }
return engine.getRealPath(path);
}
1.18 +14 -12
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java
Index: PortletApplicationWar.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- PortletApplicationWar.java 16 Aug 2004 21:28:52 -0000 1.17
+++ PortletApplicationWar.java 17 Aug 2004 05:53:37 -0000 1.18
@@ -516,19 +516,21 @@
if(rewriter.isPortletTaglibAdded())
{
//add portlet tag lib to war
- File portletTaglibDir = new
File(Jetspeed.getRealPath("WEB-INF/tld"));
- File child = new File(warStruct.getRootDirectory(), "WEB-INF/tld");
- DirectoryHelper dh = new DirectoryHelper(child);
- dh.copyFrom(portletTaglibDir, new FileFilter(){
+ String path = Jetspeed.getRealPath("WEB-INF/tld");
+ if (path != null)
+ {
+ File portletTaglibDir = new File(path);
+ File child = new File(warStruct.getRootDirectory(),
"WEB-INF/tld");
+ DirectoryHelper dh = new DirectoryHelper(child);
+ dh.copyFrom(portletTaglibDir, new FileFilter(){
- public boolean accept(File pathname)
- {
- return pathname.getName().indexOf("portlet.tld") != -1;
- }
-
- });
-
- dh.close();
+ public boolean accept(File pathname)
+ {
+ return pathname.getName().indexOf("portlet.tld") != -1;
+ }
+ });
+ dh.close();
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]