-
大小: 101KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-06-14
- 语言: 其他
- 标签: trueLicense
资源简介
truelicense的源码+中文注释,很简单代码也不多,花半天就可以看完。
代码片段和文件信息
/*
* Copyright 2005-2012 Schlichtherle IT Services
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package de.schlichtherle.license;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
/**
* This is a convenience class implementing the
* {@link KeyStoreParam#getStream()} method.
*
* @author Christian Schlichtherle
* @version $Id$
*/
//密钥库参数的抽象类
public abstract class AbstractKeyStoreParam implements KeyStoreParam {
//从哪个路径获取密钥库,注:当类被加载时在此类的所在路径下
private final Class clazz;
//密钥库资源的名称
private final String resource;
/**
* Creates a new instance of AbstractKeyStoreParam which will look up
* the given resource using the classloader of the given class when
* calling {@link #getStream()}.
*/
protected AbstractKeyStoreParam(final Class clazz final String resource) {
if (null == clazz || null == resource)
throw new NullPointerException();
this.clazz = clazz;
this.resource = resource;
}
/**
* Looks up the resource provided to the constructor using the classloader
* provided to the constructor and returns it as an {@link InputStream}.
*/
//获得密钥库的输入流
public InputStream getStream() throws IOException {
InputStream in = clazz.getResourceAsStream(resource);
if (in == null)
throw new FileNotFoundException(resource);
return in;
}
/**
* Returns {@code true} if and only if these key store parameters seem to
* address the same key store entry as the given object.
*
* @deprecated Not required.
*/
public final boolean equals(object object) {
if (!(object instanceof AbstractKeyStoreParam))
return false;
final AbstractKeyStoreParam that = (AbstractKeyStoreParam) object;
return this.clazz.equals(that.clazz)
&& this.resource.equals(that.resource)
&& this.getAlias().equals(that.getAlias());
}
/**
* Returns a hash code which is consistent with {@link #equals(object)}.
*
* @return A hash code which is consistent with {@link #equals(object)}.
* @deprecated Not required.
*/
public final int hashCode() {
int c = 17;
c = 37 * c + hash(this.clazz);
c = 37 * c + hash(this.resource);
return c;
}
private static int hash(object object) {
return null == object ? 0 : object.hashCode();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-08-29 16:05 true-license源码-自添中文注释版\
目录 0 2012-08-29 16:05 true-license源码-自添中文注释版\de\
目录 0 2012-08-29 16:05 true-license源码-自添中文注释版\de\schlichtherle\
目录 0 2012-08-29 16:05 true-license源码-自添中文注释版\de\schlichtherle\license\
文件 2832 2012-08-28 10:39 true-license源码-自添中文注释版\de\schlichtherle\license\AbstractKeyStoreParam.java
文件 2696 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\AbstractKeyStoreParam.java.bak
文件 1461 2012-08-28 10:40 true-license源码-自添中文注释版\de\schlichtherle\license\CipherParam.java
文件 1430 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\CipherParam.java.bak
文件 901 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\DefaultCipherParam.java
文件 1921 2012-08-28 10:43 true-license源码-自添中文注释版\de\schlichtherle\license\DefaultKeyStoreParam.java
文件 1823 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\DefaultKeyStoreParam.java.bak
文件 2014 2012-08-28 10:45 true-license源码-自添中文注释版\de\schlichtherle\license\DefaultLicenseParam.java
文件 1997 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\DefaultLicenseParam.java.bak
文件 884 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\IllegalPasswordException.java
文件 2701 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\KeyStoreParam.java
文件 15474 2012-08-28 12:17 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseContent.java
文件 15455 2012-08-28 12:10 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseContent.java.bak
文件 8447 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseContentBeanInfo.java
文件 1187 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseContentException.java
文件 1497 2012-08-28 13:26 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseCreator.java
文件 1476 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseCreator.java.bak
文件 33985 2012-08-28 16:58 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseManager.java
文件 33935 2012-08-28 16:35 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseManager.java.bak
文件 15842 2012-08-28 17:18 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseNotary.java
文件 15873 2012-08-28 14:32 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseNotary.java.bak
文件 1673 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseNotaryException.java
文件 2314 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseParam.java
文件 1282 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LicenseVerifier.java
文件 1041 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LocalKeyStoreParam.java
文件 9828 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\LocalLicenseManager.java
文件 1482 2012-07-13 14:42 true-license源码-自添中文注释版\de\schlichtherle\license\NoLicenseInstalledException.java
............此处省略22个文件信息
- 上一篇:OPENGL室内三维效果
- 下一篇:Office插件.olb文件注册工具
评论
共有 条评论