Examples of URLConnector


Examples of aQute.bnd.service.url.URLConnector

      bsnMap.clear();
      pkgResourceMap.clear();
     
      initialiseIndexes();
     
      final URLConnector connector = getConnector();
      IRepositoryListener listener = new IRepositoryListener() {
        public boolean processResource(Resource resource) {
          addResourceToIndex(resource);
          return true;
        }
View Full Code Here

Examples of aQute.bnd.service.url.URLConnector

      initialised = true;
    }
  }
 
  private URLConnector getConnector() {
    URLConnector connector;
    synchronized (this) {
      connector = registry != null ? registry.getPlugin(URLConnector.class) : null;
    }
    if (connector == null)
      connector = new DefaultURLConnector();
View Full Code Here

Examples of siena.remote.URLConnector

import siena.remote.URLConnector;

public class URLConnectorTest extends TestCase {
 
  public void testURLConnector() throws Exception {
    URLConnector connector = new URLConnector();
   
    Properties properties = new Properties();
    properties.setProperty("backend", "http://example.com/");
    connector.configure(properties);
   
    connector.connect();
   
    OutputStream out = connector.getOutputStream();
    out.close();
   
    InputStream in = connector.getInputStream();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
   
    byte[] buff = new byte[1024];
    int read;
    do {
      read = in.read(buff);
      if(read == -1) break;
      baos.write(buff, 0, read);
    } while(true);
   
    String s = new String(baos.toByteArray());
    assertTrue(s.indexOf("http://www.rfc-editor.org/rfc/rfc2606.txt") > 0);
   
    connector.close();
  }
View Full Code Here

Examples of siena.remote.URLConnector

   
    connector.close();
  }
 
  public void testMalformedURL() {
    URLConnector connector = new URLConnector();
   
    Properties properties = new Properties();
    properties.setProperty("backend", "hello");
    try {
      connector.configure(properties);
    } catch(SienaException e) {
      return;
    }
    fail("configure() should have been failed due to a MalformedURLException");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.