Article View: borland.public.jbuilder.java.swing
Article #9783Re: finding the application path
From: Khurram Shakir
Date: Thu, 27 Jan 2000 00:00
Date: Thu, 27 Jan 2000 00:00
45 lines
2157 bytes
2157 bytes
use
File f = new File(".");
String path = f.getPath();
may this will help
regards,
Khurram
Tad Frysinger <tfrysinger@earthlink.net> wrote in message
news:388D9C91.AFBCC27@earthlink.net...
> The closest thing is a System property user.dir, but this doesn't
> necessarily equate to App.path. For your applications, why not set a
> property (use -D on the command line) in your startup called App.path?
>
> Tad Frysinger (TeamB)
>
> Alan Shiers wrote:
>
> > Hi:
> > I'm familiar with the File objects .path() and .getAbsolutePath()
> > methods, but these methods don't allow me to obtain the applications
> > path on the clients machine. In Visual Basic we have a method called
> > App.path. When I use this method call as part of a string concatination
> > App.path returns the path leading up to where the program sits on the
> > clients computer.
> > So, if myProgram is in C:\MSS\myProgram, App.path will return
> > "C:\MSS\".
> > This is how I would like to use App.path in java:
> > String st = App.path() + "text.txt";
> >
> > Result: st would equal "C:\MSS\text.txt"
> >
> > I need a method like this for Java! App.path is a very convenient
> > method, one that I use a great deal. I need to know, no matter where
> > the client installs my java program, it will be able to find it's own
> > application path within the directory structure it is in! Does anyone
> > have just such a method I can use, or is there already one in existance
> > in the API that I'm not aware of?
> >
> > Regards,
> >
> > Alan Shiers
>
Technical Details
Message-ID:
<86pbvj$quf20@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<388105F5.EB860769@istar.ca> <388D9C91.AFBCC27@earthlink.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c2ac60c7065ef2cf X-Google-Attributes: gid111d45,public From: "Khurram Shakir" <kshakir@prosys.com.pk> Subject: Re: finding the application path Date: 2000/01/27 Message-ID: <86pbvj$quf20@bornews.borland.com> X-Deja-AN: 578276967 References: <388105F5.EB860769@istar.ca> <388D9C91.AFBCC27@earthlink.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing