protected static Object invokeVfsMethod(Method method, @Nullable Object target, Object... args) throws IOException {
        if (!VFS_CAN_BE_USED) {
            throw new IllegalStateException("Could not detect JBoss VFS infrastructure");
        }
        try {
            return method.invoke(target, args);
        } catch (InvocationTargetException ex) {
            Throwable targetEx = ex.getTargetException();
            if (targetEx instanceof IOException) {
                throw (IOException) targetEx;
            }
            ReflectionUtils.handleInvocationTargetException(ex);
        } catch (Exception ex) {
            ReflectionUtils.handleReflectionException(ex);
        }

        throw new IllegalStateException("Invalid code path reached");
    }
Utility for detecting and accessing JBoss VFS in the classpath.

<p>As of Spring 4.0, this class supports VFS 3.x on JBoss AS 6+
(package {@code org.jboss.vfs}) and is in particular compatible with
JBoss AS 7 and WildFly 8+.

<p>Thanks go to Marius Bogoevici for the initial patch.
<b>Note:</b> This is an internal class and should not be used outside the framework.

@author Costin Leau
@author Juergen Hoeller
@since 3.0.3
analyzer/src/main/java/nl/basjes/parse/useragent/utils/springframework/core/io/VfsUtils.java