/** * Returns the {@linkplain FilterFactory filter factory} singleton. * * <p><strong>NOTE:</strong> This method is not yet supported in Geotools. The default * implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public FilterFactory getFilterFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(FilterFactory.class)); }
@Override public WFSResponse createResponse(HTTPResponse response) throws IOException { final String contentType = response.getContentType(); if (contentType == null) { Logging.getLogger(WFSRequest.class) .warning( this.getOperation() + " request returned null content type for URL " + getFinalURL()); } WFSResponseFactory responseFactory; try { responseFactory = WFSExtensions.findResponseFactory(this, contentType); } catch (FactoryNotFoundException fnf) { Loggers.MODULE.log(Level.WARNING, fnf.getMessage()); try { if (contentType != null && contentType.startsWith("text")) { byte buff[] = new byte[1024]; response.getResponseStream().read(buff); Loggers.MODULE.info("Failed response snippet: " + new String(buff)); } throw fnf; } catch (Exception ignore) { throw fnf; } } WFSResponse wfsResponse = responseFactory.createResponse(this, response); return wfsResponse; }
/** * Returns the {@linkplain NameFactory name factory} singleton. * * <p><strong>NOTE:</strong> This method is not yet supported in Geotools. The default * implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public NameFactory getNameFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(NameFactory.class)); }
/** * Returns the {@linkplain CitationFactory citation factory} singleton. * * <p><strong>NOTE:</strong> This method is not yet supported in Geotools. The default * implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public CitationFactory getCitationFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(CitationFactory.class)); }
/** * Returns the {@linkplain FeatureTypeFactory feature type factory} singleton. * * <p><strong>NOTE:</strong> This method is not yet supported in Geotools. The default * implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. * @deprecated use {@link #getFeatureTypeFactory()}. * @since 2.5 */ public FeatureTypeFactory getFeatureTypeFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(FeatureTypeFactory.class)); }
/** * Returns the {@linkplain GeometryFactory geometry factory} equiped to build geometries using * the given {@linkplain CoordinateReferenceSystem coordinate reference system}. * * <p><strong>NOTE:</strong> This method is not yet supported in Geotools. The default * implementation thrown an exception in all case. * * @param crs the {@linkplain CoordinateReferenceSystem coordinate reference system} the * {@linkplain GeometryFactory geometry factory} should use. * @return the requested {@linkplain GeometryFactory geometry factory} or {@code null} if the * {@linkplain CoordinateReferenceSystem coordinate reference system} is not supported. * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public GeometryFactory getGeometryFactory(final CoordinateReferenceSystem crs) throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(GeometryFactory.class)); }
/** * Returns the {@linkplain PrimitiveFactory primitive factory} equiped to build primitives using * the given {@linkplain CoordinateReferenceSystem coordinate reference system}. * * <p><strong>NOTE:</strong> This method is not yet supported in Geotools. The default * implementation thrown an exception in all case. * * @param crs the {@linkplain CoordinateReferenceSystem coordinate reference system} the * {@linkplain PrimitiveFactory primitive factory} should use. * @return the requested {@linkplain PrimitiveFactory primitive factory} or {@code null} if the * {@linkplain CoordinateReferenceSystem coordinate reference system} is not supported. * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public PrimitiveFactory getPrimitiveFactory(final CoordinateReferenceSystem crs) throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(PrimitiveFactory.class)); } }
/** * Wraps the specified authority factories. If the specified collection contains more than one * element, then a chain of {@code FallbackAuthorityFactory} instances is created. The type is * inferred from the factories found in the collection. * * <p>Consider using <code>{@linkplain #create(Class, Collection) create}(type, factories) * </code> instead when the type is known at compile time. * * @param factories The factories to wrap, in iteration order. * @return The given factories as a chain of fallback factories. * @throws FactoryNotFoundException if the collection doesn't contains at least one element. * @since 2.4 */ public static AuthorityFactory create(final Collection<? extends AuthorityFactory> factories) throws FactoryNotFoundException { ensureNonNull("factories", factories); if (factories.isEmpty()) { throw new FactoryNotFoundException( Errors.format(ErrorKeys.FACTORY_NOT_FOUND_$1, AuthorityFactory.class)); } return create(false, interfaceMask(factories), factories.iterator()); }
/** * Wraps the specified authority factories. If the specified collection contains more than one * element, then a chain of {@code FallbackAuthorityFactory} instances is created. * * @param <T> The interface to implement. * @param type The interface to implement. Should be one of {@link DatumAuthorityFactory}, * {@link CSAuthorityFactory}, {@link CRSAuthorityFactory} or {@link * CoordinateOperationAuthorityFactory}. * @param factories The factories to wrap, in iteration order. * @return The given factories as a chain of fallback factories. * @throws FactoryNotFoundException if the collection doesn't contains at least one element. * @throws ClassCastException if {@code type} is illegal. */ public static <T extends AuthorityFactory> T create( final Class<T> type, final Collection<T> factories) throws FactoryNotFoundException, ClassCastException { ensureNonNull("type", type); ensureNonNull("factories", factories); if (factories.isEmpty()) { throw new FactoryNotFoundException(Errors.format(ErrorKeys.FACTORY_NOT_FOUND_$1, type)); } return type.cast(create(false, interfaceMask(type), factories.iterator())); }
throw new FactoryNotFoundException(null, exception);
/** * @param originatingRequest * @param contentType * @return * @throws FactoryNotFoundException */ public static WFSResponseFactory findResponseFactory( final WFSRequest originatingRequest, final String contentType) { Iterator<WFSResponseFactory> serviceProviders; serviceProviders = getServiceProviders(); WFSResponseFactory factory; while (serviceProviders.hasNext()) { factory = serviceProviders.next(); if (factory.isAvailable()) { if (factory.canProcess(originatingRequest, contentType)) { return factory; } } } throw new FactoryNotFoundException( "Can't find a response parser factory for " + originatingRequest.getOperation() + "/'" + contentType + "'"); }
debug("THROW", category, key, "could not find implementation.", null); throw new FactoryNotFoundException( Errors.format( ErrorKeys.FACTORY_NOT_FOUND_$1,