org.apache.ignite.internal.processors.igfs

## Class IgfsUtils

- java.lang.Object
- - org.apache.ignite.internal.processors.igfs.IgfsUtils

    public class IgfsUtils
    extends Object

Common IGFS utility methods.

### Method Summary

Methods
`static <T> T` `doInTransactionWithRetries(IgniteInternalCache cache, IgniteOutClosureX<T> clo)` Performs an operation with transaction with retries.
`static String` `fixUserName(String user)` Provides non-null user name.
`static IgfsException` `newIgfsException(Class<? extends IgfsException> cls, String msg, Throwable cause)` Construct new IGFS exception passing specified message and cause.
`static IgfsException` `toIgfsException(Exception err)` Converts any passed exception to IGFS exception.

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

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

### Method Detail

#### toIgfsException

    public static IgfsException toIgfsException(Exception err)

Converts any passed exception to IGFS exception.

Parameters:
  `err` - Initial exception.
Returns:
  Converted IGFS exception.

#### newIgfsException

    public static IgfsException newIgfsException(Class<? extends IgfsException> cls,
                                 String msg,
                                 Throwable cause)

Construct new IGFS exception passing specified message and cause.

Parameters:
  `cls` - Class.
  `msg` - Message.
  `cause` - Cause.
Returns:
  New IGFS exception.

#### fixUserName

    public static String fixUserName(@Nullable
                     String user)

Provides non-null user name. If the user name is null or empty string, defaults to `FileSystemConfiguration.DFLT_USER_NAME`, which is the current process owner user.

Parameters:
  `user` - a user name to be fixed.
Returns:
  non-null interned user name.

#### doInTransactionWithRetries

    public static <T> T doInTransactionWithRetries(IgniteInternalCache cache,
                                   IgniteOutClosureX<T> clo)
                                        throws IgniteCheckedException

Performs an operation with transaction with retries.

Parameters:
  `cache` - Cache to do the transaction on.
  `clo` - Closure.
Returns:
  Result of closure execution.
Throws:
  `IgniteCheckedException` - If failed.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015