当前位置: 首页>>代码示例>>Java>>正文


Java URIUtil.toURI方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.URIUtil.toURI方法的典型用法代码示例。如果您正苦于以下问题:Java URIUtil.toURI方法的具体用法?Java URIUtil.toURI怎么用?Java URIUtil.toURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.URIUtil的用法示例。


在下文中一共展示了URIUtil.toURI方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getScriptsHome

import org.eclipse.core.runtime.URIUtil; //导入方法依赖的package包/类
public static String getScriptsHome() throws IOException, URISyntaxException {
  File scriptsHome;

  try {
    URL url = new URL("platform:/plugin/" + PLUGIN_ID + "/scripts");
    URL fileURL = FileLocator.toFileURL(url);
    scriptsHome = new File(URIUtil.toURI(fileURL));
  } catch (MalformedURLException e) {
    // Running without OSGi, make a guess the scripts are relative to the local directory
    scriptsHome = new File("scripts/");
  }
  if (!scriptsHome.exists()) {
    throw new IOException("Failed to find " + PLUGIN_ID + "/scripts, expected it here: " + scriptsHome);
  }
  return scriptsHome.toString();
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:17,代码来源:PythonHelper.java

示例2: getSciSoftPyHome

import org.eclipse.core.runtime.URIUtil; //导入方法依赖的package包/类
public static String getSciSoftPyHome() throws IOException, URISyntaxException {
  File scriptsHome;

  try {
    URL url = new URL("platform:/plugin/org.eclipse.triquetrum.python.service/scripts");
    URL fileURL = FileLocator.toFileURL(url);
    scriptsHome = new File(URIUtil.toURI(fileURL));
  } catch (MalformedURLException e) {
    // Running without OSGi, make a guess the scripts are relative to the local directory
    scriptsHome = new File("../org.eclipse.triquetrum.python.service/scripts/");
  }
  if (!scriptsHome.exists()) {
    throw new IOException("Failed to find org.eclipse.triquetrum.python.service/scripts, expected it here: " + scriptsHome);
  }
  return scriptsHome.toString();
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:17,代码来源:PythonHelper.java

示例3: getExampleScriptsHome

import org.eclipse.core.runtime.URIUtil; //导入方法依赖的package包/类
private String getExampleScriptsHome() throws IOException, URISyntaxException {
  String location = System.getProperty(OVERRIDE_LOCATION_PROPERTY);
  if (location != null) {
    return location;
  }

  URL url = new URL("platform:/plugin/" + PLUGIN_ID + "/scripts");
  URL fileURL = FileLocator.toFileURL(url);
  File exampleScriptsHome = new File(URIUtil.toURI(fileURL));
  if (!exampleScriptsHome.exists()) {
    throw new IOException("Failed to find " + PLUGIN_ID + "/scripts, expected it here: " + exampleScriptsHome);
  }
  return exampleScriptsHome.toString();
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:15,代码来源:TestRunner.java

示例4: getSystemScriptsHome

import org.eclipse.core.runtime.URIUtil; //导入方法依赖的package包/类
private static String getSystemScriptsHome() throws IOException, URISyntaxException {
  URL url = new URL("platform:/plugin/" + PLUGIN_ID + "/scripts");
  URL fileURL = FileLocator.toFileURL(url);
  File systemScriptsHome = new File(URIUtil.toURI(fileURL));
  if (!systemScriptsHome.exists()) {
    throw new IOException("Failed to find " + PLUGIN_ID + "/scripts, expected it here: " + systemScriptsHome);
  }
  return systemScriptsHome.toString();
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:10,代码来源:PythonService.java

示例5: validateURL

import org.eclipse.core.runtime.URIUtil; //导入方法依赖的package包/类
private void validateURL(URL location) throws MalformedURLException, URISyntaxException {
	URI path= URIUtil.toURI(location);
	URI index = URIUtil.append(path, "index.html"); //$NON-NLS-1$
	URI packagelist = URIUtil.append(path, "package-list"); //$NON-NLS-1$
	URL indexURL = URIUtil.toURL(index);
	URL packagelistURL = URIUtil.toURL(packagelist);
	
	boolean suc= checkURLConnection(indexURL) && checkURLConnection(packagelistURL);
	if (suc) {
		showConfirmValidationDialog(indexURL);
	} else {
		MessageDialog.openWarning(fShell, fTitle, fInvalidMessage);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:JavadocConfigurationBlock.java

示例6: getFileFromOsgiRes

import org.eclipse.core.runtime.URIUtil; //导入方法依赖的package包/类
/**
 * @param url url should NOT be URL-encoded
 */
public static File getFileFromOsgiRes(URL url) throws URISyntaxException, IOException {
    return new File(
            URIUtil.toURI(url.getProtocol().equals("file") ?
                    url : FileLocator.toFileURL(url)));
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:ApgdiffUtils.java


注:本文中的org.eclipse.core.runtime.URIUtil.toURI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。