- throws NoSuchMethodException, SecurityException,
- ClassNotFoundException, InstantiationException,
- IllegalAccessException, IllegalArgumentException,
- InvocationTargetException {
- @SuppressWarnings("rawtypes")
- Class launcherClass = Class
- .forName("be.nikiroo.jvcard.tui.TuiLauncher");
- Method start = launcherClass.getDeclaredMethod("start", new Class<?>[] {
- Boolean.class, List.class });
- start.invoke(launcherClass.newInstance(), textMode, files);
+ throws IOException, NotSupportedException {
+ try {
+ @SuppressWarnings("rawtypes")
+ Class launcherClass = Class
+ .forName("be.nikiroo.jvcard.tui.TuiLauncher");
+ Method start = launcherClass.getDeclaredMethod("start",
+ new Class<?>[] { Boolean.class, List.class });
+ start.invoke(launcherClass.newInstance(), textMode, files);
+ } catch (NoSuchMethodException e) {
+ throw new Optional().new NotSupportedException(e, "TUI", true);
+ } catch (ClassNotFoundException e) {
+ throw new Optional().new NotSupportedException(e, "TUI", false);
+ } catch (SecurityException e) {
+ throw new Optional().new NotSupportedException(e, "TUI", false);
+ } catch (InstantiationException e) {
+ throw new Optional().new NotSupportedException(e, "TUI", false);
+ } catch (IllegalAccessException e) {
+ throw new Optional().new NotSupportedException(e, "TUI", false);
+ } catch (IllegalArgumentException e) {
+ throw new Optional().new NotSupportedException(e, "TUI", false);
+ } catch (InvocationTargetException e) {
+ throw new Optional().new NotSupportedException(e, "TUI", false);
+ }