ceyesuma -4 Posting Pro

Hello.
I am not sure how this is supposed to work. I need to find a file that will be in
a folder data/gm in my package. If I move the program around is there a way to have the
program find its new absolute path .getAbsolutePath() from its path
relative to the program package?

This one works but if it were on a disk on someone elses computer. What's up with that?

public final String DATASOURCEDIR="C:"+File.separator+"Users"+File.separator+"Documents"+File.separator+File.separator+"netbeans"+File.separator+"gmInstall"+File.separator+"target_gmInstall"+File.separator+"gmInstall"+File.separator+"data"+File.separator+"gm";

can I work with DATASOURCEDIR to make it work no matter where the program is?

//public final String DATASOURCEDIR = "data"+File.separator +"gm";

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.