org.appng.cli.commands

## Class FileOwner

- java.lang.Object
- - org.appng.cli.commands.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 Summary

    Constructors
    Constructor and Description
    `FileOwner(File file)` Create a new `FileOwner` for the given `File`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

Copyright © 2011–2023 aiticon GmbH. All rights reserved.