cancel
Showing results for 
Search instead for 
Did you mean: 

Path of text file which has bean created

Former Member
0 Kudos

Hi

I am trying to create a file and store some value in that

1) I am able to store that file if i dint specify any local directory path(just file name"mytext.txt").

2) But if i specify the path name like "c:/temp/myfile.txt"

it is giving error.

I want to know were will this file store in 1st case.(if i dint give any local system path )

Can any one help me.

Regards,

H.V.Swathi

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

1)//Hope you are using the same following code to create a file on server

File file = new File("c:
temp
webdynpro
web
local
yh1245_ftp
Components
com.yash.yh1245.Upload
""
"
wdContext.currentContextElement().getResource().getResourceName().toString());//creates a new file in server

FileOutputStream op = new FileOutputStream(file);

// then you can use the following code to get the path.

path = file.getAbsolutePath();

2) Second thing use double slash("
") while creating the file. That is inspite of c:\temp use c:
temp

Regards

Raghu

Former Member
0 Kudos

Thanks MadhuKiran.. Finaly i got solution.

siddharth_jain
Active Contributor
0 Kudos

Hi,

Check this thread also:

Regards,

Siddharth

Former Member
0 Kudos

Hi,

This will be stored in the following directory of your server

<Installed Drive> :\usr\sap\CE1\J00\j2ee\cluster\server0 (On my system)

Ex: C:\usr\sap\CE1\J00\j2ee\cluster\server0 (On my system)

Regards

Ayyapparaj

former_member192434
Active Contributor
0 Kudos

Hi swathi,

it is storing into your current conext ..just check your application workspcace. you will find the newly write file

when you don't specify any location of your file it will by defult goes to current directory. which is your application application workspcace.

Thanks

Anup

Edited by: Anup Bharti on Oct 13, 2008 2:05 PM

Edited by: Anup Bharti on Oct 13, 2008 2:06 PM