Examples of openConnection()


Examples of java.net.URL.openConnection()

    model.read(new File("testdata/danbri-20060920123618661.rdf").toURL()
        .toString());
    URL serverURL = new URL("http://"
        + serverBinding.getInetAddress().getHostName() + ":"
        + serverBinding.getPort() + "/danbri");
    HttpURLConnection connection = (HttpURLConnection) serverURL
        .openConnection();
    connection.setDoOutput(true);
    connection.setRequestMethod("PUT");
    OutputStream out = connection.getOutputStream();
    model.write(out);
View Full Code Here

Examples of java.net.URL.openConnection()

    Model model = ModelFactory.createDefaultModel();
    model.read(new File("testdata/danbri-20060920123618661.rdf").toURL()
        .toString());
    model = LeanDiffPatch.leanify(model);
    HttpURLConnection connection = (HttpURLConnection) sourceURL
        .openConnection();
    connection.addRequestProperty("Cookie", "login=beta:tester");
    connection.setDoOutput(true);
    connection.setRequestMethod("PUT");
    OutputStream out = connection.getOutputStream();
View Full Code Here

Examples of java.net.URL.openConnection()

    Model model = ModelFactory.createDefaultModel();
    model.read(new File("testdata/danbri-20060920123618661.rdf").toURL()
        .toString());
    model = LeanDiffPatch.leanify(model);
    HttpURLConnection connection = (HttpURLConnection) sourceURL
        .openConnection();
    connection.addRequestProperty("Cookie", "login=beta:wrong");
    connection.setDoOutput(true);
    connection.setRequestMethod("PUT");
    OutputStream out = connection.getOutputStream();
View Full Code Here

Examples of java.net.URL.openConnection()

   */
  private SliceResponse getSlice(URL remoteService, String source, Date date) {
    try {
      log.info("getting slice of " + source + " at " + date);
      URL sliceURL = getSliceURL(remoteService, source, date);
      HttpURLConnection connection = (HttpURLConnection) sliceURL
          .openConnection();
      String gvsFollowing = connection.getHeaderField("X-GVS-Following");
      Date nextFollowing = null;
      if (gvsFollowing != null) {
        StringTokenizer tokenizer = new StringTokenizer(gvsFollowing,
View Full Code Here

Examples of java.net.URL.openConnection()

  private void downloadSource(Source source) {
    log.info("Spidering: "+source);
    Model downloadModel = ModelFactory.createDefaultModel();
    try {
      URL url = new URL(source.getURIRef());
      HttpURLConnection connection = (HttpURLConnection) url.openConnection();
      connection.setInstanceFollowRedirects(false);
      connection.addRequestProperty(HeaderName.ACCEPT.toString(), "application/rdf+xml; q=1, application/xml; q=.9, text/xml; q=.8, */*; q=.1");
      connection.setReadTimeout(3000);
      connection.connect();
      int responseCode = connection.getResponseCode();
View Full Code Here

Examples of java.net.URL.openConnection()

        new ApplicationServerHandler(rootNode, "/application"),
        serverBinding);
    URL serverURL = new URL("http://"
        + serverBinding.getInetAddress().getHostAddress() + ":"
        + serverBinding.getPort() + "/application/test-dir/test-data");
    URLConnection connection = serverURL.openConnection();
    String contentType = connection.getHeaderField("Content-Type");
    assertEquals("text/plain", contentType);
    webServer.stop();

  }
View Full Code Here

Examples of java.net.URL.openConnection()


            HttpURLConnection connection;
           
            URL getUrl = new URL(URL);
            connection = (HttpURLConnection) getUrl.openConnection();
            connection.setRequestMethod("GET");
            System.out.println("Content-Type: " + connection.getContentType());

            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
View Full Code Here

Examples of java.net.URL.openConnection()

            }
            URL alturl = m_loader.getResource(path);
            if (alturl == null) {
                throw new IOException("Classpath resource not found with path '" + path + '\'');
            } else {
                return alturl.openConnection();
            }
        }
    }
}
View Full Code Here

Examples of java.net.URL.openConnection()

        InputStream in = null;
        try {
            URL url = new URL(address);
            out = new BufferedOutputStream(
                    new FileOutputStream(destination));
            conn = url.openConnection();
            in = conn.getInputStream();
            byte[] buffer = new byte[BUFFER_SIZE];
            int numRead;
            long progressCounter = 0;
            while ((numRead = in.read(buffer)) != -1) {
View Full Code Here

Examples of java.net.URL.openConnection()

       
        URL loc = device.getRootDevice().getLocation();
     
        URL  test_loc = new URL( loc.getProtocol() "://" + loc.getHost() + "/" );
       
        test_loc.openConnection().connect();
       
        return( test_loc );
       
      }catch( Throwable e ){
      }
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.