cutie_smily
asked on
Urgent! While creating a file on remote machine . Access denied message. Remote machine is Windows
While creating a file getting access denied message. Any clue how to change the permission so ..everybody can create and update file contents. On the remote machine folder permissions look okay.
Here is the code i am using
public String testService(String str){
File file = new File("c:\\user_uploads\\an onymous\\t est.txt");
try {
file.createNewFile();
return "created";
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("An exception Occured in testService");
return e.getMessage();
}
}
Here is the code i am using
public String testService(String str){
File file = new File("c:\\user_uploads\\an
try {
file.createNewFile();
return "created";
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("An exception Occured in testService");
return e.getMessage();
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
check the os that the user has required permissions
and as I mentioned above check for security manager
and as I mentioned above check for security manager
ASKER
If i do write below code its creating and writing
BufferedWriter outfile = new BufferedWriter(new FileWriter(file));
outfile.write("a xml string");
outfile.close();
System.out.println("File Writing");
return "created";
but i write file.createNewFile() //Access denied message.
Let me know if there is anyother way to create.
Permissions are checked on folder options they are okay and the security manger too
BufferedWriter outfile = new BufferedWriter(new FileWriter(file));
outfile.write("a xml string");
outfile.close();
System.out.println("File Writing");
return "created";
but i write file.createNewFile() //Access denied message.
Let me know if there is anyother way to create.
Permissions are checked on folder options they are okay and the security manger too
you sure file is not a directory?
System.out.println("Direct ory "+file.isDirectory());
System.out.println("Exists "+file.exists());
System.out.println("Direct
System.out.println("Exists
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:-)
ASKER
This will create a file on my local machine. When i excute on the remote machine ..it doesn't access denied meessage.
How to chaneg the permissions
Thanks