com.mucommander.file.util
Class Chmod

java.lang.Object
  extended by com.mucommander.file.util.Chmod

public class Chmod
extends java.lang.Object

This class is a gateway to the chmod UNIX command. It provides static methods that allow to change a file's permissions, overcoming the limitations of java.io.File.

The chmod command is available only under UNIX-based systems -- a call to any of this class' methods under other OS will likely fail.

Author:
Maxence Bernard
See Also:
FilePermissions

Constructor Summary
Chmod()
           
 
Method Summary
static boolean chmod(AbstractFile[] files, int permissions)
          Attemps to change the permissions of the given files and returns true if the chmod command reported a success.
static boolean chmod(AbstractFile[] files, java.lang.String permissions)
          Attemps to change the permissions of the given files and returns true if the chmod command reported a success.
static boolean chmod(AbstractFile file, int permissions)
          Attemps to change the permissions of the given file and returns true if the chmod command reported a success.
static boolean chmod(AbstractFile file, java.lang.String permissions)
          Attemps to change the permissions of the given file and returns true if the chmod command reported a success.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chmod

public Chmod()
Method Detail

chmod

public static boolean chmod(AbstractFile file,
                            int permissions)
Attemps to change the permissions of the given file and returns true if the chmod command reported a success.

Parameters:
file - the file whose permissions are to be changed
permissions - the new permissions
Returns:
true if the chmod command reported a success
See Also:
FilePermissions

chmod

public static boolean chmod(AbstractFile file,
                            java.lang.String permissions)
Attemps to change the permissions of the given file and returns true if the chmod command reported a success.

Parameters:
file - the file whose permissions are to be changed
permissions - the new permissions, in any form accepted by the chmod command
Returns:
true if the chmod command reported a success

chmod

public static boolean chmod(AbstractFile[] files,
                            int permissions)
Attemps to change the permissions of the given files and returns true if the chmod command reported a success.

Parameters:
files - the files whose permissions are to be changed
permissions - the new permissions
Returns:
true if the chmod command reported a success
See Also:
FilePermissions

chmod

public static boolean chmod(AbstractFile[] files,
                            java.lang.String permissions)
Attemps to change the permissions of the given files and returns true if the chmod command reported a success.

Parameters:
files - the files whose permissions are to be changed
permissions - the new permissions, in any form accepted by the chmod command
Returns:
true if the chmod command reported a success


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard