Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Path Problem!!!!
Path Problem!!!! [message #186019] Fri, 01 July 2005 04:17 Go to next message
Eclipse UserFriend
Originally posted by: gautamn.iitk.ac.in

Hi,
regarding my path problem I post the message last week...but the
solution doen't work....

/*********************************************************** ***************/
IFile file = ((IFileEditorInput)input).getFile();
String fullPath = file.getLocation( ).toOSString( )
if you through the FileDialog ,code example
FileDialog fileChooser = new FileDialog( getShell( ), SWT.OPEN );
String fullPath = fileChooser.open( );
/*********************************************************** ***************/

Actually I want to read a xml file that may be anywhere along with source
code... I am exporting this project in the workspace...Suppose src file
are in "C:/kuda/myproject/src/myxml.xml" and I have eclipse installed in
D:/ drive.
How can I read this xml file in my code (How can I get the path???)
Regards,
Nitin.
Re: Path Problem!!!! [message #186035 is a reply to message #186019] Fri, 01 July 2005 05:27 Go to previous messageGo to next message
Dazhen Gao is currently offline Dazhen GaoFriend
Messages: 21
Registered: July 2009
Junior Member
Can't you open a dialog?
FileDialog fileChooser = new FileDialog( getShell( ), SWT.OPEN );
String fullPath = fileChooser.open( );
FileInputStream stream = new FileInputStream(filename)
//read the file.

"Nitin Gautam" <gautamn@iitk.ac.in> wrote in message
news:d2baf21edf52ada1183e3ed473080cc6$1@www.eclipse.org...
> Hi,
> regarding my path problem I post the message last week...but the solution
> doen't work....
>
> /*********************************************************** ***************/
> IFile file = ((IFileEditorInput)input).getFile();
> String fullPath = file.getLocation( ).toOSString( )
> if you through the FileDialog ,code example
> FileDialog fileChooser = new FileDialog( getShell( ), SWT.OPEN );
> String fullPath = fileChooser.open( );
> /*********************************************************** ***************/
>
> Actually I want to read a xml file that may be anywhere along with source
> code... I am exporting this project in the workspace...Suppose src file
> are in "C:/kuda/myproject/src/myxml.xml" and I have eclipse installed in
> D:/ drive.
> How can I read this xml file in my code (How can I get the path???)
> Regards,
> Nitin.
>
>
>
>
>
>
>
Re: Path Problem!!!! [message #186059 is a reply to message #186035] Fri, 01 July 2005 08:57 Go to previous message
Eclipse UserFriend
Originally posted by: gautamn.iitk.ac.in

Can't you open a dialog?
FileDialog fileChooser = new FileDialog( getShell( ), SWT.OPEN );
String fullPath = fileChooser.open( );
FileInputStream stream = new FileInputStream(filename)
//read the file.


no i can't use a dialog...i have to read in one of code files using File
Class.
I need to find the path becuase just providing filename is not working and
inorder to make it work i have to put it in eclipse folder.
Regards,
Nitin.
Previous Topic:Parent-Child relationship!!!
Next Topic:Refreshing the Properties view
Goto Forum:
  


Current Time: Thu Dec 12 20:19:16 GMT 2024

Powered by FUDForum. Page generated in 0.03223 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top