aspose 全套words pdf cells slides Java版
全套aspose版资源,该资源仅用作学习交流使用,请勿用作商业用途,如有需要请购买正版。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-04-12 15:57 aspose
文件 6062936 2019-04-12 14:50 asposeaspose-cells-8.5.2.jar
文件 12752053 2018-12-20 10:29 asposeaspose-words-18.10-jdk16.jar
文件 31070096 2019-04-12 15:21 asposeaspose.pdf-11.0.0.jar
文件 31562496 2019-04-12 10:21 asposeaspose.slides-15.9.0.jar
文件 4096 2019-04-12 15:33 asposeAsposeLicenseUtil.java
文件 3401 2019-04-12 16:04 asposeAsposeUtil.java
文件 584 2019-04-12 15:19 asposelicense.xml
package org.wgz.test;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.log4j.Logger;
/**
* Aspose注册工具
*
* @author
* @version 1.0.0
* 2019年04月16日 15:58
* @since Jdk1.8
*/
public class AsposeLicenseUtil {
private static InputStream inputStream = null;
private static Logger logger = Logger.getLogger(AsposeLicenseUtil.class);
/**
* 获取License的输入流
*
* @return
*/
private static InputStream getLicenseInput() {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
String path = contextClassLoader.getResource(“license.xml“).toURI().getPath();
inputStream = new FileInputStream(path);
} catch (Exception e) {
logger.error(“license not found!“ e);
}
return inputStream;
}
/**
* 设置License
*
* @return true表示已成功设置License false表示失败
*/
public static boolean setWordsLicense() {
InputStream licenseInput = getLicenseInput();
if (licenseInput != null) {
try {
com.aspose.words.License aposeLic = new com.aspose.words.License();
aposeLic.setLicense(licenseInput);
return aposeLic.getIsLicensed();
} catch (Exception e) {
logger.error(“set words license error!“ e);
}finally {
try {
licenseInput.close();
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
}
return false;
}
/**
* 设置License
*
* @return true表示已成功设置License false表示失败
*/
public static boolean setCellsLicense() {
InputStream licenseInput = getLicenseInput();
if (licenseInput != null) {
try {
com.aspose.cells.License aposeLic = new com.aspose.cells.License();
aposeLic.setLicense(licenseInput);
return true;
} catch (Exception e) {
logger.error(“set cells license error!“ e);
}finally {
try {
licenseInput.close();
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
}
return false;
}
/**
* 设置License
*
* @return true表示已成功设置License false表示失败
*/
/**/public static boolean setSlidesLicense() {
InputStream licenseInput = getLicenseInput();
if (licenseInput != null) {
try {
com.aspose.slides.License aposeLic = new com.aspose.slides.License();
aposeLic.setLicense(licenseInput);
return aposeLic.isLicensed();
} catch (Exception e) {
logger.error(“set ppt license error!“ e);
} finally {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-04-12 15:57 aspose
文件 6062936 2019-04-12 14:50 asposeaspose-cells-8.5.2.jar
文件 12752053 2018-12-20 10:29 asposeaspose-words-18.10-jdk16.jar
文件 31070096 2019-04-12 15:21 asposeaspose.pdf-11.0.0.jar
文件 31562496 2019-04-12 10:21 asposeaspose.slides-15.9.0.jar
文件 4096 2019-04-12 15:33 asposeAsposeLicenseUtil.java
文件 3401 2019-04-12 16:04 asposeAsposeUtil.java
文件 584 2019-04-12 15:19 asposelicense.xm
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)