Package java.net

Examples of java.net.URL


    }
   
    String packageListS = PACKAGE_MANAGER.getPackageRepositoryURL().toString()
    + "/packageList.txt";
    URLConnection conn = null;
    URL connURL = new URL(packageListS);

    if (PACKAGE_MANAGER.setProxyAuthentication()) {
      conn = connURL.openConnection(PACKAGE_MANAGER.getProxy());
    } else {
      conn = connURL.openConnection();
    }
   
    conn.setConnectTimeout(30000); // timeout after 30 seconds
   
    BufferedReader bi =
View Full Code Here


        }
      } else if (args[0].equals("-install-package")) {
        String targetLowerCase = args[1].toLowerCase();
        if (targetLowerCase.startsWith("http://") ||
            targetLowerCase.startsWith("https://")) {
          URL packageURL = new URL(args[1]);
          installPackageFromURL(packageURL, System.out);
        } else if (targetLowerCase.endsWith(".zip")) {
          installPackageFromArchive(args[1], System.out);
        } else {
          // assume a named package at the central repository
View Full Code Here

      null,
      null,
      m_LastURL);
  if (urlName != null) {
    m_LastURL = urlName;
    URL url = new URL(urlName);
    try {
      addUndoPoint();
    } catch (Exception ignored) {}
    setInstancesFromURL(url);
  }
View Full Code Here

     * @throws IOException Thrown when an I/O-related error occurs.
     * @throws FTPException Thrown when an FTP-protocol-related error occurs.
     */
    public static FileTransferInputStream downloadURLStream(String ftpURL)
      throws MalformedURLException, IOException, FTPException {
      URL url = new URL(ftpURL);
      if (!url.getProtocol().equals("ftp"))
        throw new MalformedURLException("Unsupported protocol: " + url.getProtocol());
      FileTransferClient client = new FileTransferClient();
    prepareURLTransfer(url, client);
      client.connect();
    return new AutoCloseFileTransferInputStream(client.downloadStream(url.getPath()), client);
    }
View Full Code Here

   * @throws IOException Thrown when an I/O-related error occurs.
   * @throws FTPException Thrown when an FTP-protocol-related error occurs.
   */
    public static void downloadURLFile(String localFileName, String ftpURL)
      throws MalformedURLException, IOException, FTPException {
    URL url = new URL(ftpURL);
    FileTransferClient client = new FileTransferClient();
    if (!url.getProtocol().equals("ftp"))
      throw new MalformedURLException("Unsupported protocol: "
          + url.getProtocol());
    prepareURLTransfer(url, client);
    client.connect();
    try {
      client.downloadFile(localFileName, url.getPath());
    } finally {
      client.disconnect();
    }
  }
View Full Code Here

   * @throws IOException Thrown when an I/O-related error occurs.
   * @throws FTPException Thrown when an FTP-protocol-related error occurs.
   */
  public static FileTransferOutputStream uploadURLStream(String ftpURL)
      throws MalformedURLException, IOException, FTPException {
    URL url = new URL(ftpURL);
    FileTransferClient client = new FileTransferClient();
    if (!url.getProtocol().equals("ftp"))
      throw new MalformedURLException("Unsupported protocol: "
          + url.getProtocol());
    prepareURLTransfer(url, client);
    client.connect();
    return new AutoCloseFileTransferOutputStream(client.uploadStream(url
        .getPath()), client);
  }
View Full Code Here

   * @throws IOException Thrown when an I/O-related error occurs.
   * @throws FTPException Thrown when an FTP-protocol-related error occurs.
   */
    public static void uploadURLFile(String localFileName, String ftpURL)
      throws MalformedURLException, IOException, FTPException {
    URL url = new URL(ftpURL);
    FileTransferClient client = new FileTransferClient();
    prepareURLTransfer(url, client);
    client.connect();
    try {
      client.uploadFile(localFileName, url.getPath());
    } finally {
      client.disconnect();
    }
  }
View Full Code Here

      {
        if (file.equalsIgnoreCase("-url"))
        {
      if (args.length > 1)
      {
        URL u = new URL(args[1]);
            Player player = new Player(new BufferedInputStream(u.openStream(), 2048));
            System.out.println("starting");
            player.play();
            System.out.println("ending");
      }
      else
View Full Code Here

      try {
      
            ServerConfig serverConfig=JBossDSPFactory.getServerConfig();
            String webServiceHost = serverConfig.getWebServiceHost();
            int webServicePort = serverConfig.getWebServicePort();
            URL url = new URL("http://" + webServiceHost + ":" + webServicePort);
            if (isWebserviceSecure) {
              int secureWebServicePort = serverConfig.getWebServicePort();
              url = new URL("https://" + webServiceHost + ":" + secureWebServicePort);
            }
            //give the user the option to override
            if (_odeConfig.getProperty(BPEL_WEBSERVICE_BASEURL)==null) {
              _odeConfig.getProperties().setProperty(BPEL_WEBSERVICE_BASEURL, url.toExternalForm());
            }
            _uddiRegistration = UDDIClientFactory.newInstance(_odeConfig.getProperties());
        } catch (Exception e) {
          __log.error(e.getMessage());
          __log.error("Continuing without UDDI integration.");
View Full Code Here

    throws Exception
  {
    BasicConfigurator.configure();
   
    HttpTool tool = new HttpTool();
    HttpDoc doc = tool.retrieveDocument(new URL("http://usul27:a1rrakis@www.atkpremium.com/members/styles/standard/pages/index.php?thispage=modelupdate&thisupdate=083735&thismodel=len004"),
          HttpConstants.GET,null);
    HtmlDocument html=new HtmlDocument(new URL("http://localhost"), doc.getContent());
    for (URL u: html.getLinks()) {
      System.out.println(u);
    }
   
    //    System.out.println(doc);
View Full Code Here

TOP

Related Classes of java.net.URL

Copyright © 2015 www.massapicom. 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.