⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jecfile.java

📁 java 写的一个新闻发布系统
💻 JAVA
字号:
////                                   ____.//                       __/\ ______|    |__/\.     _______//            __   .____|    |       \   |    +----+       \//    _______|  /--|    |    |    -   \  _    |    :    -   \_________//   \\______: :---|    :    :           |    :    |         \________>//           |__\---\_____________:______:    :____|____:_____\//                                      /_____|////                 . . . i n   j a h i a   w e   t r u s t . . .//package org.jahia.services.jef;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.FileNotFoundException;import java.io.DataInputStream;import java.io.IOException;import java.io.File;import java.io.EOFException;import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.util.zip.CRC32;import java.util.*;import org.jahia.security.license.*;import org.jahia.utils.JahiaConsole;import org.jahia.registries.ServicesRegistry;import org.jahia.exceptions.JahiaException;/** * Load and extract data from a JEC file * * @author  Khue Nguyen * @version 1.0 */public final class JecFile extends JefFile{	private  final String CLASS_NAME = "JecFile";  	     //-------------------------------------------------------------------------    /**     * Construct a jef file object by extracting encrypted     * information out of the specified jef file.     *     * @param String the full path to the file     *     * @exception   InvalidJefException     *      Throws this exception when the specified jef file is     *      not valid.     */    public JecFile (String path)        throws  IOException, JahiaException, InvalidJefFileException    {        super(path);    }    //-------------------------------------------------------------------------    /**	 * Return the license type	 *	 * @return int the license type	 */	public int getLicenseType() 	throws JefFileKeyNotFoundException, JefFileInvalidKeyValueException {				String val = getKey(LicenseConstants.LICENSE_TYPE_OPTION);		if ( val == null ){			throw new JefFileKeyNotFoundException(LicenseConstants.LICENSE_TYPE_OPTION);		}		JahiaConsole.println(CLASS_NAME," getLicenseType val=" + val );				try {			return Integer.parseInt(val);								} catch ( Throwable t ){			throw new JefFileInvalidKeyValueException(LicenseConstants.LICENSE_TYPE_OPTION);			}	}     //-------------------------------------------------------------------------    /**	 * Return the license type relational comparator	 *	 * @return int the license type Relational Comparator	 * @see LicenseConstants	 */	public int getLicenseTypeRelComp() 	throws JefFileKeyNotFoundException, JefFileInvalidKeyValueException {				String val = getKey(LicenseConstants.LICENSE_TYPE_RELCOMP_OPTION);		if ( val == null ){			throw new JefFileKeyNotFoundException(LicenseConstants.LICENSE_TYPE_RELCOMP_OPTION);		}		JahiaConsole.println(CLASS_NAME," getLicenseTypeRelComp val=" + val );				try {			return Integer.parseInt(val);								} catch ( Throwable t ){			throw new JefFileInvalidKeyValueException(LicenseConstants.LICENSE_TYPE_RELCOMP_OPTION);			}	} }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -