/** * Identifies a given UIMA component/resource category based on its XML descriptor. If succeeded, * returns appropriate UIMA component category ID, otherwise returns <code>null</code>. If the * UIMA component category cannot be identified based on the given XML descriptor file, the * associated UIMA exception is logged and can be retrieved later by using the * <code>getLastErrorForXmlDesc()</code> method. * * @param xmlDescFile * The given component XML descriptor file. * @return UIMA component category ID or <code>null</code>, if the category cannot be identified * based on the given XML descriptor file. * @throws IOException * If any I/O exception occurred. */ public static synchronized String identifyUimaComponentCategory(File xmlDescFile) throws IOException { return identifyUimaComponentCategory(xmlDescFile, null); }
this.uimaCategory = UIMAUtil.identifyUimaComponentCategory(compDescFile); if (uimaCategory == null) { Exception err = UIMAUtil.getLastErrorForXmlDesc(compDescFile); if (err != null) { if (err instanceof UIMAException)
/** * Identifies a given UIMA component/resource category based on its XML descriptor. If succeeded, * returns appropriate UIMA component category ID, otherwise returns <code>null</code>. If the * UIMA component category cannot be identified based on the given XML descriptor file, the * associated UIMA exception is logged and can be retrieved later by using the * <code>getLastErrorForXmlDesc()</code> method. * * @param xmlDescUrl * The given component XML descriptor URL. * @return UIMA component category ID or <code>null</code>, if the category cannot be identified * based on the given XML descriptor file. * @throws IOException * If any I/O exception occurred. */ public static synchronized String identifyUimaComponentCategory(URL xmlDescUrl) throws IOException { return identifyUimaComponentCategory(null, xmlDescUrl); }
String uimaCompCtg = UIMAUtil.identifyUimaComponentCategory(xmlDescFile); if (UIMAUtil.ANALYSIS_ENGINE_CTG.equals(uimaCompCtg)) runButton.setEnabled(true);