Hello,
To write to file dynamically in server, we can do following,
1) From your mail it seems that you are running server on Windows machine, thats why you are tring to get the drive ( first 3 chars).
Ok... Take that then, create a FileWriter and write everything into that one.
Assume you have a etc folder in c:\ Drive into which you want write the data ( on Server ) into a file hello.txt ... then do following....
System.out.println(System.getProperty("user.home"));
String kk=System.getProperty("user.home");
String k=kk.substring(0,3);
FileWriter fileWriter=new FileWriter(k+"etc\\Hello.txt");
String kkk="Hello";
fileWriter.write(kkk);
fileWriter.close();
It will serve your purpose. you can pass true parameter to append
More inputs welcome ....