public void send(HttpExchange exchange) throws IOException { boolean ssl = HttpSchemes.HTTPS_BUFFER.equalsIgnoreCase(exchange.getScheme()); HttpDestination destination = getDestination(exchange.getAddress(), ssl); destination.send(exchange); }
HttpDestination destination=_destination.getHttpClient().getDestination(_exchange.getAddress(),isHttps); Address address = _exchange.getAddress(); int port = address.getPort(); StringBuilder hostHeader = new StringBuilder( 64 );
private boolean checkExists( String uri ) throws IOException { if (uri == null) { System.out.println("have failed miserably"); return false; } PropfindExchange propfindExchange = new PropfindExchange(); propfindExchange.setAddress( _exchange.getAddress() ); propfindExchange.setMethod( HttpMethods.GET ); // PROPFIND acts wonky, just use get propfindExchange.setScheme( _exchange.getScheme() ); propfindExchange.setEventListener( new SecurityListener( _destination, propfindExchange ) ); propfindExchange.setConfigureListeners( false ); propfindExchange.setRequestURI( uri ); _destination.send( propfindExchange ); try { propfindExchange.waitForDone(); return propfindExchange.exists(); } catch ( InterruptedException ie ) { LOG.ignore( ie ); return false; } }
private boolean makeCollection( String uri ) throws IOException { MkcolExchange mkcolExchange = new MkcolExchange(); mkcolExchange.setAddress( _exchange.getAddress() ); mkcolExchange.setMethod( "MKCOL " + uri + " HTTP/1.1" ); mkcolExchange.setScheme( _exchange.getScheme() ); mkcolExchange.setEventListener( new SecurityListener( _destination, mkcolExchange ) ); mkcolExchange.setConfigureListeners( false ); mkcolExchange.setRequestURI( uri ); _destination.send( mkcolExchange ); try { mkcolExchange.waitForDone(); return mkcolExchange.exists(); } catch ( InterruptedException ie ) { LOG.ignore( ie ); return false; } }
private boolean checkWebdavSupported() throws IOException { WebdavSupportedExchange supportedExchange = new WebdavSupportedExchange(); supportedExchange.setAddress( _exchange.getAddress() ); supportedExchange.setMethod( HttpMethods.OPTIONS ); supportedExchange.setScheme( _exchange.getScheme() ); supportedExchange.setEventListener( new SecurityListener( _destination, supportedExchange ) ); supportedExchange.setConfigureListeners( false ); supportedExchange.setRequestURI( _exchange.getURI() ); _destination.send( supportedExchange ); try { supportedExchange.waitTilCompletion(); return supportedExchange.isWebdavSupported(); } catch (InterruptedException ie ) { LOG.ignore( ie ); return false; } }