The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

absolute url to a properties file

Posted by Sebastien on March 06, 2001 at 4:10 PM

> Hi!

> I've got a properties file that contains username, password, etc for connecting to a database.
> Everything works fine, except that the path to this file is hardcoded.
> (ie: e:\sites\intranet\unts.....)

> I've been asked not to hard code this in, and instead use an absolute url so that the applicatin can then be moved to another server.
> In another forum, I was told you could not do this. The path had to be the way I've got it right now.

> Is this so?
> Thanks for all your help,
> Annette


You can have the absolute path of your file, if the file is at the same place of your class. Because if you write those line of code:

URL CodeBase;
CodeBase=this.getCodeBase();






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us