Package java.net

Examples of java.net.URLConnection.connect()


    private long readDTM(URL url) throws Exception
    {
        URLConnection connection = url.openConnection();

        connection.connect();

        return connection.getLastModified();
    }

    private void createSynthComponentClass(String name) throws CannotCompileException,
View Full Code Here


  private static URLConnection openConnection(URL url) throws IOException {
    final URLConnection connection = url.openConnection();
    connection.setUseCaches(false);
    connection.addRequestProperty("Cache-Control", "no-cache");
    connection.connect();
    return connection;
  }

  private static void expandSingleRule
      (StringBuilder builder, String leftHandSide, String rightHandSide)
View Full Code Here

    private long readDTM(URL url) throws Exception
    {
        URLConnection connection = url.openConnection();

        connection.connect();

        return connection.getLastModified();
    }

    private void createSynthComponentClass(String name) throws CannotCompileException,
View Full Code Here

                connection.setRequestProperty ("Authorization",
                                               "Basic " + encoding);
            }

            //connect to the remote site (may take some time)
            connection.connect();
            //next test for a 304 result (HTTP only)
            if (connection instanceof HttpURLConnection) {
                HttpURLConnection httpConnection
                    = (HttpURLConnection) connection;
                if (httpConnection.getResponseCode()
View Full Code Here

  private SortedSet<String> getIANARootZoneDatabase() throws IOException {
    final SortedSet<String> TLDs = new TreeSet<String>();
    final URLConnection connection = tldFileURL.openConnection();
    connection.setUseCaches(false);
    connection.addRequestProperty("Cache-Control", "no-cache");
    connection.connect();
    tldFileLastModified = connection.getLastModified();
    BufferedReader reader = new BufferedReader
      (new InputStreamReader(connection.getInputStream(), "US-ASCII"));
    try {
      String line;
View Full Code Here

                    log.warn("Unexpected response code while validating repository ("+result+" "+con.getResponseMessage()+").  Assuming you know what you're doing.");
                }
                con.disconnect();
            } else {
                try {
                    urlConnection.connect();
                    InputStream in = urlConnection.getInputStream();
                    in.read();
                    in.close();
                } catch (IOException e) {
                    response.setRenderParameter("repoError", "Not a valid repository. No plugin list found at "+test);
View Full Code Here

            InputStreamReader reader = null;
            try
            {
                URLConnection conn = url.openConnection();
                conn.setUseCaches( false );
                conn.connect();

                reader = new InputStreamReader( conn.getInputStream() );
                InterpolationFilterReader input = new InterpolationFilterReader( reader,
                                                                                 new ContextMapAdapter( context ) );
View Full Code Here

    }

    @Override
    public InputStream getInputStream() throws IOException{
        URLConnection urlConnection = url.openConnection();
        urlConnection.connect();
        return urlConnection.getInputStream();
    }
}
View Full Code Here

                ((HttpURLConnection) connection).setInstanceFollowRedirects(false);
                ((HttpURLConnection) connection).setUseCaches(true);
                ((HttpURLConnection) connection).setConnectTimeout(5000);
            }
            // connect to the remote site (may take some time)
            connection.connect();

            // First check on a 301 / 302 (moved) response (HTTP only)
            if (connection instanceof HttpURLConnection) {
                HttpURLConnection httpConnection = (HttpURLConnection) connection;
                int responseCode = httpConnection.getResponseCode();
View Full Code Here

      try
      {
         URL u = new URL(path);
         URLConnection connection = u.openConnection();

         connection.connect();

         is = new BufferedInputStream(connection.getInputStream(), 8192);
         os = new BufferedOutputStream(new FileOutputStream(target), 8192);

         int b;
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.