troubleshooting Question

what is the way to get get path dynamically as I am getting Getting java.io.FilenotFoundException while using FileStream

Avatar of satmisha
satmishaFlag for India asked on
Java
4 Comments1 Solution97 ViewsLast Modified:
Hi Experts,

I am trying to read text file which works great on my local but when I deploy it on server it creates problem because the path on server is different as that of my local.

My Local Path:
   C:\Folder1\Project\File.txt
Server Path:
 C:\F1\F2\F3\F4\Project\File.txt

So in code I have used like this:
 Java.IO.FileINputStream.open +  new FileInputStream("./Project/File.txt")

It works great on my local but fails when I deploy it on server, reason is path.

Is there any way I could make it dynamic so that it could itself detect the right path ?

Looking forward to hearing from you.
ASKER CERTIFIED SOLUTION
mccarl
IT Business Systems Analyst / Software Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2015

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros