本文整理了Java中hudson.remoting.Which.classFileUrl()
方法的一些代码示例,展示了Which.classFileUrl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Which.classFileUrl()
方法的具体详情如下:
包路径:hudson.remoting.Which
类名称:Which
方法名:classFileUrl
[英]Returns the URL of the class file where the given class has been loaded from.
[中]返回从中加载给定类的类文件的URL。
代码示例来源:origin: org.eclipse.hudson/hudson-remoting
/**
* @deprecated Use {@link #classFileUrl(Class)}
*/
public static URL jarURL(Class clazz) throws IOException {
return classFileUrl(clazz);
}
代码示例来源:origin: jenkinsci/remoting
/**
* @deprecated Use {@link #classFileUrl(Class)}
*/
@Deprecated
public static URL jarURL(Class clazz) throws IOException {
return classFileUrl(clazz);
}
代码示例来源:origin: org.eclipse.hudson/hudson-remoting
/**
* Locates the jar file that contains the given class.
*
* <p>
* Note that jar files are not always loaded from {@link File},
* so for diagnostics purposes {@link #jarURL(Class)} is preferrable.
*
* @throws IllegalArgumentException
* if failed to determine.
*/
public static File jarFile(Class clazz) throws IOException {
return jarFile(classFileUrl(clazz),clazz.getName().replace('.','/')+".class");
}
代码示例来源:origin: jenkinsci/remoting
/**
* Locates the jar file that contains the given class.
*
* <p>
* Note that jar files are not always loaded from {@link File},
* so for diagnostics purposes {@link #jarURL(Class)} is preferrable.
*
* @param clazz Class
* @throws IllegalArgumentException
* if failed to determine the class File URL.
* @return
* JAR File, which contains the class.
*/
@Nonnull
public static File jarFile(Class clazz) throws IOException {
return jarFile(classFileUrl(clazz),clazz.getName().replace('.','/')+".class");
}
代码示例来源:origin: jenkinsci/remoting
public Object apply(Object o) {
try {
// verify that 'o' is loaded from a jar file
String loc = Which.classFileUrl(o.getClass()).toExternalForm();
System.out.println(loc);
assertTrue(loc, loc.startsWith("jar:"));
return null;
} catch (IOException e) {
throw new Error(e);
}
}
}
代码示例来源:origin: jenkinsci/remoting
final URL urlOfClassFile = Which.classFileUrl(c);
内容来源于网络,如有侵权,请联系作者删除!