/** * Creates a URI form the given path, or returns {@code null} if the given URL is null or can not be parsed. * In the later case, a warning will be emitted. */ private URI createURI(final String url) { if (url != null) try { return new URI(url); } catch (URISyntaxException e) { warning(e); } return null; }
/** * Creates a URI form the given path, or returns {@code null} if the given URL is null or can not be parsed. * In the later case, a warning will be emitted. */ private URI createURI(final String url) { if (url != null) try { return new URI(url); } catch (URISyntaxException e) { warning(e); } return null; }
/** * Returns the enumeration constant for the given name, or {@code null} if the given name is not recognized. * In the later case, this method emits a warning. */ private <T extends Enum<T>> T forEnumName(final Class<T> enumType, final String name) { final T code = Types.forEnumName(enumType, name); if (code == null && name != null) { warning(Errors.Keys.UnknownEnumValue_2, enumType, name, null); } return code; }
/** * Returns the converter from the given source unit (which may be {@code null}) to the * given target unit, or {@code null} if none or incompatible. */ private UnitConverter getConverterTo(final Unit<?> source, final Unit<?> target) { if (source != null) try { return source.getConverterToAny(target); } catch (IncommensurableException e) { warning(e); } return null; }
/** * Returns the code value for the given name, or {@code null} if the given name is not recognized. * In the later case, this method emits a warning. */ private <T extends CodeList<T>> T forCodeName(final Class<T> codeType, final String name) { final T code = Types.forCodeName(codeType, name, false); if (code == null && name != null) { /* * CodeLists are not enums, but using the error message for enums is not completly wrong since * if we did not allowed CodeList to create new elements, then we are using it like an enum. */ warning(Errors.Keys.UnknownEnumValue_2, codeType, name, null); } return code; }
max = c.convert(max); } catch (ParserException | IncommensurableException e) { warning(e);
hasExtent = true; } catch (UnsupportedOperationException e) { warning(e);
hasExtent = true; } catch (UnsupportedOperationException e) { warning(e);
} catch (MetadataStoreException e) { addFormatName(NetcdfStoreProvider.NAME); warning(e);