How to access a file in a dynamic web project in eclipse using relative path?


tdowg1
7/5/2016 5:43 am
HOME ยป Web Development

I have a dynamic web project in eclipse. I have created a configuration folder that you can seen in the image. Inside that folder, exists a file named config.properties. Now I want to access this file using FileInputStream, but i am unable to read it by using relative path. I am reading this file from a class which is inside the Java Resources folder -> src -> package. Please help me to get the relative path of this properties file. Additionally if you could tell how this relative path works in this kind of projects,]]that would be great.

enter image description
here


Related to : How to access a file in a dynamic web project in eclipse using relative path?
How to access a file in a dynamic web project in eclipse using relative path?
7/5/2016 5:43 am by tdowg1 in Web Development

I have a dynamic web project in eclipse. I have created a configuration folder that you can seen in the image. Inside that folder, exists a file named config.properties. Now I want to access this file using FileInputStream, but i am unable to read it by using relative path. I am read


Eclipse git getting wrong relative path on file
by aShufflinZombie in Web Development

I am trying to add and commit two files to a github repo using the git extension to eclipse. I have been using this repo setup without issue for several weeks.


I just tried to add the file set_player_info.xml to the repo, but Egit is getting the wrong relative path to the file (see p


How do I import the msbuildcommunitytasks project from another msbuild project with a relative file path?
by chuck1723 in Web Development

Please go easy I am new to msbuild and msbuildtasks!


How can I set a property which represents a relative file path to a targets file which I want to import? I need relative references so it will work on all dev machines. But the target for import is trying to use the relative file


Eclipse CDT Can't Find include file unless full relative path is used
by Topweasel in Web Development

I've been using Eclipse for a while and this has me stymied. I created a library name ITS8410_LIB a few weeks ago and then let it sit while I worked on a supporting library called Reach_Lib. The directory include paths I added back when I first created the project work fine. Today I finished Reac


Eclipse project can not reference a file using relative paths
by swilli89 in Web Development

My file is located under the src directory. However, when I try to call it using "src/readme.txt" the file is not found.
In fact, it states that java is looking for "C:Documents and settingsjohnMy DocumentsDownloadseclipse-win32eclipsecoolCarsProjectsrc
eadme.txt".


How do I


How to get the file relative path in c# service project?
by glenn1 in Web Development
I have this code:Stream stream = new StreamReader("~/quartz.xml").BaseStream;Q1:What is the "~" symbol specify path in C#?Q2:How to get the "~" directory in C# service project? Q3:Does it mean the bin exe directory or project name directory?The quartz.xml file in my Windows service project located i
How to read text file from relative path in a project?
by ponchopilate in Web Development

I have a project with 2 packages:


tkorg.idrs.core.searchengines
tkorg.idrs.core.searchengines

In package (2) I have a text file ListStopWords.txt, in package (1) I have a class FileLoadder. Here is code in FileLoader


how to execute a batch file using a relative path added to the project
by xetrill in Web Development

i have created a batch file and have added it to the project using add items. Basically what i am aiming at is to execute this file on a button click action.
I am using System.Diagnostics.Process.Start("hello.bat") command to run this file
i have changed the build action to resource fo


Reference XSLT-file using a project relative way (instead of an absolute path)
by tonix in Web Development

The file at xsltFileName is in my project WebSite2 (at the root-level of the project). I currently use an absolute path to get the XSLT file name:


XslCompiledTransform xslt = new XslCompiledTransform();
String xsltFileName = "file:///C:Documents and SettingskentlMy DocumentsVi
Access project build path through an eclipse plugin
by docp in Web Development

I need to programmatically check if a project's build path already contains a specified library. It's for a quick fix proposal, to know if this was already "fixed" and cannot be the problem.


I have access to the current IInvocationContext, and therefore (around some corne


Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .