Class CurrentGroup

java.lang.Object
com.github.marschall.memoryfilesystem.CurrentGroup

public final class CurrentGroup extends Object
Provides access to the group of the current user.
  • Method Details

    • useDuring

      public static <V> V useDuring(GroupPrincipal group, CurrentGroup.GroupTask<V> task) throws IOException
      Sets the current group for a certain period.
      Type Parameters:
      V - the type of the return value
      Parameters:
      group - the group to use
      task - during this task the given group will be used, will be called immediately by the current thread
      Returns:
      what the task returned
      Throws:
      IOException - if any of the code in the task throws an IOException
    • useDuring

      public static void useDuring(GroupPrincipal group, CurrentGroup.VoidGroupTask task) throws IOException
      Sets the current group for a certain period.
      Parameters:
      group - the group to use
      task - during this task the given group will be used, will be called immediately by the current thread
      Throws:
      IOException - if any of the code in the task throws an IOException
      Since:
      2.4.0