Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 64081 invoked from network); 11 Jul 2010 05:35:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Jul 2010 05:35:40 -0000 Received: (qmail 61337 invoked by uid 500); 11 Jul 2010 05:35:39 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 60975 invoked by uid 500); 11 Jul 2010 05:35:36 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 60965 invoked by uid 99); 11 Jul 2010 05:35:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Jul 2010 05:35:35 +0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ralph.goers@dslextreme.com designates 209.85.212.171 as permitted sender) Received: from [209.85.212.171] (HELO mail-px0-f171.google.com) (209.85.212.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Jul 2010 05:35:25 +0000 Received: by pxi10 with SMTP id 10so1504536pxi.30 for ; Sat, 10 Jul 2010 22:34:04 -0700 (PDT) Received: by 10.142.171.7 with SMTP id t7mr14087459wfe.213.1278826444176; Sat, 10 Jul 2010 22:34:04 -0700 (PDT) Received: from [192.168.10.132] (cpe-75-82-178-177.socal.res.rr.com [75.82.178.177]) by mx.google.com with ESMTPS id f2sm3199669wfp.23.2010.07.10.22.34.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 Jul 2010 22:34:02 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: [component]commons.configuration.PropertiesConfiguration - load properties from classpath From: Ralph Goers In-Reply-To: <003601cb1fa3$4b701cc0$e2505640$@com> Date: Sat, 10 Jul 2010 22:34:00 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <9DFDC850-CA91-4C66-8BE7-8E97D07350C3@dslextreme.com> References: <4C3750D8.9000705@mailbox.hu> <4C3770F8.5020808@oliver-heger.de> <1278705036827-2284016.post@n4.nabble.com> <003601cb1fa3$4b701cc0$e2505640$@com> To: "Commons Users List" X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org In our environment we want the configuration files to reside outside the = application. In JBoss, we place the files in default/server/configs. In = our startup script we add that directory to the -cp. We use this for = commons configuration's files but also for several other things that = looke for their files in the classpath. Ralph On Jul 9, 2010, at 1:14 PM, Rashid Jilani wrote: > It depends in which context you need to load resource, web or desktop > application. >=20 > In desktop application let's say you have the root application in the = folder > Foo and there is a folder config under folder Foo where you have your > configuration file name config.xml, you can use something like this >=20 > String nativeFileSeperator =3D System.getProperty("file.separator"); > String currentDirectory =3D System.getProperty("user.dir"); > String configurationFile =3D currentDirectory + = nativeFileSeperator + > config + nativeFileSeperator + 'config.xml'; >=20 > In case of web application you can use the servletcontext. = getContextPath() > which will return the application path of the current context, then = you can > load the resources in the relative folders under the current context = path. >=20 >=20 >=20 > -----Original Message----- > From: apreg [mailto:apreg@mailbox.hu]=20 > Sent: Friday, July 09, 2010 2:51 PM > To: user@commons.apache.org > Subject: Re: [component]commons.configuration.PropertiesConfiguration = - load > properties from classpath >=20 >=20 > Yeah, you have right. I works, but what if I'd like to put my = .properties > files elsewhere not in the root of my source folder. What should I = write in > the vm arguments to accomplish this and how should I reference to the > specified .properties file from code? Sorry if I am on the wrong way. > --=20 > View this message in context: > = http://apache-commons.680414.n4.nabble.com/component-commons-configuration= -P > = ropertiesConfiguration-load-properties-from-classpath-tp2283842p2284016.ht= ml > Sent from the Commons - User mailing list archive at Nabble.com. >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org >=20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org