Friday, September 25, 2009

[Java] Path - Workspace

 

Hello:

I use WID 6.1.2 Build id: 6.1.2ifix004-20090401_1943.
When I do

File file = new File("new.txt");
String absolutePathOfFirstFile = file.getAbsolutePath();
System.out.println("Folder: " + absolutePathOfFirstFile);

or

IWorkspace workspace = ResourcesPlugin.getWorkspace();
String folder= workspace.getRoot().getLocation().toFile().getPath().toString();
System.out.println("Folder: " + folder);

The result is "C:\WID612\pf\wps", the folder where I install the WID

How I get the name of the workspace folder with code java, for example "C:\myWorkspace\myProyect".?

What I really need is to open the file new.properties in the folder "C:\myWorkspace\myProyect\Resources".

Properties propiedades = new Properties();

String locationFile = ??????

FileInputStream propertiesFile = new FileInputStream(locationFile);
properties.load(propertiesFile);
String user = properties.getProperty("dataSource.username");

Any idea?

Thanks

__._,_.___
Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELY
Recent Activity
Visit Your Group
Give Back

Yahoo! for Good

Get inspired

by a good cause.

Y! Toolbar

Get it Free!

easy 1-click access

to your groups.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

No comments:

Post a Comment