Package java.net

Examples of java.net.URL.openConnection()


            }
          }else{
           
            URL source_url = new URL( url_str );
         
            job.setStream( source_url.openConnection().getInputStream());
          }
        }else{
         
          if ( device.getAlwaysCacheFiles()){
           
View Full Code Here


              }
            }else{
             
              URL source_url = new URL( url_str );
           
              URLConnection connection = source_url.openConnection();
             
              is = source_url.openConnection().getInputStream();
             
              String s = connection.getHeaderField( "content-length" );
             
View Full Code Here

             
              URL source_url = new URL( url_str );
           
              URLConnection connection = source_url.openConnection();
             
              is = source_url.openConnection().getInputStream();
             
              String s = connection.getHeaderField( "content-length" );
             
              if ( s != null ){
               
View Full Code Here

        other_params += "&sig=" + sig;
      }
     
      URL target = new URL( SERVICE_URL + "/client/" + command + "?request=" + request_str + other_params );
     
      HttpURLConnection connection = (HttpURLConnection)target.openConnection();
     
      connection.setConnectTimeout( 30*1000 );
     
      InputStream is = connection.getInputStream();
     
View Full Code Here

              "&app=" + UrlUtils.encode( SystemProperties.getApplicationName()) +
              "&locale=" + UrlUtils.encode( MessageText.getCurrentLocale().toString());
           
            URL target = new URL( SERVICE_URL + "/web/test?sid=" + sid + "&ac=" + access_code + "&format=bencode" + other_params );
           
            HttpURLConnection connection = (HttpURLConnection)target.openConnection();
           
            connection.setConnectTimeout( 10*1000 );
           
            try{
              InputStream is = connection.getInputStream();
View Full Code Here

      }
      urlString = urlString + httpHost.getInetAddress().getHostAddress()
          + ":" + httpHost.getInetSocketAddress().getPort() + httpHost.getUri();

      URL url = new URL(urlString);
      http = (HttpURLConnection) url.openConnection();
      if (httpHost.isSecure()) {
        HttpsURLConnection https = (HttpsURLConnection) http;

        makeSSLSocketFactory();
View Full Code Here

    String        str )
  {
    try{
      URL  url = new URL( str );
     
      HttpURLConnection con = (HttpURLConnection)url.openConnection();
     
      UrlUtils.setBrowserHeaders( con, null );
     
      String  key = "cn." + cn.getID() + ".identify.cookie";
     
View Full Code Here

     
      while( true ){
       
        URL  target = redirected_url==null?original_url:redirected_url;
       
        connection = (HttpURLConnection)target.openConnection();
       
        connection.setRequestProperty( "Connection", "Keep-Alive" );
        connection.setRequestProperty( "User-Agent", user_agent );
       
        for (int i=0;i<prop_names.length;i++){
View Full Code Here

              try{
                String subs_url_str = ((RSSEngine)sub.getEngine()).getSearchUrl( true );
               
                URL subs_url = new URL( subs_url_str );
               
                final byte[] vf_bytes = FileUtil.readInputStreamAsByteArray(subs_url.openConnection().getInputStream());
 
                VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile( vf_bytes );
               
                if ( MetaSearchManagerFactory.getSingleton().isImportable( vf )){
                 
View Full Code Here

    private static final int BUFFER_SIZE_IF_NO_CONTENT_LENGTH_HEADER = 1024;

    public static URLConnection httpGet(WebServer webServer, String path) throws IOException {
        URL url = new URL(webServer.getUri().toURL(), path);
        return url.openConnection();
    }

    public static URLConnection httpPost(WebServer webServer, String path, String body) throws IOException {
        URL url = new URL(webServer.getUri().toURL(), path);
        HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
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.