Package java.net

Examples of java.net.HttpURLConnection.disconnect()


          if (monitor != null) {
            monitor.setMessage(mLocalizer.msg("Progressmessage.40", "Found {0} channels, downloading channel icons...", DataHydracontainers.length));
          }

          mLastGroupUpdate.put(hydraGroup, con.getLastModified());
          con.disconnect();

          ArrayList<Channel> loadedChannels = new ArrayList<Channel>();

          for (DataHydraChannelContainer container : DataHydracontainers) {
            initializeIconLoader(hydraGroup);
View Full Code Here


    connection.setRequestMethod("PUT");
    OutputStream out = connection.getOutputStream();
    model.write(out);
    int responseCode = connection.getResponseCode();
    assertEquals(200, responseCode);
    connection.disconnect();
    Model retrievedModel = ModelFactory.createDefaultModel();
    retrievedModel.read(sourceURL.toString());
    assertTrue("Retrieved model isomorphic to equals", model.isIsomorphicWith(retrievedModel));
    webServer.stop();
View Full Code Here

    connection.setRequestMethod("PUT");
    OutputStream out = connection.getOutputStream();
    model.write(out);
    int responseCode = connection.getResponseCode();
    assertEquals(403, responseCode);
    connection.disconnect();
    webServer.stop();

  }
 
  @Override
View Full Code Here

      if (responseCode != 200) {
        log.info("Response code: "+connection.getResponseCode());
        if ((responseCode >= 300) && (responseCode < 400)) {
          String location = connection.getHeaderField(HeaderName.LOCATION.toString());
          if (location != null) {
            connection.disconnect();
            downloadSource(new SourceImpl(location));
          }
        }
       
        return;
View Full Code Here

       
        return;
      }
      downloadModel.read(connection.getInputStream(), source.getURIRef());
      store.assertGraph(source, new FCAGraphImpl(downloadModel));
      connection.disconnect();
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
    } finally {
View Full Code Here

           
            this.results = parseResults(response);
           
            System.out.println("" + response);
            connection.disconnect();

        } catch (MalformedURLException ex) {
            Logger.getLogger(RestGeoCodeApiCallWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(RestGeoCodeApiCallWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

        if (code != HttpURLConnection.HTTP_OK) {
            throw new IOException("Result code: " + code);
        }
        InputStream in = conn.getInputStream();
        String result = IOUtils.readStringAndClose(new InputStreamReader(in), -1);
        conn.disconnect();
        return result;
    }

    /**
     * Upload a file.
View Full Code Here

        if (code != HttpURLConnection.HTTP_OK) {
            throw new IOException("Result code: " + code);
        }
        in = conn.getInputStream();
        String result = IOUtils.readStringAndClose(new InputStreamReader(in), -1);
        conn.disconnect();
        return result;
    }

    void setAcceptLanguage(String acceptLanguage) {
        this.acceptLanguage = acceptLanguage;
View Full Code Here

        } catch (IOException ex) {
          Logger.getLogger(HttpMonitor.class.getName()).log(Level.SEVERE, null, ex);
        }
      }
      if (http != null) {
        http.disconnect();
       
      }
      host.setLastCheckedOn(new Date());
    }
  }
View Full Code Here

            while(true) {
              c= bufIn.read();
              if (c==-1) break;
              result+=((char)c);
            }
            httpConnection.disconnect();
      return result;
    }catch(Throwable t) {
      throw new JMHTTPConnectionException(t);
    }
   
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.