public int chmod(String filename, int mode) {
return Chmod.chmod(new JavaSecuredFile(filename), Integer.toOctalString(mode));
}
public int chown(String filename, int user, int group) {
ExecIt launcher = new ExecIt(handler);
int chownResult = -1;
int chgrpResult = -1;
try {
if (user != -1) chownResult = launcher.runAndWait("chown", ""+user, filename);
if (group != -1) chgrpResult = launcher.runAndWait("chgrp ", ""+user, filename);
} catch (Exception e) {}
return chownResult != -1 && chgrpResult != -1 ? 0 : 1;
}