throw new InvalidSdkException( "Error AndroidVersion: " + ignore.getMessage() );
throw new AndroidVersionException( "Invalid android API or codename " + apiOrCodename, //$NON-NLS-1$ null);
/** * Creates an {@link AndroidVersion} from {@link Properties}. The properties must contain * android version information, or an exception will be thrown. * * @throws AndroidVersion.AndroidVersionException if no Android version information have been * found */ @NonNull public static AndroidVersion create(@NonNull Properties properties) throws AndroidVersion.AndroidVersionException { Exception error = null; String apiLevel = properties.getProperty(PkgProps.VERSION_API_LEVEL, null/*defaultValue*/); if (apiLevel != null) { try { int api = Integer.parseInt(apiLevel); String codeName = properties.getProperty(PkgProps.VERSION_CODENAME, null/*defaultValue*/); return new AndroidVersion(api, codeName); } catch (NumberFormatException e) { error = e; } } // reaching here means the Properties object did not contain the apiLevel which is required. throw new AndroidVersion.AndroidVersionException(PkgProps.VERSION_API_LEVEL + " not found!", error); } }