java encodedurl_Java ParseUtil.fileToEncodedURL方法代码示例
import sun.net.www.ParseUtil; //导入方法依赖的package包/类
private CodeSource canonicalizeCodebase(CodeSource cs,
boolean extractSignerCerts) {
String path = null;
CodeSource canonCs = cs;
URL u = cs.getLocation();
if (u != null) {
if (u.getProtocol().equals("jar")) {
// unwrap url embedded inside jar url
String spec = u.getFile();
int separator = spec.indexOf("!/");
if (separator != -1) {
try {
u = new URL(spec.substring(0, separator));
} catch (MalformedURLException e) {
// Fail silently. In this case, url stays what
// it was above
}
}
}
if (u.getProtocol().equals("file")) {
boolean isLocalFile = false;
String host = u.getHost();
isLocalFile = (host == null || host.equals("") ||
host.equals("~") || host.equalsIgnoreCase("localhost"));
if (isLocalFile) {
path = u.getFile().replace('/', File.separatorChar);
path = ParseUtil.decode(path);
}
}
}
if (path != null) {
try {
URL csUrl = null;
path = canonPath(path);
csUrl = ParseUtil.fileToEncodedURL(new File(path));
if (extractSignerCerts) {
canonCs = new CodeSource(csUrl,
getSignerCertificates(cs));
} else {
canonCs = new CodeSource(csUrl,
cs.getCertificates());
}
} catch (IOException ioe) {
// leave codesource as it is, unless we have to extract its
// signer certificates
if (extractSignerCerts) {
canonCs = new CodeSource(cs.getLocation(),
getSignerCertificates(cs));
}
}
} else {
if (extractSignerCerts) {
canonCs = new CodeSource(cs.getLocation(),
getSignerCertificates(cs));
}
}
return canonCs;
}
java encodedurl_Java ParseUtil.fileToEncodedURL方法代码示例相关推荐
- java kryo_Kryo框架使用方法代码示例
Kryo框架的source已移至https://github.com/EsotericSoftware/kryo ,进入此页面,然后点击右边的Download Zip按钮,就能下载到最新版本的Kryo ...
- java readtimeout_Java HttpURLConnection.getReadTimeout方法代码示例
import java.net.HttpURLConnection; //导入方法依赖的package包/类 /** * 得到响应对象 * * @param urlConnection * @retu ...
- java invalidate_Java Component.invalidate方法代码示例
import java.awt.Component; //导入方法依赖的package包/类 /** Installs the component we will embed to display t ...
- java hasmoreelements_Java IOException.hasMoreElements方法代码示例
import java.io.IOException; //导入方法依赖的package包/类 /** * fileName���� ���� package �������� ������ ���� ...
- java methode_Java Method.getTypeParameters方法代码示例
import java.lang.reflect.Method; //导入方法依赖的package包/类 private void validateRuleMethod(MethodRuleDefin ...
- java setmethod_Java Operation.setJavaMethod方法代码示例
import com.sun.tools.internal.ws.processor.model.Operation; //导入方法依赖的package包/类 private void createJ ...
- java cancel_Java RunnableFuture.cancel方法代码示例
import java.util.concurrent.RunnableFuture; //导入方法依赖的package包/类 @Test public void testSnapshotAsyncC ...
- java getevent_Java ActionEvent.getWhen方法代码示例
import java.awt.event.ActionEvent; //导入方法依赖的package包/类 @Override final public void actionPerformed(A ...
- java deepcopy_Java JsonNode.deepCopy方法代码示例
import com.fasterxml.jackson.databind.JsonNode; //导入方法依赖的package包/类 /** * Applies this schema rule t ...
最新文章
- Linux运维需要知道的Redis经验
- 使用XML作为配置表,WinForm程序读取配置表来动态显示控件
- 多元化和专一化的关系
- Golang之channel操作
- 推荐一款基于web的Unix系统管理工具webmin
- win10下markdownpad2显示问题
- div中同时存在文本和数字超过两行出省略号
- 【Ansible】Ansible控制windows插件安装及运行error与解决方法
- django-cbv与fbv
- 【2018/04/02】学习小记
- acl的access-list命令使用详解
- DHTML中window的使用
- 分享30个网页设计色彩搭配的优秀案例
- web安全的学习路线
- ad18/ad19/ad20/ad21/ad22新版ADgaber导出(含官方教程)(含坐标文件)
- led灯条串联图_10个LED灯并联再串联
- Linux 复制文件
- 空间滤波器 平滑滤波器 锐化滤波器
- php在线编译器插件火狐,Firefox浏览器JS调试插件下载
- 食品加工企业自营商城小程序开发,帮助企业增加销售渠道,提高销量
热门文章
- 【发布】温度监测报警器v1.3a稳定版!
- linux 进程防火墙连接管理,Linux系统管理初步(五)系统防火墙控制程序firewalld...
- 标准PSO辨识NARMAX模型源码程序
- 汇编指令:LDM、STM详解
- C#当中的BeginInvoke和EndInvoke
- 天津:第十六届西青区民俗文化旅游节开幕
- ora-01017 invalid username/password logon denied
- spring_security权限应用
- 怎样在Github参与一个开源项目
- table中tr使用toggle不好,选择换一张方式