?
Solved

get real path

Posted on 2011-02-15
2
Medium Priority
?
411 Views
Last Modified: 2012-05-11
I had the below folder structure

Main_Project_folder
  -> Content
       -> old_content
            -> file2.txt
  -> file2.txt

i.e., in main project folder there is a folder content and a file file2.txt and in that content folder there is a folder old_content and in that there is a file with same name file2.txt

to get file2.txt
I wrote in the below way
String path= request.getRealPath("//file2.txt");

how to write for getting file2.txt in the old_content folder

I tried in the below way but it is still pointing file2.txt
String scpath = request.getRealPath("//Content//old_content//file2.txt");
0
Comment
Question by:shragi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 1000 total points
ID: 34902168
assuming main_project_folder is your apps root directory then it should be:

String scpath = request.getRealPath("Content/old_content/file2.txt");
0

Featured Post

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question