Class FileOwner


  • public class FileOwner
    extends Object
    Utility class to set the owner and group for a given File using the chown system command.
    Author:
    Matthias Müller
    See Also:
    OperatingSystem.isLinux()
    • Constructor Detail

      • FileOwner

        public FileOwner​(File file)
        Create a new FileOwner for the given File.
        Parameters:
        file - the File to set the owner and group for
    • Method Detail

      • own

        public boolean own​(String user,
                           String group)
        Set the owner and group for the File which has been passed to the constructor, using the chown system command. Works only on linux operating systems (see OperatingSystem.isLinux()).
        Parameters:
        user - the owner (user) to set
        group - the group to set
        Returns:
        true if setting the user/group was successful, false otherwise