Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Accessing files in other projects in xtext(Accessing files in other projects in xtext)
icon5.gif  Accessing files in other projects in xtext [message #1120906] Mon, 30 September 2013 04:26 Go to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi all,
My doubt is not so specific to xtext but I am facing this problem in xtext projects, So I would like to explain it.
I have 2 diffrent xtext projects created (Say ProjectAdsl and ProjectBdsl).

I have a file named "Sample.txt" in resources folder of ProjectBdsl and I want to read/append to it at Runtime from a java class, say FileReadWrite.java present in src-> somePackage of ProjectAdsl.
I am developing this in ECLIPSE KEPLER.
So I am not getting the correct relative path that I need to specify.

AND ONE MORE THING I CANNOT ADD DEPENDENCY BETWEEN THESE PROJECTS AS IT WOULD AFFECT SOME OTHER PART.

The work that I have done:
If it was a sample java project then:
"../ProjectBdsl/resources/Sample.txt" would work pefectly fine for me.

And if it was an eclipse RCP project then creating URL and then File Object would work for me, something like:
URL fileURL = new URL("platform:/ProjectBdsl/resources/Sample.txt"));
InputStream is = fileURL.openConnection().getInputStream();

But for my Xtext projects I tried many things, it always throws me FILENOTFOUND exception.

Can anyone help me out with this ???

Thanks in advance Smile





Arshad
Re: Accessing files in other projects in xtext [message #1121157 is a reply to message #1120906] Mon, 30 September 2013 10:26 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i think you have to digg into org.eclipse.xtext.ui.containers.WorkspaceProjectsStateHelper


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Conflicting keywords and ID rules
Next Topic:SortBy in xtend
Goto Forum:
  


Current Time: Wed Apr 24 23:53:47 GMT 2024

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

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

Back to the top