BufferedReader reader = new BufferedReader(new InputStreamReader(configURL .openStream(), "utf-8"));
reader = new BufferedReader(new InputStreamReader(configURL.openStream(), "utf-8"));
	public Factory()	{		this.registeredClients = new ArrayList<ConnectorHelper>();		this.registeredServers = new ArrayList<ConnectorHelper>();		// Find the factory class name		String line = null;		String provider = null;		// Find the factory class name		ClassLoader cl = org.restlet.util.Factory.getClassLoader();		URL configURL;		// Register the client connector providers		try		{			for (Enumeration<URL> configUrls = cl					.getResources("META-INF/services/com.noelios.restlet.ClientHelper"); configUrls					.hasMoreElements();)			{				configURL = configUrls.nextElement();				try				{					BufferedReader reader = new BufferedReader(new InputStreamReader(configURL							.openStream(), "utf-8"));					line = reader.readLine();					while (line != null)					{						provider = getProviderClassName(line);						if ((provider != null) && (!provider.equals("")))						{							// Instantiate the factory							try							{								Class<? extends ConnectorHelper> providerClass = (Class<? extends ConnectorHelper>) Class										.forName(provider);								this.registeredClients.add(providerClass.getConstructor(										Client.class).newInstance((Client) null));							}							catch (Exception e)							{								logger.log(Level.SEVERE,										"Unable to register the client connector " + provider, e);							}						}						line = reader.readLine();					}				}				catch (Exception e)				{					logger.log(Level.SEVERE, "Unable to read the provider descriptor: "							+ configURL.toString());				}			}		}		catch (IOException ioe)		{			logger					.log(Level.SEVERE, "Exception while detecting the client connectors.", ioe);		}		// Register the server connector providers		try		{			for (Enumeration<URL> configUrls = cl					.getResources("META-INF/services/com.noelios.restlet.ServerHelper"); configUrls					.hasMoreElements();)			{				configURL = configUrls.nextElement();				try				{					BufferedReader reader = new BufferedReader(new InputStreamReader(configURL							.openStream(), "utf-8"));					line = reader.readLine();					while (line != null)					{						provider = getProviderClassName(line);						if ((provider != null) && (!provider.equals("")))						{							// Instantiate the factory							try							{								Class<? extends ConnectorHelper> providerClass = (Class<? extends ConnectorHelper>) Class										.forName(provider);								this.registeredServers.add(providerClass.getConstructor(										Server.class).newInstance((Server) null));							}							catch (Exception e)							{								logger.log(Level.SEVERE,										"Unable to register the server connector " + provider, e);							}						}						line = reader.readLine();					}				}				catch (Exception e)				{					logger.log(Level.SEVERE, "Unable to read the provider descriptor: "							+ configURL.toString());				}			}		}		catch (IOException ioe)		{			logger					.log(Level.SEVERE, "Exception while detecting the client connectors.", ioe);		}	}