本文整理了Java中org.eclipse.equinox.internal.frameworkadmin.utils.Utils.getUrl()
方法的一些代码示例,展示了Utils.getUrl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getUrl()
方法的具体详情如下:
包路径:org.eclipse.equinox.internal.frameworkadmin.utils.Utils
类名称:Utils
方法名:getUrl
暂无
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.frameworkadmin
public static URL checkFullUrl(URL url, String urlName) throws IllegalArgumentException {//throws ManipulatorException {
if (url == null)
throw new IllegalArgumentException(urlName + " is null"); //$NON-NLS-1$
if (!url.getProtocol().endsWith("file")) //$NON-NLS-1$
return url;
File file = new File(url.getFile());
if (!file.isAbsolute())
throw new IllegalArgumentException(urlName + "(" + url + ") does not have absolute path"); //$NON-NLS-1$ //$NON-NLS-2$
if (file.getAbsolutePath().startsWith(PATH_SEP))
return url;
try {
return getUrl("file", null, PATH_SEP + file.getAbsolutePath()); //$NON-NLS-1$
} catch (MalformedURLException e) {
throw new IllegalArgumentException(urlName + "(" + "file:" + PATH_SEP + file.getAbsolutePath() + ") is not fully quallified"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin
public static URL checkFullUrl(URL url, String urlName) throws IllegalArgumentException {//throws ManipulatorException {
if (url == null)
throw new IllegalArgumentException(urlName + " is null"); //$NON-NLS-1$
if (!url.getProtocol().endsWith("file")) //$NON-NLS-1$
return url;
File file = new File(url.getFile());
if (!file.isAbsolute())
throw new IllegalArgumentException(urlName + "(" + url + ") does not have absolute path"); //$NON-NLS-1$ //$NON-NLS-2$
if (file.getAbsolutePath().startsWith(PATH_SEP))
return url;
try {
return getUrl("file", null, PATH_SEP + file.getAbsolutePath()); //$NON-NLS-1$
} catch (MalformedURLException e) {
throw new IllegalArgumentException(urlName + "(" + "file:" + PATH_SEP + file.getAbsolutePath() + ") is not fully quallified"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
代码示例来源:origin: org.eclipse.equinox/frameworkadmin
public static URL checkFullUrl(URL url, String urlName) throws IllegalArgumentException {//throws ManipulatorException {
if (url == null)
throw new IllegalArgumentException(urlName + " is null");
if (!url.getProtocol().endsWith("file")) //$NON-NLS-1$
return url;
File file = new File(url.getFile());
if (!file.isAbsolute())
throw new IllegalArgumentException(urlName + "(" + url + ") does not have absolute path");
if (file.getAbsolutePath().startsWith(PATH_SEP))
return url;
try {
return getUrl("file", null, PATH_SEP + file.getAbsolutePath()); //$NON-NLS-1$
} catch (MalformedURLException e) {
throw new IllegalArgumentException(urlName + "(" + "file:" + PATH_SEP + file.getAbsolutePath() + ") is not fully quallified");
}
}
内容来源于网络,如有侵权,请联系作者删除!