gpt4 book ai didi

org.netbeans.modules.web.common.api.WebUtils.stringToUrl()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 20:41:05 24 4
gpt4 key购买 nike

本文整理了Java中org.netbeans.modules.web.common.api.WebUtils.stringToUrl()方法的一些代码示例,展示了WebUtils.stringToUrl()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebUtils.stringToUrl()方法的具体详情如下:
包路径:org.netbeans.modules.web.common.api.WebUtils
类名称:WebUtils
方法名:stringToUrl

WebUtils.stringToUrl介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
public FileObject fromServer(int projectContext, URL serverURL) {
  // #219339 - strip down query and/or fragment:
  serverURL = WebUtils.stringToUrl(WebUtils.urlToString(serverURL, true));
  if (serverURL == null) {
    return null;
  }
  initProjectUrl();
  if (projectRootUrl == null) {
    return null;
  }
  FileObject webRoot = project.getWebRootDirectory();
  if (webRoot == null) {
    return null;
  }
  WebBrowser browser = getWebBrowser();
  if (browser != null) {
    serverURL = browser.fromBrowserURL(project, serverURL);
  }
  String url = CommandUtils.urlToString(serverURL, true);
  if (url.startsWith(projectRootUrl)) {
    return webRoot.getFileObject(url.substring(projectRootUrl.length()));
  }
  return null;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javaee-project

@Override
public FileObject fromServer(int projectContext, URL serverURL) {
  String query = serverURL.getQuery();
  // #219339 - strip down query and/or fragment:
  serverURL = WebUtils.stringToUrl(WebUtils.urlToString(serverURL, true));
  if (serverURL == null) {
    return null;
  }
  init();
  if (projectRootURL == null || webDocumentRoot == null) {
    return null;
  }
  WebBrowser browser = getWebBrowser();
  if (browser != null) {
    serverURL = browser.fromBrowserURL(getWebProject(), serverURL);
  }
  String u = WebUtils.urlToString(serverURL);
  if (u.startsWith(projectRootURL)) {
    String name = u.substring(projectRootURL.length());
    if (name.isEmpty()) {
      // name is empty - try to map server URL to one of the welcome files:
      return getExistingWelcomeFile();
    } else {
      // use servlet mappings to map server URL to a project file:
      return convertServerURLToProjectFile(name, query);
    }
  }
  return null;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject

@Override
public FileObject fromServer(int projectContext, URL serverURL) {
  serverURL = WebUtils.stringToUrl(WebUtils.urlToString(serverURL, true));
  if (serverURL == null) {
    return null;

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject

u = WebUtils.stringToUrl(root + relPath);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject

private void browseFile(BrowserSupport bs, FileObject fo, String fragment) {
    URL url;
    if (FileUtil.isParentOf(project.getSiteRootFolder(), fo)) {
      url = ServerURLMapping.toServer(project, fo);
      if (fragment.length() > 0) {
        url = WebUtils.stringToUrl(WebUtils.urlToString(url)+fragment);
      }
      bs.load(url, fo);
    } else {
      url = fo.toURL();
      WebBrowser wb = project.getProjectWebBrowser();
      WebBrowserFeatures features = new WebBrowserFeatures(false, false, false, false, false, false);
      wb.createNewBrowserPane(features).showURL(url);
    }
  }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com