Solved

chown and chmod in java

Posted on 2006-06-25
5
2,996 Views
Last Modified: 2006-11-18
Is there a standard java api to do chown and chmod?
I really don't want to have to have to do Runtime.getRuntime().exec("chown blah /blah");
0
Comment
Question by:aturetsky
5 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 16980158
In a word, no. You'll have to do it for each OS
0
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 16980197
0
 
LVL 14

Assisted Solution

by:hoomanv
hoomanv earned 100 total points
ID: 16980229
java 1.6 suports file permissions
http://download.java.net/jdk6/docs/api/java/io/File.html

setWritable
setReadable
setExecutable
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 50 total points
ID: 16981184
Platform specific commands should be stored in a properties-file preferably and not hard-coded in the code.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17038115
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now