Examples of openConnection()


Examples of java.net.URL.openConnection()

            return connection;
        }

        private HttpURLConnection makePreSignedRequest(String method, String preSignedUrl, Map headers) throws IOException {
            URL url = new URL(preSignedUrl);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod(method);

            addHeaders(connection, headers);

            return connection;
View Full Code Here

Examples of java.net.URL.openConnection()

    @Override
    public DataSource invoke(DataSource msg) {
      try {
        final URL url = new URL(endpoint);
        final HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
        httpConn.setRequestMethod((String) requestContext.get(MessageContext.HTTP_REQUEST_METHOD));
        Map<String, List<String>> header = (Map<String, List<String>>)requestContext.get(MessageContext.HTTP_REQUEST_HEADERS);
        for (Map.Entry<String, List<String>> entry : header.entrySet()) {
          String value = StringUtil.join(entry.getValue(), ","); //$NON-NLS-1$
          httpConn.setRequestProperty(entry.getKey(), value);
View Full Code Here

Examples of java.net.URL.openConnection()

   {
      HTMLDocument document;
      try
      {
         URL url_ = new URL("http://www.24h.com.vn");
         document = HTMLParser.createDocument(url_.openConnection().getInputStream(), null);
         document = HTMLParser.createDocument(url_.openStream(), null);
      }
      catch (java.net.UnknownHostException e)
      {
         return;
View Full Code Here

Examples of java.net.URL.openConnection()

        final long lastModified;
        final InputStream is;
        try {
            url = getServletContext().getResource(path);
            assert (url != null);
            lastModified = url.openConnection().getLastModified();
            is = url.openStream();
        } catch (IOException e) {
            log(PrintUtils.prettyPrintStackTrace(e, -1));
            throw e;
        }
View Full Code Here

Examples of java.net.URL.openConnection()

      Vector al = null;
      ObjectInputStream inFromServlet = null;
      try {

         URL studentDBservlet = new URL( requestUrl );
         URLConnection servletConnection = studentDBservlet.openConnection();
         servletConnection.setDoInput(true);
         servletConnection.setDoOutput(true);
         servletConnection.setUseCaches (false);
         servletConnection.setRequestProperty
             ("Content-Type", "application/octet-stream");
View Full Code Here

Examples of java.net.URL.openConnection()

        + "&peer_id="   + URLEncoder.encode(new String(peerId, Constants.BYTE_ENCODING), Constants.BYTE_ENCODING).replaceAll("\\+", "%20")
        + "&port=" + port
        + "&uploaded=0&downloaded=0&left=0&numwant=50&no_peer_id=1&compact=1";
      //System.out.println(strUrl);
      URL url = new URL(strUrl);
      URLConnection con = url.openConnection();
      con.connect();
      con.getContent();
    } catch(Exception e) {
      e.printStackTrace();
    }   
View Full Code Here

Examples of java.net.URL.openConnection()

      }

      url = (URL)http_properties.get( ClientIDGenerator.PR_URL );
     
    
      HttpURLConnection con = (HttpURLConnection)url.openConnection();
     
      con.connect();
     
      ByteArrayOutputStream message = new ByteArrayOutputStream();
      InputStream is = con.getInputStream();
View Full Code Here

Examples of java.net.URL.openConnection()

        lastUpdate = mLastGroupUpdate.get(hydraGroup);
      }

      mLog.log(Level.ALL, "Loading URL : " + url.toString());

      HttpURLConnection con = (HttpURLConnection) url.openConnection();
      con.setReadTimeout(Plugin.getPluginManager().getTvBrowserSettings()
              .getDefaultNetworkConnectionTimeout());
      con.setIfModifiedSince(lastUpdate);

      int responseCode = con.getResponseCode();
View Full Code Here

Examples of java.net.URL.openConnection()

      Date testDay = testStart.addDays(b);
      String fileDate = createFileName(testDay);
      try {
        String urlString = internalChannel.getBaseUrl() + internalChannel.getId() + "_" + fileDate + ".xml.gz";
        URL url = new URL(urlString);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setReadTimeout(Plugin.getPluginManager().getTvBrowserSettings().getDefaultNetworkConnectionTimeout());
        conn.setIfModifiedSince(internalChannel.getLastUpdate(testDay));
        conn.setRequestMethod("HEAD"); // Only make a HEAD request, to
        // see if the file has been
        // changed (only get the HTTP
View Full Code Here

Examples of java.net.URL.openConnection()

                  + internalChannel.getId() + "_" + strFileDate
                  + ".xml.gz");
          URL url = new URL(internalChannel.getBaseUrl()
                  + internalChannel.getId() + "_" + strFileDate
                  + ".xml.gz");
          HttpURLConnection con = (HttpURLConnection) url
                  .openConnection();
          con.setReadTimeout(Plugin.getPluginManager()
                  .getTvBrowserSettings()
                  .getDefaultNetworkConnectionTimeout());
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.