/** * Attemps to change the permissions of the given file and returns <code>true</code> if the <code>chmod</code> * command reported a success. * * @param file the file whose permissions are to be changed * @param permissions the new permissions, in any form accepted by the chmod command * @return true if the <code>chmod</code> command reported a success */ public static boolean chmod(AbstractFile file, String permissions) { return chmod(new AbstractFile[]{file}, permissions); }
/** * Attemps to change the permissions of the given file and returns <code>true</code> if the <code>chmod</code> * command reported a success. * * @param file the file whose permissions are to be changed * @param permissions the new permissions * @see com.mucommander.commons.file.FilePermissions * @return true if the <code>chmod</code> command reported a success */ public static boolean chmod(AbstractFile file, int permissions) { return chmod(new AbstractFile[]{file}, Integer.toOctalString(permissions)); }
/** * Attemps to change the permissions of the given files and returns <code>true</code> if the <code>chmod</code> * command reported a success. * * @param files the files whose permissions are to be changed * @param permissions the new permissions * @see com.mucommander.commons.file.FilePermissions * @return true if the <code>chmod</code> command reported a success */ public static boolean chmod(AbstractFile files[], int permissions) { return chmod(files, Integer.toOctalString(permissions)); }
boolean fileSecured = !OsFamily.getCurrent().isUnixBased() || Chmod.chmod(credentialsFile, 0600); // rw-------