tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Rosenberg" <Rosenbe...@crlcorp.com>
Subject Load properties file from Tomcat directory
Date Fri, 25 Jan 2013 00:21:02 GMT
Is there a to load a properties file that is dropped in the
${catalina.base}/lib directory?

 

When I try the following it returns null:

MyClass.class.getResourceAsStream(PROPERTY_FILE_NAME) 

 

I realize I can do the following, but I don't want the code to be server
specific:

props.load(new File(System.getProperty("catalina.base") + "/lib/" +
PROPERTY_FILE_NAME).toURL().openStream());

 

Thanks for the help,

Justin 

 


CONFIDENTIALITY NOTICE:
The information in this message, and any attachment, is intended for the 
sole use of the individual and entity to whom it is addressed. This 
information may be privileged, confidential, and protected from 
disclosure. If you are not the intended recipient you are hereby notified 
that you have received this communication in error and that any review, 
disclosure, dissemination, distribution or copying of it, or its contents, 
is strictly prohibited. If you think that you have received this message 
in error please notify the sender and destroy all copies of this 
communication and any attachments. Thank you.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message