Package java.net

Examples of java.net.URL


    }
  }

  public URL getAdminPageURL() {
    try {
      URL root = getRootURL();
      if (root != null) {
        return new URL(root.toString() + "/plugin-admin");
      } else {
        return null;
      }
    } catch (MalformedURLException e) {
      return null;
View Full Code Here


    }
  }

  public URL getContentManagerURL() {
    try {
      URL root = getRootURL();
      if (root != null) {
        return new URL(root.toString() + "/plugin-contentmanager");
      } else {
        return null;
      }
    } catch (MalformedURLException e) {
      return null;
View Full Code Here

  public URL getRootURL() {
    try {
      WGADeployment deployment = WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployment(getWGADistributionName());
      if (deployment != null) {
        int port = WGADesignerPlugin.getDefault().getPreferenceStore().getInt(PreferenceConstants.TOMCAT_HTTP_PORT);
        return new URL("http://localhost:" + port + deployment.getContextPath());
      } else {
        return null;
      }
    } catch (MalformedURLException e) {
      return null;
View Full Code Here

      return null;
    }
  }

  public URL getVersionURL() {
    URL root = getRootURL();
    if (root != null) {
      WGADeployment deployment = WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployment(getWGADistributionName());
      try {
        if (deployment.getWGAVersion().isAtLeast(5, 0)) {
          return new URL(root.toString() + "/version.jsp");
        } else {
          return new URL(root.toString() + "/wgadmin.jsp");
        }
      } catch (Exception e) {
      }
    }
    return null;
View Full Code Here

    _listeners.remove(o);
  }

  public URL getContentManagerURL(ContentStore contentStore) {
    try {
      return new URL(getContentManagerURL() + "/html/contentstore?dbkey=" + contentStore.getKey() + "&username=designer&password=wga");
    } catch (MalformedURLException e) {
      return null;
    }
  }
View Full Code Here

    }
  }

  public URL getDefaultURL(ContentStore contentStore) {
    try {
      return new URL(getRootURL() + "/" + contentStore.getKey());
    } catch (MalformedURLException e) {
      return null;
    }
  }
View Full Code Here

    }
  }

  public URL getAdminClientURL(ContentStore contentStore) {
    try {
      return new URL(getAdminPageURL() + "/html/home?app=webprojects&uid=" + contentStore.getUid());
    } catch (MalformedURLException e) {
      return null;
    }
  }
View Full Code Here

  public static void openBrowser(String contentStore, IFile module) {   
    try {           
      WGARuntime currentRuntime = TomcatUtils.getInstance().getCurrentRuntime();
      if (currentRuntime != null) {
        URL rootURL = currentRuntime.getRootURL();
        if (rootURL != null) {
          IWebBrowser browser = WGADesignerPlugin.getDefault().createBrowser(BROWSER_ID);
          URL url = WGADesignStructureHelper.generateHttpURL(rootURL, contentStore, module);
          browser.openURL(url);
        }
      }
    } catch (Exception e) {
      WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), Display.getCurrent().getActiveShell(), "Unable to open tml module", "Unable to open tml module '" + module.getLocation() + "' in browser.", e);
View Full Code Here

    if (isEmpty(_srvUser.getText())) {
      messages.add("Please type a username");
    }

    try {
      _serverurl = new URL(_srvURL.getText());
    } catch (MalformedURLException e) {
      messages.add("Invalid URL");
    }

    if (messages.size() > 0) {
View Full Code Here

    }
  }

  static URL getTempURL(final InputStream resource) {
    try {
      return new URL(null, "temp:#temp", new URLStreamHandler() { //$NON-NLS-1$
       
        @Override
        protected URLConnection openConnection(URL u) throws IOException {
          return new URLConnection(u) {
           
View Full Code Here

TOP

Related Classes of java.net.URL

Copyright © 2018 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.