PILLUTLAAVINASH / google-enterprise-connector-manager

Automatically exported from code.google.com/p/google-enterprise-connector-manager
0 stars 0 forks source link

working directory undefined in servlet context #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

See below.

What is the expected output? What do you see instead?

The Context class determines file locations from the working directory. The
servlet specification doesn't specify the working directory inside of a
servlet, and depending on how Tomcat is started it might vary. The
getCommonDirPath method returns the hard-coded string
"webapps/connector-manager/WEB-INF" which is used in various places,
including the creation of the connector properties files. This isn't just
strange, since the resulting path may point to a directory that isn't writable.

In particular, we ended up with our connector properties files stored under
the $CATALINA_ROOT/bin directory (inside of a
webapps/connector-manager/WEB-INF/connectors subdirectory).

I think that the right thing to do, since the Context should have the
ServletContext available in this situation, is to call
ServletContext.getRealPath("/") to get the path to the
"webapps/connector-manager" directory, and then add "/WEB-INF". Or, more
properly, new File(realPath, "WEB-INF").getPath() or realPath +
File.separator + "WEB-INF", if you care about such niceties.

As an added bonus this avoids requiring the web application to be installed
as "connector-manager". There is at least one other occurrence of the name,
in UpdateConnector, which could easily be changed, too.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by donald.z...@gmail.com on 24 Jan 2007 at 3:27

GoogleCodeExporter commented 8 years ago
Brian, please add to backlog.

Original comment by donald.z...@gmail.com on 24 Jan 2007 at 3:28

GoogleCodeExporter commented 8 years ago
Google Bug #243988

Original comment by vjo...@gmail.com on 9 Feb 2007 at 4:25

GoogleCodeExporter commented 8 years ago
Fixed on Revision 305

Original comment by mgron...@gmail.com on 25 Apr 2007 at 8:32

GoogleCodeExporter commented 8 years ago

Original comment by mgron...@gmail.com on 3 Oct 2007 at 10:50