Compare commits

...

331 Commits

Author SHA1 Message Date
dependabot[bot]
c462be239f Bump poi-scratchpad from 3.12 to 5.2.1 in /server
Bumps poi-scratchpad from 3.12 to 5.2.1.

---
updated-dependencies:
- dependency-name: org.apache.poi:poi-scratchpad
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 04:37:50 +00:00
tomhusky
3e43c2f9d0 !49 修复Linux环境中OfficePluginManager中KillProcess出现杀掉进程失败,导致二次启动失败的bug
* 修复Linux环境中OfficePluginManager中KillProcess出现杀掉已经存在进程失败,导致二次启动失败的bug
2022-07-21 03:50:09 +00:00
陈精华
f1b949865f 更新Gitee workflow文件 2022-07-21 11:38:48 +08:00
陈精华
ab439a17a3 所有页面增加favicon.ico 2022-07-21 11:29:54 +08:00
陈精华
dd65564af6 修复getCorsFile接口未加base64编码(filter中解码异常) 2022-07-21 11:27:06 +08:00
yl-yue
acffcbfe98 !51 实现预览加密的(受密码保护)office文件
* 1. 修复getCorsFile接口高危安全漏洞
* 1. 优化密码错误提示(“密码错误,请重新输入密码。”)
* 1. 修复PPT重复预览bug,此bug导致ppt每次预览会执行两次转换(请求两次onlinePreview接口),在大文件尤其耗时(双倍时…
* 1. 【加密office预览】优化受密码保护的office文件检查逻辑,提升旧文件格式的兼容性
* 1. 【加密office预览】优化office文件是否受密码保护判断逻辑,避免兼容性误判
* 1. 【加密office预览】优化重新输入密码提示。
* 1. 【加密office预览】优化当密码输入错误后,不是抛出异常,而是提示用户重新输入
* 1. 优化prompt提示框的输入密码提示样式
* 1. 实现基于userToken缓存加密文件,没有userToken的加密文件不缓存
* 1. 优化docker构建方案,使用分层构建方式,采用层级缓存解决构建慢发布慢等问题。从原本5分钟左右缩短至几秒
* 1. 加密文件暂时不缓存(后续基于用户token实现,基于用户缓存)
* 1. 优化office文件下载逻辑,跳过重复下载(大量节约带宽与磁盘空间)。
* 1. 修复预览不同类型的加密office文件bug
* 实现预览加密的(受密码保护)office文件
2022-07-21 03:19:46 +00:00
kailing
04703aa03c add pipeline-20220716.yml for Gitee Go created_at:2022-07-16 12:57:59 2022-07-16 12:57:59 +00:00
kailing
584e6b2c77 add default pipeline template yaml 2022-07-16 12:56:45 +00:00
chenkailing
82f6d3565f 优化 file:// 协议访问授信目录的代码结构 2022-05-25 19:37:29 +08:00
gitchenjh
8c68834e17 Merge pull request #342 from gitchenjh/master
修复使用http文件流下载时文件名编码异常Gitee-#I4W0TQ
2022-03-09 19:48:22 -06:00
陈精华
ba7b6eed4a 修复使用http文件流下载时文件名编码异常Gitee-#I4W0TQ 2022-03-10 09:47:05 +08:00
gitchenjh
051ad0f4ea Merge pull request #334 from NullXin/wzxdev
ppt显示问题
2022-02-21 00:10:17 -06:00
1192247166@qq.com
05935c29e1 1、左边侧边栏显示总页码显示为0
2、修改左屏幕分辨率过高,显示图片过大。
2022-01-26 11:38:12 +08:00
zhangzhen1979
6a2735ec3d tif图片预览。因无法下载jai_core包,所以去掉pom中geotoolkit仓库的设置 2021-12-20 17:31:18 +08:00
zhangzhen1979
8bc53f76eb tif图片预览。更新本地jai_core包的版本至1.1.3 2021-12-20 17:31:18 +08:00
zhangzhen1979
48f6a507dc tif图片预览。根据 @gaoxingzaq 反馈和帮助,修改tif文件的jpg、pdf模式预览功能,兼容多页tif的pdf转换、jpg转换,以及jpg在线多页预览功能。 2021-12-20 17:31:18 +08:00
BearBen
20f328906c 解压方案新版测试修复乱码Linux问题 2021-12-17 17:40:23 +08:00
gitchenjh
4d1e2eb9c6 Merge pull request #326 from gitchenjh/master
修复 #311
2021-12-17 17:38:58 +08:00
gitchenjh
97542b06fa Create maven.yml
add Github Action
2021-12-17 17:31:32 +08:00
陈精华
0c93c7e4b6 update README 2021-12-17 17:22:31 +08:00
陈精华
56d9906c74 修复ppt预览在改过context-path后出现异常 (#311) 2021-12-17 17:18:58 +08:00
gitchenjh
5cfe37433f Merge pull request #321 from gitchenjh/master
启动脚本版本更新为4.1.0-SNAPSHOT
2021-12-14 13:38:00 +08:00
陈精华
45ebef3b74 启动脚本版本更新为4.1.0-SNAPSHOT 2021-12-14 13:37:03 +08:00
gitchenjh
2ed294bd65 Merge pull request #317 from zzzhouuu/master
feat: 通过配置控制PDF.js viewer toolbar & secondaryToolbar功能按钮
2021-12-10 17:31:25 +08:00
zhangzhen1979
91f3348a2f * tif图片预览,根据反馈的意见,已经全部修改 2021-12-10 17:13:57 +08:00
zhangzhen1979
d424de5e9a * tif图片预览,根据反馈的意见,已经全部修改 2021-12-10 17:13:57 +08:00
zhangzhen1979
6387ac21c9 * tif图片预览,根据反馈的意见,已经全部修改
1、配置文件、配置项默认值已改回image、tif
2、去掉了静态工具类上的@component 注解
3、修改OnlinePreview处理,在切换image方式预览时url中加入参数previewType=image,加入对应的处理,兼容在pdf预览模式下切换到JPG方式预览
2021-12-10 17:13:57 +08:00
zhangzhen1979
6dce47e47f * tif图片预览,在application.properties中加入tif.preview.type = ${KK_TIF_PREVIEW_TYPE:tif},可以控制使用tif、jpg、pdf方式预览。
修改相应代码,加入必要的判断处理。
2021-12-10 17:13:57 +08:00
zhangzhen1979
b7760ab42a * tif图片预览,改为支持转换为jpg后预览(JAI支持);加入tif->jpg->pdf转换后,以pdf格式预览,此种模式可完美支持打印纸张自适应。 2021-12-10 17:13:57 +08:00
周游
e0405bc5f6 Merge remote-tracking branch 'upstream/master' 2021-12-09 09:32:34 +08:00
gitchenjh
14151a6c46 Merge pull request #315 from gitchenjh/master
4.1.0迭代开启
2021-12-07 16:13:01 +08:00
陈精华
00555d3544 4.1.0迭代开启 2021-12-07 16:11:50 +08:00
Nevan Chow
7b2adc3979 Merge branch 'master' into master 2021-11-30 17:53:24 +08:00
gitchenjh
0a5fc1e4a8 Merge pull request #301 from fangzhengjin/patch-1
fix: PDF/word图片模式预览时, 下翻图片时频繁请求图片资源
2021-11-28 17:05:39 +08:00
gitchenjh
304d974b38 Merge pull request #268 from kekingcn/dependabot/maven/server/org.apache.commons-commons-compress-1.21
Bump commons-compress from 1.19 to 1.21 in /server
2021-11-25 16:19:52 +08:00
gitchenjh
6792a7afa7 Merge pull request #282 from kekingcn/dependabot/maven/server/com.thoughtworks.xstream-xstream-1.4.18
Bump xstream from 1.4.17 to 1.4.18 in /server
2021-11-25 16:19:39 +08:00
gitchenjh
ded297de59 Merge pull request #310 from gitchenjh/master
修复文件名包含空格时不能预览 #294
2021-11-25 16:11:35 +08:00
陈精华
f616678d83 修复文件名包含空格时不能预览 #294 2021-11-25 16:10:33 +08:00
gitchenjh
e10273dcdd Merge pull request #289 from sanxiHsu/master
Update startup.sh
2021-11-25 15:48:06 +08:00
gitchenjh
343269670c Merge pull request #288 from sanxiHsu/patch-2
Update shutdown.sh
2021-11-25 15:47:53 +08:00
gitchenjh
8af157b848 Merge pull request #309 from gitchenjh/master
处理Issues
2021-11-25 14:07:33 +08:00
陈精华
9d65c999e5 增加配置,限制允许预览的本地文件夹 #304 2021-11-25 13:47:51 +08:00
陈精华
4fe0d0edc9 PDF.js版本更新,解决 #264 2021-11-25 10:48:56 +08:00
周游
b1aab27338 feat: 通过配置控制PDF.js viewer toolbar & secondaryToolbar功能按钮 2021-11-16 11:50:12 +08:00
ZhengJin Fang
727e9ae9ed fix: PDF/word图片模式预览时, 下翻图片时频繁请求图片资源 2021-11-10 16:27:55 +08:00
sanxiHsu
dc9df5d760 Update startup.sh
更新根据pid文件来识别后台进程是否处于运行状态,避免同时启动多个后台进程。
2021-09-18 06:10:57 +00:00
sanxiHsu
b7de791658 Update shutdown.sh
原脚本使用grep,但grep只能用于人工操作无法用于自动脚本,原因在于无论是否搜索到正确结果,都会返回该grep进程的ID号,这时候kill就报错了。
更改为pid文件方式也是业界较为稳妥的方式。
2021-09-18 05:13:30 +00:00
Yiding He
82c7b59650 在主页上添加输入URL地址来预览的表单 2021-09-13 16:00:38 +08:00
dependabot[bot]
e0b9d8f476 Bump xstream from 1.4.17 to 1.4.18 in /server
Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.17 to 1.4.18.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

---
updated-dependencies:
- dependency-name: com.thoughtworks.xstream:xstream
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-25 15:56:05 +00:00
陈精华
db2ed3a555 修复某些版本LibreOffice本地安装了,但检测不到问题 2021-08-25 15:27:36 +08:00
xiaxiaxiaxia
6efc375066 Fix:修复install.sh安装脚本路径错误 2021-08-24 16:05:41 +08:00
Yiding He
9a4c864490 重命名 env() 2021-08-24 13:56:07 +08:00
Yiding He
a3081ef4a9 修复单元测试失败的问题 2021-08-24 13:56:07 +08:00
Yiding He
43374e02bd 让 office-plugin 项目的语言级别与父项目保持一致 2021-08-24 11:05:12 +08:00
gitchenjh
fb8a19469b Merge pull request #272 from jerrykcode/master
修复: 文件名含有特殊字符时无法预览
2021-08-21 14:19:40 +08:00
jerrykcode
f2d5f4a86c 为WebUtils.encodeUrlFileName方法添加测试用例 2021-08-20 14:15:42 +08:00
jerrykcode
2177aed64f 修复: 文件名含有特殊字符时无法预览 2021-08-19 20:26:37 +08:00
dependabot[bot]
d20ac8fafc Bump commons-compress from 1.19 to 1.21 in /server
Bumps commons-compress from 1.19 to 1.21.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-02 17:25:07 +00:00
捏造的信仰
2395a489a3 Update startup.sh
Add `/usr/lib64/libreoffice` to search path list.
2021-07-21 15:42:11 +08:00
ypgsh
0b8eedf935 feat: add dxf file type in cad scope 2021-07-21 15:41:35 +08:00
gitchenjh
807ada0bf9 4.0.0版本
4.0.0版本
2021-07-06 11:43:11 +08:00
陈精华
216c35c0b8 4.0.0版本发布 2021-07-06 11:15:50 +08:00
陈精华
d98cd5d9a9 优化:启动Office进程改为同步执行,防止程序运行起来Office进程还没启动 2021-07-06 11:12:07 +08:00
陈精华
fb6adf316f 优化:Windows环境下没有配置office.home,查找Office组件,内置的优先 2021-07-06 09:44:49 +08:00
陈精华
0854317cc8 优化:增加Office进程关闭日志 2021-07-06 09:10:19 +08:00
陈精华
fcdefa450c 新功能点:首页文件上传功能可通过配置实时开启或禁用 2021-07-06 09:09:19 +08:00
陈精华
dc50a460e5 修复:PPT图片预览模式前端显示异常 2021-07-05 14:37:39 +08:00
陈精华
31187ccb69 修复:PPT预览使用PDF模式无效 2021-07-05 11:09:53 +08:00
陈精华
d4b72b06e9 Dockerfile 拼写错误更正 2021-06-25 10:43:01 +08:00
陈精华
922e1e6ac4 修复压缩文件目录穿越漏洞 2021-06-23 12:25:14 +08:00
陈精华
79341b2c8e 集成OpenOffice替换为LibreOffice 2021-06-23 10:26:22 +08:00
kl
8a1eebb9b0 v3.6.0 版本发布 2021-06-17 19:06:37 +08:00
kl
85e26c6d93 修复 ofd 预览功能影响 office 预览的问题 2021-06-17 18:13:31 +08:00
gaoxiong
0a1ff64d18 修复某些情况下txt文本乱码问题 2021-06-17 17:48:48 +08:00
gaoxiong
176f38070d 对txt、log内容太多文件实现html分页显示 2021-06-17 17:48:48 +08:00
gaoxiong
4f5b0f74fd 美化ppt图片显示 2021-06-17 17:48:48 +08:00
gaoxiong
c549508417 增加OFD功能 2021-06-17 17:48:48 +08:00
gaoxiong
b86515a926 增加OFD功能 2021-06-17 17:48:48 +08:00
dependabot[bot]
1ba8c31d2c Bump commons-io from 1.4 to 2.7 in /office-plugin
Bumps commons-io from 1.4 to 2.7.

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-17 17:43:54 +08:00
dependabot[bot]
06ff1d4e8f Bump pdfbox from 2.0.15 to 2.0.24 in /server
Bumps pdfbox from 2.0.15 to 2.0.24.

---
updated-dependencies:
- dependency-name: org.apache.pdfbox:pdfbox
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-17 17:43:44 +08:00
dependabot[bot]
b03a11f2b5 Bump xstream from 1.4.16 to 1.4.17 in /server
Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.16 to 1.4.17.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-17 17:43:33 +08:00
gitchenjh
a362d21aa4 Merge pull request #249 from opkcloud/master
Dockerfile 中添加 openoffice / libreoffice 的配置,可动态切换部署
2021-05-28 17:19:23 +08:00
opkopk12333
cd33d80a8c Dockerfile 中添加 openoffice / libreoffice 的配置,可动态切换部署 2021-05-27 21:14:09 +08:00
dependabot[bot]
2bb0dd545d Bump xstream from 1.4.15 to 1.4.16 in /server
Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.15 to 1.4.16.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 13:32:13 +08:00
youken9980
ac2115114c 修正Redis服务器没有设置密码,但客户端向其发送身份验证请求的问题 2021-04-19 13:31:50 +08:00
youken9980
831550d847 修正office.preview.switch.disabled引用了错误常量的问题 2021-04-19 13:31:50 +08:00
youken9980
1fa7b4a911 修正区分大小写的文件系统中,文件后缀名为大写时,系统提示该文件类型不支持的问题 2021-04-19 13:31:50 +08:00
zhangxiaoxiao9527
bcdb5ce0e6 集成视频格式转换功能1.0(基于javacv) 2021-04-19 13:29:25 +08:00
gitchenjh
a3485dd9b7 Merge pull request #230 from gitchenjh/master
3.5.1版
2021-04-06 17:47:07 +08:00
陈精华
5a28b89f46 3.5.1版 2021-04-06 16:45:18 +08:00
陈精华
58b1b50c2e 修复:pdf.js 跨域问题 2021-04-06 16:44:40 +08:00
kl
8f75df15e2 修复 tif、tiff 文件预览初始内存太小预览失败的问题 2021-03-26 10:05:58 +08:00
gitchenjh
9883d3b064 assembly打包区分windows和linux
assembly打包区分windows和linux
2021-03-19 09:47:16 +08:00
kl
e477ce7048 修复打包插件 2021-03-19 09:45:04 +08:00
陈精华
0985aed0b0 assembly打包区分windows和linux,修复windows发行包启动报找不到找不到office组件 2021-03-19 09:41:01 +08:00
kl
2ffda7a1a6 更新版本到 3.5 2021-03-18 20:20:42 +08:00
kl
5cad4aa93e 文本预览转义处理 2021-03-18 20:12:50 +08:00
gitchenjh
2a61449ce1 Merge pull request #221 from gitchenjh/master
修复:pom编译版本
2021-03-18 17:42:24 +08:00
陈精华
fe0b42c5e3 修复:pom编译版本 2021-03-18 17:38:53 +08:00
kl
6ccc724839 office plugin 转换进程、任务超时可配置 2021-03-12 21:32:01 +08:00
kl
56cdeffaa9 新增 wps 文档预览支持 2021-03-02 17:29:49 +08:00
13540823418
5633eb4111 1.优化项目目录结构之后,windows下启动报错“找不到office组件”
2.import代码错误修复
2021-02-25 15:13:07 +08:00
fengzehao
6255c8dbbc modify some bug 2021-02-19 13:36:47 +08:00
kl
1fd7d5df88 新增依赖 highlightjs 代码文件预览高亮支持 2021-02-19 10:15:20 +08:00
chenkailing
01213c5d02 移除针对 tomcat 的配置 2021-02-10 12:53:27 +08:00
chenkailing
49685e545b 移除多余的 repositories 配置 2021-02-10 01:03:19 +08:00
chenkailing
2542a24675 优化项目结构、优化 maven 结构 2021-02-10 00:58:13 +08:00
chenkailing
28d3e05ca9 简化启动脚本 2021-02-09 21:44:58 +08:00
chenkailing
00fbb5cd74 Merge branch 'master' of https://github.com/kekingcn/kkFileView 2021-02-09 21:39:21 +08:00
kl
fbafcd5c92 新增 tiff 、tif 图像文件格式预览支持 2021-02-08 18:11:43 +08:00
kl
376a90772d 新增 tiff 、tif 图像文件格式预览支持 2021-02-08 18:02:49 +08:00
kl
4f4e75859d 新增 kkFIleView 的 banner 信息 2021-02-08 15:16:24 +08:00
kl
679459f53b 更新 spring-boot 到最新的 v2.4.2 版本 2021-02-07 18:34:35 +08:00
kl
8baef0d873 gitee star增长趋势图获取增加缓存时间设置 2021-02-07 18:01:53 +08:00
kl
d01dddf9e3 动态获取演示页访问地址的端口信息 2021-02-04 11:38:45 +08:00
kl
d61e5236d0 新增启动完成,打印启动耗时、演示页访问地址 2021-02-04 11:33:56 +08:00
kl
d514e6dc0f 更新 README.md 2021-02-04 09:51:41 +08:00
kl
188d2def2d 1、新增 github stars 增长趋势图 2021-02-03 18:23:47 +08:00
kl
17d64ad963 1、补充发版信息 2、新增 stars 增长趋势图 2021-02-03 18:01:55 +08:00
kl
d95fbe02bd 简化下载文件 io 操作 2021-01-28 15:55:42 +08:00
gitchenjh
212526d989 Merge pull request #209 from gitchenjh/master
修复:jodd.io.NetUtil.downloadFile下载大于16M文件报错问题
2021-01-28 15:43:05 +08:00
陈精华
ef5052e7ea 修复:jodd.io.NetUtil.downloadFile下载大于16M文件报错问题 2021-01-28 15:42:05 +08:00
kl
3531af4a46 更新版本到 3.3.1 2021-01-28 09:29:18 +08:00
范青锋
b2f6fb3a00 修复重复编码导致文档转图片预览失败的问题&编码规范
URLEncoder.encode(URLEncoder.encode(pdfFolder, uriEncoding).replaceAll("\+", "%20"), uriEncoding);
这里encode了两次,导致图片预览失败。
2021-01-23 14:09:16 +08:00
chenkailing
996da0862c 移除 Apache-common-text 包,采用 spring 内置的 HtmlUtils 处理 xss 问题 2021-01-23 13:13:29 +08:00
chenkailing
50dd7c1b83 移除 Apache-common-text 包,采用 spring 内置的 HtmlUtils 处理 xss 问题 2021-01-23 13:12:31 +08:00
hunterale
2dd067170b escaping of dangerous characters to prevent reflected xss 2021-01-22 12:08:06 +08:00
ale
e635ca86c5 escaping of dangerous characters 2021-01-22 12:08:06 +08:00
gitchenjh
8bd36e37a3 Merge pull request #204 from gitchenjh/master
修复:dwg文件预览时无法在jpg和pdf两种类型之间切换
2021-01-21 15:48:27 +08:00
陈精华
b3b2f7c407 修复:dwg文件预览时无法在jpg和pdf两种类型之间切换 2021-01-21 15:47:13 +08:00
dependabot[bot]
f1ad3d44ff Bump poi from 3.12 to 3.17 in /server
Bumps poi from 3.12 to 3.17.

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 13:37:56 +08:00
kl
ee6ff50244 解码url时,默认UTF-8编码 2021-01-18 13:36:45 +08:00
chenkailing
196741d5dc 加回 apache-commons-io 包依赖,office组件中有依赖,后续再统一吧 2021-01-09 17:08:05 +08:00
chenkailing
374c06472f 移除 apache-commons-io 包依赖,采用jodd的io工具替代 2021-01-09 15:39:01 +08:00
kl
12c85c60c7 XML文件预览支持切换纯文本模式 2020-12-31 13:28:25 +08:00
kl
4747ee93b2 修复类文本类型HTML文件预览的bug 2020-12-29 18:37:50 +08:00
kl
5ec53c4b33 指定Base64转码采用Apache Commons-code中的实现,修复base64部分jdk版本下出现的异常 2020-12-29 18:32:24 +08:00
kl
ee7f7f50cc 修复大小写文件类型后缀没通用匹配的问题 2020-12-29 09:29:16 +08:00
chenkailing
92869e8d6c 文本文件编码默认UTF-8输出到页面 2020-12-28 23:56:38 +08:00
kl
c66dda239f 采用apache-common-io包简化所有的文件下载io操作 2020-12-28 18:31:12 +08:00
kl
e927760c40 调整多图连续预览上下翻图的UI 2020-12-28 16:45:11 +08:00
kl
8783f9059a 修复压缩包内多图连续预览的bug 2020-12-28 16:45:11 +08:00
kl
12e1239267 前端模板抽象出通用的header,将水印等初始化内容挪到通用header里 2020-12-28 16:45:11 +08:00
kl
7c963193ef 更新simTxT文件预览UI风格 2020-12-28 14:54:42 +08:00
kl
bce9a624d7 更新XML文件预览UI风格,调整类文本预览架构,更方便扩展 2020-12-28 14:54:42 +08:00
kl
dac3606b4e 更新markdown文件预览UI风格 2020-12-28 14:54:42 +08:00
kl
eb00385d76 更新index接入演示界面UI风格 2020-12-28 13:36:40 +08:00
kl
986f562266 引入galimatias,解决不规范文件名导致文件下载异常 2020-12-28 11:43:27 +08:00
kl
11d0441ed4 加回漏掉的pdfjs 2020-12-28 11:22:59 +08:00
kl
ef46e2c51e 增强url base64解码失败时的提示信息 2020-12-28 11:22:59 +08:00
kl
0a3c03f18b 修复发行包运行时找不到日志目录的问题 2020-12-28 11:22:59 +08:00
chenkailing
7a7e1a1855 修复导包错误以及图片预览bug 2020-12-27 19:18:52 +08:00
chenkailing
f530f441d5 更新版本到3.3.0 2020-12-27 16:54:30 +08:00
chenkailing
10160e8104 添加2020年最后的发版信息 2020-12-27 16:42:03 +08:00
chenkailing
602e80ee9e 独立flv文件预览实现 2020-12-27 15:17:35 +08:00
chenkailing
9c83860e1b 抽象通用的预览异常接口实现 2020-12-27 14:48:07 +08:00
chenkailing
1f1970232b 精简util模块,ReturenResponse重构 2020-12-27 14:07:46 +08:00
chenkailing
594bd895ec 修复压缩包里文件再次预览失败的bug 2020-12-27 12:38:05 +08:00
chenkailing
486c09b24a 文件url采用base64加encodeURI双重编码,彻底解决各种奇葩文件名导致的下载异常 2020-12-27 01:46:12 +08:00
chenkailing
aaf396fbc8 忽略log目录 2020-12-26 19:28:45 +08:00
chenkailing
4e01d6f5f3 忽略file目录 2020-12-26 19:23:00 +08:00
chenkailing
342c391a9b 引入cpdetector解决文件编码识别问题 2020-12-26 19:23:00 +08:00
chenkailing
f2d929e6fa 修改Dockerfile跟随模块变动 2020-12-26 17:42:40 +08:00
chenkailing
41cdc227b3 调整项目模块,jodconverter-core重命名为office-plugin。jdocnverter-web重命名为server 2020-12-26 17:42:40 +08:00
chenkailing
0f4f1d580b 1、抽象整理FileType的获取逻辑
2、合理设置预览消费队列的线程数
2020-12-26 16:44:57 +08:00
chenkailing
37c37868a3 Office组件启动异步化,提速应用启动速度到5秒内 2020-12-26 02:32:42 +08:00
chenkailing
01218e4a5c 设置pdfbox兼容低版本jdk 2020-12-26 02:11:29 +08:00
chenkailing
f6d54902e9 移除tomcat,采用jetty Server 2020-12-26 02:03:45 +08:00
chenkailing
5a559aa868 修复图片预览bug,移除guava 2020-12-26 01:53:30 +08:00
chenkailing
9b0f381c06 1.office预览图片模式禁用图片放大效果,达到图片和pdf预览效果一致的体验 2020-12-26 01:00:20 +08:00
kl
c1802b2487 预览逻辑重构 2020-12-26 01:00:20 +08:00
kl
d4b11a4056 优化文本类型预览逻辑 2020-12-25 21:03:19 +08:00
kl
da1553920b 增强了xml的预览效果 2020-12-25 20:44:59 +08:00
kl
d787813bc6 新增配置项office.preview.switch.disabled,控制offic文件预览切换开关 2020-12-25 18:21:15 +08:00
dependabot[bot]
4a3886e41a Bump xstream from 1.4.6 to 1.4.15 in /jodconverter-web
Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.6 to 1.4.15.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-25 17:01:12 +08:00
kl
cf1f833d60 新增markdown格式预览支持 2020-12-25 17:00:15 +08:00
陈精华
cb21952155 !19 兼容本地绝对路径文件获取(win、linux)
Merge pull request !19 from zhangxiaoxiao/master
2020-12-10 14:11:06 +08:00
gitchenjh
3498df0491 Merge pull request #159 from gitchenjh/master
添加QQ群-2群
2020-12-10 12:12:46 +08:00
陈精华
e3ebf1979f 添加QQ群-2群 2020-12-10 12:10:19 +08:00
13540823418
fb09a8c00f 兼容本地绝对路径文件读取,采用file标准协议读取文件 2020-12-10 11:47:22 +08:00
13540823418
4c708f3cbd 兼容本地绝对路径文件读取 2020-12-06 01:38:16 +08:00
kailing
e1035510df !16 修复部分乱码问题
Merge pull request !16 from 隔壁邻居王师傅/N/A
2020-08-31 13:49:53 +08:00
隔壁邻居王师傅
c466d0399c 修复部分乱码问题
由于复制winodws字库会导致run异常,可以直接安装相关中文字库来解决
2020-08-17 11:58:46 +08:00
陈精华
8b33a233dd !15 2.2.1版
Merge pull request !15 from 陈精华/master
2020-08-11 17:49:37 +08:00
陈精华
9e2962bb62 2.2.1版 2020-08-11 10:42:25 +08:00
陈精华
fc73deb3fd 修复上传到demo中的压缩文件及pdf预览异常 2020-08-11 10:42:01 +08:00
陈精华
40ac4b1eb9 !14 2.2.1迭代
Merge pull request !14 from 陈精华/master
2020-06-09 16:42:56 +08:00
陈精华
3d6da5f5a0 预览接口同时支持get和post请求,重新提交gitignore影响的目录文件 2020-06-09 16:35:11 +08:00
陈精华
7c4fc42247 2.2.1迭代,docker镜像底层使用ubuntu 2020-06-09 16:22:00 +08:00
陈精华
0c2a92080e !13 【开源贡献活动】修复电子发票预览图片方式正常pdf预览出现文字缺失异常 #I1I5SZ
Merge pull request !13 from 点蚊子熏烟/master
2020-06-08 14:07:36 +08:00
chenheng
b1fd13bcbb 【开源贡献活动】解决maven打包导致pdf.js bcmap异常问题,升级pdf.js到最新版本2.4.567 2020-06-05 16:34:59 +08:00
lidan
cd37ff4b41 支持 SimText 原样格式输出 2020-06-01 10:22:42 +08:00
陈精华
215e9f0f4a 2.2.0版 2020-05-20 08:44:30 +08:00
陈精华
26e147b426 更新文档&细节调整 2020-05-20 08:44:30 +08:00
陈精华
c7318c2b17 优化:PDF文件下载缓存 2020-05-20 08:44:30 +08:00
陈精华
c16116c7cd 优化:视频文件预览支持FTP 2020-05-20 08:44:30 +08:00
陈精华
1a4748bbec 优化:url特殊字符相关处理 2020-05-20 08:44:30 +08:00
陈精华
c0f7d60213 新增:更新日志 2020-05-18 15:55:26 +08:00
陈精华
bf83a0847d 优化:构建镜像使用阿里云yum源,加速构建 2020-05-18 15:55:26 +08:00
陈精华
7601d49795 修复:允许URL中出现|{}等字符,解决The valid characters are defined in RFC 7230 and RFC 3986问题 2020-05-18 15:55:26 +08:00
陈精华
1edf4d83f1 优化:重构代码 2020-05-18 15:55:26 +08:00
陈精华
f620c00785 优化:首页评论切换到Gitalk 2020-05-18 15:55:26 +08:00
陈精华
180e7bcb8a 优化:重构大量代码,修复异常 2020-05-18 15:55:26 +08:00
陈精华
8a52450629 优化:去除一种文件只允许上传一个提示 2020-05-18 15:55:26 +08:00
陈精华
a535ebfe1d 新功能点:新增配置是否可以下载转换完成的pdf文件 2020-05-18 15:55:26 +08:00
陈精华
3e80590a82 优化:默认启动水印 2020-05-18 15:55:26 +08:00
陈精华
5196536bb4 修复:修复预览ftp时,图片图片、pdf预览异常 2020-05-18 15:55:26 +08:00
陈精华
59ac8effc1 优化:添加日志 2020-05-18 15:55:26 +08:00
陈精华
9cc0267619 优化:允许上传多个同一类型文件 2020-05-18 15:55:26 +08:00
陈精华
a21f35c2b0 修复:删除文件时,也删除文件夹 2020-05-18 15:55:26 +08:00
陈精华
fde31cb327 新功能点:支持全局水印 2020-05-18 15:55:26 +08:00
陈精华
9c096605bb 修复:修复TrustHost静态注入问题 2020-05-18 15:55:26 +08:00
陈精华
b90e326eec 优化:移除localBaseUrl 2020-05-18 15:55:26 +08:00
陈精华
66e2acd063 优化:图片预览背景颜色和office相关预览背景颜色统一 2020-05-12 11:08:02 +08:00
陈精华
44165d655d 优化:修改历史遗留容易造成误解的方法名 2020-05-12 11:08:02 +08:00
陈精华
c9a6956b0d 优化:将前端所有CDN依赖放到本地,方便没有外网连接的用户使用 2020-05-12 11:08:02 +08:00
陈精华
9288564195 优化:去除pom文件多余properties 2020-05-12 11:08:02 +08:00
telami
9b8e7f812c 修复:预览图片时,点击周围会出现白屏 2020-05-07 09:03:40 +08:00
telami
3908f1be7e 修复:需求https://gitee.com/kekingcn/file-online-preview/issues/I14D4X,当使用nginx做代理时,配置了content-path和baseUrl时,访问view.html和getCorsFile会出现404 2020-04-29 09:04:37 +08:00
telami
15bd035304 修复:需求https://gitee.com/kekingcn/file-online-preview/issues/I14D4X,当使用nginx做代理时,配置了content-path和baseUrl时,访问view.html和getCorsFile会出现404 2020-04-29 09:04:37 +08:00
陈精华
e0b1cd76ca 修复:addTask异常 2020-04-14 11:22:07 +08:00
陈精华
2144b776b1 【新特性】支持限制预览源站点,保护预览服务不被滥用 2020-02-19 10:40:15 +08:00
陈精华
a8022df1d9 部分页面移动端样式 2020-02-19 10:40:15 +08:00
kl
a5d92bf905 Update .gitattributes 2020-02-10 15:51:43 +08:00
kl
81a18d07c3 Create .gitattributes 2020-02-10 15:47:24 +08:00
dependabot[bot]
86e5dcb23b Bump commons-compress from 1.18 to 1.19 in /jodconverter-web
Bumps commons-compress from 1.18 to 1.19.

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-29 16:57:25 +08:00
陈精华
1339c09382 优化:调整异常页面提示文案 2019-11-29 16:52:58 +08:00
陈精华
01e310a6e7 优化:预览URL特殊字体使用Hutool解决方案 2019-11-29 16:52:58 +08:00
陈精华
a07c962867 优化:Office组件运行状态检测 2019-11-29 16:52:58 +08:00
陈精华
09b6964c0e 脚本:使用kkFileView站点下载OpenOffice安装文件,加速国内用户构建Docker镜像 2019-11-29 16:52:58 +08:00
陈精华
461030d34f 构建脚本:编译时包含本地jar依赖 2019-11-21 18:19:52 +08:00
陈精华
c1a7cd8c46 新功能点,加入CAD图纸.dwg文件预览 2019-11-21 17:11:36 +08:00
陈精华
5888c56f1d 优化:异常处理、异常提示 2019-11-21 17:11:36 +08:00
陈精华
0798b8d8a0 优化:删除无用代码、页面加header 2019-11-21 17:11:36 +08:00
陈精华
ae93d48b44 配置:默认指定缓存实现为JDK实现 2019-11-21 17:11:36 +08:00
陈精华
506a3ba2b3 优化:服务器无法通过外网访问本地下载时,使用内网IP下载 2019-11-21 17:11:36 +08:00
陈精华
12f197b623 构建脚本:使用kkFileView站点下载OpenOffice安装文件,加速国内用户构建Docker镜像 2019-11-21 17:11:36 +08:00
陈精华
2001b241ee 运行环境:CentOS预先安装OpenOffice相关依赖 2019-11-21 17:11:36 +08:00
陈精华
7911edec4b 修复:文本文档首次预览后缓存文件未清理问题 2019-11-06 16:53:39 +08:00
陈精华
7ea70bf422 优化:图片模式下图片url使用baseUrl 2019-11-06 16:53:39 +08:00
陈精华
b1fdbd26a3 新功能点:全部能识别的纯文本直接预览,不用再转跳下载(.md、.java、.py等浏览器不认识的后缀名) 2019-10-25 15:16:25 +08:00
陈精华
fa7241bd4e 新功能点:所有配置项支持从环境变量里读取,方便Docker镜像部署 2019-10-25 15:16:25 +08:00
陈精华
8fdf462c6c 新功能点:缓存清理时间cron表达式支持自定义 link #I1147X 2019-10-25 15:16:25 +08:00
陈精华
f7c7411bcf fixup! 优化:目录调整,符合maven规范;maven编译指定.sh脚本换行符为unix换行 2019-10-25 15:16:25 +08:00
陈精华
845cb2e657 修复:参数包含特殊字符时url解码失败 2019-10-25 15:16:25 +08:00
陈精华
a4bfde68bd 优化:目录调整,符合maven规范;maven编译指定.sh脚本换行符为unix换行 2019-10-25 15:16:25 +08:00
陈精华
19d1ba6cf9 优化:(内部)移除为pdf文档提供base64缩略图 2019-10-25 15:16:25 +08:00
陈精华
1060bdd00f 新功能点:支持base url配置(主要用于nginx反向代理等) 2019-10-17 11:36:43 +08:00
陈精华
8c2fb2bdee 优化:默认启用缓存 2019-10-17 11:36:43 +08:00
陈精华
0fe75387eb 优化:启动脚本加入官网链接,点star推广等文案 close #I1148F 2019-09-16 11:49:49 +08:00
陈精华
fbea49e54f 优化:加入查看日志脚本 2019-09-16 11:49:49 +08:00
陈精华
41a72798d9 优化:去除可能导致文件不更新的缓存 2019-09-16 11:49:49 +08:00
陈精华
03cc185085 修复:压缩包中文件名有空格异常 2019-09-16 11:49:49 +08:00
陈精华
bfbd8ee25e 新功能点:(内部)为pdf文档提供base64缩略图 2019-09-10 18:24:06 +08:00
陈精华
f3f36169ff 优化:压缩文件名支持有特殊字符 2019-09-10 18:24:06 +08:00
陈精华
2df88544d3 修复:macOS下office组件默认路径错误 2019-09-10 18:24:06 +08:00
陈精华
6b744d77c7 修复:RocksDB缓存实现压缩包图片url缓存失效 2019-09-10 18:24:06 +08:00
doras
ba57dedebb "加入是否启用缓存配置项"后,excel转成的html文件不再转换编码,修复因此出现的乱码问题 2019-08-26 11:17:37 +08:00
陈精华
affd5b3057 图片和pdf预览模式切换按钮大小调整 2019-08-23 18:18:37 +08:00
陈精华
30c3128995 修复压缩文件中文fileKey未编码 link #I111PD 2019-08-23 18:18:37 +08:00
陈精华
b003a05775 加入是否启用缓存配置项 2019-08-23 18:18:37 +08:00
陈精华
98ec3d7dab 首页预览打开新页面 2019-08-23 18:18:37 +08:00
陈精华
69e23dbb99 shutdown脚本更新 2019-08-23 18:18:37 +08:00
陈精华
47bda1023a 修复Chrome76+删除弹出新窗口 2019-08-23 18:18:37 +08:00
陈精华
fd538a74af 中文语言环境 2019-08-23 18:18:37 +08:00
陈精华
300d213a7a cdn资源不指定http/https 2019-08-23 18:18:37 +08:00
陈精华
4c0a70f300 2.2.0迭代 2019-08-23 18:18:37 +08:00
陈精华
8798d344b6 2.1.2版 2019-07-30 16:31:53 +08:00
陈精华
63e62ab57b pdf.js使用里面一个bug 2019-07-30 16:31:53 +08:00
陈精华
9a027674ac 演示首页兼容IE 2019-07-30 16:31:53 +08:00
1045485954@qq.com
e4407467dd IE兼容性问题,目前已兼容到IE9 2019-07-17 09:03:32 +08:00
陈精华
551eeb0390 2.1.1版 2019-07-09 10:46:21 +08:00
陈精华
11d6ad1ed3 修复文件下载流URL参数中包含中文URL编码不正确导致HTTP-400异常 2019-07-09 10:46:21 +08:00
陈精华
e57db6925c 修复config.js 404问题 2019-07-09 10:46:21 +08:00
陈精华
87096364d8 首页示例修改、首页更新记录 2019-07-09 10:46:21 +08:00
陈精华
ad8027a7d0 2.1.1迭代 2019-07-09 10:46:21 +08:00
陈精华
9786fa8275 2.1.0版 2019-06-19 15:24:24 +08:00
陈精华
37762cf034 支持FTP文件地址作为预览源url 2019-06-19 15:24:24 +08:00
陈精华
a78f1e5f8e Docker构建 2019-06-19 15:24:24 +08:00
陈精华
440b8030e0 新增Docker构建 2019-06-19 15:24:24 +08:00
陈精华
fb7cdfbef7 支持http/https文件流作为预览源url 2019-06-19 15:24:24 +08:00
陈精华
cf1ee9c631 支持自动清理预览文件及缓存 2019-06-19 15:24:24 +08:00
陈精华
13123f8f9d addTask转码优化 2019-06-19 15:24:24 +08:00
陈精华
189bc3965d 2.1.0迭代 2019-06-19 15:24:24 +08:00
kl
0aa7444dba Update pom.xml 2019-05-30 09:08:08 +08:00
陈精华
628efec6bd 2.0.2版 2019-05-23 09:53:37 +08:00
陈精华
6d0846a551 修复rocksdb缓存只缓存一条数据问题 2019-05-23 09:53:37 +08:00
陈精华
41d9015023 支持flv视频预览 2019-05-23 09:53:37 +08:00
陈精华
3f40b60c64 支持7z文件预览 2019-05-23 09:53:37 +08:00
陈精华
f244054462 优化读取动态配置 2019-05-23 09:53:37 +08:00
陈精华
37fbc98827 2.0.2迭代 2019-05-23 09:53:37 +08:00
陈精华
795cf3393e 2.0.1版 2019-05-09 15:20:15 +08:00
陈精华
70323b8ee3 pdf预览支持url中有中文或特殊字符 2019-05-09 15:20:15 +08:00
陈精华
67686e99f0 修复excel预览网页乱码问题 2019-05-09 15:20:15 +08:00
陈精华
90554462dc pdf默认预览模式也从配置文件中取,和word ppt统一 2019-05-09 15:20:15 +08:00
kl
ba3084d698 Update README.md 2019-05-09 09:18:54 +08:00
陈精华
3813f75f65 2.0版本 2019-05-07 10:16:26 +08:00
陈精华
a663e99bcd 背景色统一 2019-04-28 13:55:40 +08:00
陈精华
d517ab4e6f 替换pdf和图片预览相互转跳按钮图标 2019-04-28 13:55:40 +08:00
陈精华
29726c11a3 PDF预览也支持图片模式和查看大图 2019-04-28 13:55:40 +08:00
陈精华
336a18ade7 office预览只有PDF转图片 2019-04-26 15:35:43 +08:00
陈精华
53814fe6ab office图片&PDF预览背景色统一 2019-04-26 14:54:09 +08:00
陈精华
50fb586e6f office图片预览打开大图新开窗口 2019-04-26 14:25:35 +08:00
陈精华
a49ee9d726 图片预览可在viewjs中大图预览&翻页 2019-04-26 14:15:08 +08:00
陈精华
ae40d0233b 加入shutdown脚本 2019-04-26 14:15:08 +08:00
陈精华
8f7c13850e 修复调试时只打开jodconverter-web目录里读不到配置文件异常 2019-04-26 14:15:08 +08:00
陈精华
b4d3419797 word、ppt文档新增图片预览模式 2019-04-26 09:04:34 +08:00
陈精华
68aa5db66b RocksDB缓存实现,并更换默认实现为RocksDB 2019-04-23 11:40:44 +08:00
陈精华
7e8de7c754 解压相关 2019-04-18 16:14:58 +08:00
陈精华
f989fbf9c9 优先使用自定义office.home 2019-04-18 11:53:59 +08:00
陈精华
af8ddc10da 文件转换编码默认根据操作系统获取,变为可选配置
文本和多媒体类型添加默认值,变为可选配置
2019-04-17 13:32:14 +08:00
陈精华
3713e6e550 MacOS下office安装路径更新 2019-04-17 13:32:14 +08:00
陈精华
4a7ba07df1 file.Dir变为选配置添加其默认值 2019-04-16 22:10:48 +08:00
陈精华
b625381de3 脚本修改 2019-04-16 16:11:22 +08:00
陈精华
0968ac774a 脚本修改 2019-04-16 16:11:22 +08:00
陈精华
0db6b23bf7 Linux下集成OpenOffice 2019-04-16 16:11:22 +08:00
陈精华
6dc10e8df4 解决tar包office目录层级过长问题 2019-04-16 16:11:22 +08:00
陈精华
9976f0ae99 dev和release区分开 2019-04-16 16:11:22 +08:00
陈精华
55537d3a25 Windows下集成OpenOffice 2019-04-16 16:11:22 +08:00
陈精华
02e116fd8a 完善启动脚本 2019-04-16 16:11:22 +08:00
陈精华
5af3a97720 支持部分配置在运行时动态改变 2019-04-16 16:11:22 +08:00
陈精华
bf08c2c26f 更新记录 2019-04-16 16:11:22 +08:00
陈精华
236ed405f2 启动脚本&配置文件 2019-04-16 16:11:22 +08:00
陈精华
0fb02e3ccb 打包为zip和tar.gz包 2019-04-16 16:11:22 +08:00
陈精华
3dd6609fd6 缓存及队列实现抽象,提供JDK和REDIS两种实现 2019-04-16 16:11:22 +08:00
kl
dd876792c7 Update pom.xml 2018-10-22 11:34:30 +08:00
kl
3b79ef31e8 Update pom.xml
更新jar版本依赖,老版本有安全风险
2018-10-17 09:09:02 +08:00
kl
deb3abcac1 Merge remote-tracking branch 'origin/master' 2018-03-26 17:06:42 +08:00
kl
1c1a945959 使用畅言替换友言社评服务 2018-03-26 17:03:20 +08:00
duanmuxiangxiao
d1c5211d03 viewerjs版本升级release 1.0.0-rc.1 2018-03-26 16:48:02 +08:00
duanmuxiangxiao
d73bc3a031 图片轮播,修改图片切换按钮样式 2018-03-26 13:39:54 +08:00
13537 changed files with 2612379 additions and 98663 deletions

5
.gitattributes vendored Normal file
View File

@@ -0,0 +1,5 @@
*.css linguist-language=java
*.less linguist-language=java
*.js linguist-language=java
*.html linguist-language=java
*.* linguist-language=java

24
.github/workflows/maven.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

21
.gitignore vendored
View File

@@ -17,25 +17,14 @@ target/
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
/*.iml
**/target/
.classpath
.project
**/.settings
**/bin/
**/build/
**/.externalToolBuilders/
*.iml
**/.idea/
**/disconf
**/rpc.properties
/producer/tmp
/.temfile
.temfile
convertedFile/
### VS Code ###
.vscode/
server/src/main/cache/
server/src/main/file/

View File

@@ -0,0 +1,53 @@
version: '1.0'
name: branch-pipeline
displayName: BranchPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
# 支持67891011六个版本
jdkVersion: 8
# 支持2.2.13.2.53.3.93.5.23.5.33.5.43.6.13.6.3八个版本
mavenVersion: 3.3.9
# 构建命令
commands:
- mvn -B clean package -Dmaven.test.skip=true
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径是指代码编译完毕之后构建物的所在路径如通常jar包在target目录下当前目录为代码库根目录
path:
- ./server/target
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_maven
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增默认开启
autoIncrement: true
triggers:
push:
branches:
exclude:
- master
include:
- .*

View File

@@ -0,0 +1,51 @@
version: '1.0'
name: master-pipeline
displayName: MasterPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
# 支持67891011六个版本
jdkVersion: 8
# 支持2.2.13.2.53.3.93.5.23.5.33.5.43.6.13.6.3八个版本
mavenVersion: 3.3.9
# 构建命令
commands:
- mvn -B clean package -Dmaven.test.skip=true
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径是指代码编译完毕之后构建物的所在路径如通常jar包在target目录下当前目录为代码库根目录
path:
- ./server/target
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_maven
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增默认开启
autoIncrement: true
triggers:
push:
branches:
include:
- master

40
.workflow/PRPipeline.yml Normal file
View File

@@ -0,0 +1,40 @@
version: '1.0'
name: pr-pipeline
displayName: PRPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
# 支持67891011六个版本
jdkVersion: 8
# 支持2.2.13.2.53.3.93.5.23.5.33.5.43.6.13.6.3八个版本
mavenVersion: 3.3.9
# 构建命令
commands:
- mvn -B clean package -Dmaven.test.skip=true
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径是指代码编译完毕之后构建物的所在路径如通常jar包在target目录下当前目录为代码库根目录
path:
- ./server/target
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 构建产物制品库默认default系统默认创建
artifactRepository: default
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_maven
triggers:
pr:
branches:
include:
- master

View File

@@ -0,0 +1,36 @@
version: '1.0'
name: pipeline-20220716
displayName: pipeline-20220716
triggers:
trigger: manual
push:
branches:
prefix:
- ''
stages:
- name: stage-8b46aafe
displayName: 未命名
strategy: naturally
trigger: auto
executor: []
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
jdkVersion: '8'
mavenVersion: 3.3.9
commands:
- mvn -B clean package -Dmaven.test.skip=true
artifacts:
- name: BUILD_ARTIFACT
path:
- ./server/target
settings: []
caches:
- ~/.m2
notify: []
strategy:
retry: '0'
permissions:
- role: admin
members: []

5
Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM keking/kkfileview-jdk:4.1.1
MAINTAINER chenjh "842761733@qq.com"
ADD server/target/kkFileView-*.tar.gz /opt/
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.1.0-SNAPSHOT/bin
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.1.0-SNAPSHOT/config/application.properties","-jar","/opt/kkFileView-4.1.0-SNAPSHOT/bin/kkFileView-4.1.0-SNAPSHOT.jar"]

View File

@@ -1,4 +1,4 @@
# file-online-preview
# kkFileView
[![GitHub license](https://img.shields.io/github/license/kekingcn/kkFileView.svg?style=flat-square)](https://github.com/kekingcn/kkFileView/blob/master/LICENSE)
@@ -16,14 +16,19 @@ special thanks to the supports of @唐老大 and the contributions of @端木详
- REST API
- Abstract file preview interface so that it is easy to extend more file extensions and develop this project on your own
### Official website and DOCS
URL[https://kkfileview.keking.cn](https://kkfileview.keking.cn)
### Live demo
> Please treat public service kindly, or this would stop at any time.
URLhttp://file.keking.cn/
URL[https://file.keking.cn](https://file.keking.cn)
### Documentation
1. Full wiki documenthttps://gitee.com/kekingcn/file-online-preview/wikis/pages
1. 中文文档https://gitee.com/kekingcn/file-online-preview/blob/master/README.md
1. English documenthttps://github.com/kekingcn/kkFileView/blob/master/README.en.md
1. English documenthttps://gitee.com/kekingcn/file-online-preview/blob/master/README.en.md
### Contact us && Join us
> We will answer everyone's questions in use of this project.
@@ -34,20 +39,62 @@ Cherish life away from ineffective communication.
QQ group613025121
### Pictures for some samples
> Excel
#### 1. Text Preview
It supports preview of all types of text documents. Because there are too many types of text documents, it is impossible to enumerate them. The default open types are as follows: txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd
The text preview effect is as follows
![text](https://kkfileview.keking.cn/img/preview/preview-text.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/093051_cd55b3ec_492218.png "屏幕截图.png")
> doc
#### 2. Picture preview
Support jpg, jpeg, png, gif and other picture previews (flip, zoom, mirror). The preview effect is as follows
![image](https://kkfileview.keking.cn/img/preview/preview-image.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/092350_5b2ecbe5_492218.png "屏幕截图.png")
#### 3. Word document preview
Doc and docx document previews are supported. There are two modes of word previews: one is that each page of word is converted to picture previews, the other is that the whole word document is converted to PDF, and then previews PDF. The applicable scenarios of the two modes are as follows
* Picture preview modes: the word file is large, and the whole PDF loaded in the foreground is too slow
* Pdf Preview modes: intranet access, loading PDF fast
The preview effect of picture preview mode is as follows
![word1](https://kkfileview.keking.cn/img/preview/preview-doc-image.png)
The preview effect of PDF preview mode is as follows
![word2](https://kkfileview.keking.cn/img/preview/preview-doc-pdf.png)
> zip,rar
#### 4. PPT document preview
ppt and pptx document preview are supported. Like word documents, there are two preview modes
The preview effect of picture preview mode is as follows
![ppt1](https://kkfileview.keking.cn/img/preview/preview-ppt-image.png)
The preview effect of PDF preview mode is as follows
![ppt2](https://kkfileview.keking.cn/img/preview/preview-ppt-pdf.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/093806_46cede06_492218.png "屏幕截图.png")
#### 5. PDF document preview
Pdf document preview is supported. Like word document, there are two preview modes
The preview effect of picture preview mode is as follows
![pdf1](https://kkfileview.keking.cn/img/preview/preview-pdf-image.png)
The preview effect of PDF preview mode is as follows
![pdf2](https://kkfileview.keking.cn/img/preview/preview-pdf-pdf.png)
> png,jpeg,jpg,etc., support for zooming with mouse scroll, rotation, inversion,etc.
#### 6. EXCEL document preview
Support XLS, xlsx document preview, the preview effect is as follows
![excel](https://kkfileview.keking.cn/img/preview/preview-xls.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/094335_657a6f60_492218.png "屏幕截图.png")
#### 7. Compressed file Preview
Support zip, rar, jar, tar, gzip and other compressed packages. The preview effect is as follows
![compress1](https://kkfileview.keking.cn/img/preview/preview-zip.png)
Click the file name in the compressed package to preview the file directly. The preview effect is as follows
![compress2](https://kkfileview.keking.cn/img/preview/preview-zip-inner.png)
#### 8. Multimedia file Preview
Theoretically, all video and audio files are supported. Since all file formats cannot be enumerated, the default open type is as follows
mp3,wav,mp4,flv
The video preview effect is as follows
![media1](https://kkfileview.keking.cn/img/preview/preview-video.png)
The audio preview effect is as follows
![media2](https://kkfileview.keking.cn/img/preview/preview-audio.png)
#### 9. CAD document preview
CAD DWG document preview is supported. Like word document, there are two preview modes
The preview effect of Picture preview mode is as follows
![cad1](https://kkfileview.keking.cn/img/preview/preview-cad-image.png)
The preview effect of PDF preview mode is as follows
![cad2](https://kkfileview.keking.cn/img/preview/preview-cad-pdf.png)
Considering space issues, the pictures of other types of documents will not be shown here.You can deploy it by yourself if you are interested in our project.There is a way to deploy it as below.
### Quick Start
@@ -57,28 +104,43 @@ Considering space issues, the pictures of other types of documents will not be s
- Redisson
- Jodconverter
> Dependencies
- Redis
- OpenOffice or LibreOffice
- Redis(Optional, Unnecessary by default)
- OpenOffice or LibreOffice(Integrated on Windows, will be installed automatically on Linux, need to be manually installed on Mac OS)
1. First step`git pull https://github.com/kekingcn/file-online-preview.git`
2. Second stepconfigure redis address and OpenOffice directorysuch as
```
#=============================================#Spring Redisson Configuration#===================================#
spring.redisson.address = 192.168.1.204:6379
##The folder for files which are uploaded to the server(Because of running as jar)
file.dir = C:\\Users\\yudian\\Desktop\\dev\\
## openoffice configuration
office.home = C:\\Program Files (x86)\\OpenOffice 4
```
'file.dir' is the real storage address of the converted files, please end with '/'.
3. Third stepRun the main method of FilePreviewApplication.java.After starting,visit `http://localhost:8012/`.
2. Third stepRun the main method of FilePreviewApplication.java.After starting,visit `http://localhost:8012/`.
If everything is ok,you will see the picture below.
![输入图片说明](https://gitee.com/uploads/images/2017/1213/100221_ea15202e_492218.png "屏幕截图.png")
### Changelog
> May 20th 2020
1. Support for global watermark and dynamic change of watermark content through parameters
2. Support for CAD file Preview
3. Add configuration item base.url, support using nginx reverse proxy and set context-path
4. All configuration items can be read from environment variables, which is convenient for docker image deployment and large-scale use in cluster
5. Support the configuration of TrustHost (only the file source from the trust site can be previewed), and protect the preview service from abuse
6. Support configuration of customize cache cleanup time (cron expression)
7. All recognizable plain text can be previewed directly without downloading, such as .md .java .py, etc
8. Support configuration to limit PDF file download after conversion
9. Optimize Maven packaging configuration to solve the problem of line break in .sh script
10. Place all CDN dependencies on the front end locally for users without external network connection
11. Comment Service on home page switched from Sohu ChangYan to gitalk
12. Fixed preview exceptions that may be caused by special characters in the URL
13. Fixed the addtask exception of the transformation file queue
14. Fixed other known issues
15. Official website build: [https://kkfileview.keking.cn](https://kkfileview.keking.cn)
16. Official docker image repository build: [https://hub.docker.com/r/keking/kkfileview](https://hub.docker.com/r/keking/kkfileview)
> June 18th 2019
1. Support automatic cleaning of cache and preview files
2. Support http/https stream url file preview
3. Support FTP url file preview
4. Add Docker build
> April 8th 2019
1. Cache and queue implementations abstract, providing JDK and REDIS implementations (REDIS becomes optional dependencies)
2. Provides zip and tar.gz packages, and provides a one-click startup script
> January 17th 2018

211
README.md
View File

@@ -1,46 +1,94 @@
# file-online-preview
# kkFileView
此项目为文件文档在线预览项目解决方案对标业内付费产品有[永中office](http://dcs.yozosoft.com/)】【[office365](http://www.officeweb365.com/)】【[idocv](https://www.idocv.com/)】等在取得公司高层同意后以Apache协议开源出来反哺社区在此特别感谢@唐老大的支持以及@端木详笑的贡献。该项目使用流行的spring boot搭建易上手和部署基本支持主流办公文档的在线预览如doc,docx,Excel,pdf,txt,zip,rar,图片等等
### 项目特性
1. 支持officepdf等办公文档
1. 支持txt,java,php,py,md,js,css等所有纯文本
1. 支持zip,rar,jar,tar,gzip等压缩包
1. 支持jpgjpegpnggif等图片预览翻转缩放镜像
1. 使用spring boot开发预览服务搭建部署非常简便
1. rest接口提供服务跨平台特性(java,php,python,go,php....)都支持应用接入简单方便
1. 支持 office, pdf, cad 等办公文档
1. 支持 txt, xml(渲染), md(渲染), java, php, py, js, css 等所有纯文本
1. 支持 zip, rar, jar, tar, gzip 等压缩包
1. 支持 jpg, jpeg, png, gif, tif, tiff 等图片预览翻转缩放镜像
1. 使用 spring-boot 开发预览服务搭建部署非常简便
1. rest 接口提供服务语言平台特性(java,php,python,go,php....)都支持应用接入简单方便
1. 抽象预览服务接口方便二次开发非常方便添加其他类型文件预览支持
1. 最最重要Apache协议开源代码pull下来想干嘛就干嘛
1. 最最重要 Apache 协议开源代码 pull 下来想干嘛就干嘛
### 官网及文档
地址[https://kkfileview.keking.cn](https://kkfileview.keking.cn)
### 在线体验
> 请善待公共服务会不定时停用
地址http://file.keking.cn/
地址[https://file.keking.cn](https://file.keking.cn)
### 项目文档Project documentation
1. 详细wiki文档https://gitee.com/kekingcn/file-online-preview/wikis/pages
1. 中文文档https://gitee.com/kekingcn/file-online-preview/blob/master/README.md
1. English documenthttps://github.com/kekingcn/kkFileView/blob/master/README.en.md
1. English documenthttps://gitee.com/kekingcn/file-online-preview/blob/master/README.en.md
### 联系我们加入组织
> 我们会用心回答解决大家在项目使用中的问题也请大家在提问前至少Google或baidu珍爱生命远离无效的交流沟通
> 我们会用心回答解决大家在项目使用中的问题也请大家在提问前至少 Google baidu 珍爱生命远离无效的交流沟通
![输入图片说明](https://gitee.com/uploads/images/2017/1219/173717_934cb068_492218.png "屏幕截图.png")
QQ群号613025121
![](./doc/KK开源技术交流2群群聊二维码.png)
QQ群号~~613025121(已满)~~ 2群484680571
### 文档预览效果
> Excel预览效果
#### 1. 文本预览
支持所有类型的文本文档预览 由于文本文档类型过多无法全部枚举默认开启的类型如下 txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd
文本预览效果如下
![文本预览效果如下](https://kkfileview.keking.cn/img/preview/preview-text.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/093051_cd55b3ec_492218.png "屏幕截图.png")
> doc预览效果
#### 2. 图片预览
支持jpgjpegpnggif等图片预览翻转缩放镜像预览效果如下
![图片预览](https://kkfileview.keking.cn/img/preview/preview-image.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/092350_5b2ecbe5_492218.png "屏幕截图.png")
#### 3. word文档预览
支持docdocx文档预览word预览有两种模式一种是每页word转为图片预览另一种是整个word文档转成pdf再预览pdf两种模式的适用场景如下
* 图片预览word文件大前台加载整个pdf过慢
* pdf预览内网访问加载pdf快
图片预览模式预览效果如下
![word文档预览1](https://kkfileview.keking.cn/img/preview/preview-doc-image.png)
pdf预览模式预览效果如下
![word文档预览2](https://kkfileview.keking.cn/img/preview/preview-doc-pdf.png)
> zip,rar压缩预览效果
#### 4. ppt文档预览
支持pptpptx文档预览和word文档一样有两种预览模式
图片预览模式预览效果如下
![ppt文档预览1](https://kkfileview.keking.cn/img/preview/preview-ppt-image.png)
pdf预览模式预览效果如下
![ppt文档预览2](https://kkfileview.keking.cn/img/preview/preview-ppt-pdf.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/093806_46cede06_492218.png "屏幕截图.png")
#### 5. pdf文档预览
支持pdf文档预览和word文档一样有两种预览模式
图片预览模式预览效果如下
![pdf文档预览1](https://kkfileview.keking.cn/img/preview/preview-pdf-image.png)
pdf预览模式预览效果如下
![pdf文档预览2](https://kkfileview.keking.cn/img/preview/preview-pdf-pdf.png)
> png,jpeg,jpg等图片预览效果支持滚轮缩放旋转倒置等
#### 6. excel文档预览
支持xlsxlsx文档预览预览效果如下
![excel文档预览](https://kkfileview.keking.cn/img/preview/preview-xls.png)
![输入图片说明](https://gitee.com/uploads/images/2017/1213/094335_657a6f60_492218.png "屏幕截图.png")
#### 7. 压缩文件预览
支持zip,rar,jar,tar,gzip等压缩包预览效果如下
![压缩文件预览1](https://kkfileview.keking.cn/img/preview/preview-zip.png)
可点击压缩包中的文件名直接预览文件预览效果如下
![压缩文件预览2](https://kkfileview.keking.cn/img/preview/preview-zip-inner.png)
#### 8. 多媒体文件预览
理论上支持所有的视频音频文件由于无法枚举所有文件格式默认开启的类型如下
mp3,wav,mp4,flv
视频预览效果如下
![多媒体文件预览1](https://kkfileview.keking.cn/img/preview/preview-video.png)
音频预览效果如下
![多媒体文件预览2](https://kkfileview.keking.cn/img/preview/preview-audio.png)
#### 9. CAD文档预览
支持CAD dwg文档预览和word文档一样有两种预览模式
图片预览模式预览效果如下
![cad文档预览1](https://kkfileview.keking.cn/img/preview/preview-cad-image.png)
pdf预览模式预览效果如下
![cad文档预览2](https://kkfileview.keking.cn/img/preview/preview-cad-pdf.png)
考虑说明篇幅原因就不贴其他格式文件的预览效果了感兴趣的可以参考下面的实例搭建下
### 快速开始
@@ -50,29 +98,108 @@ QQ群号613025121
- redisson
- jodconverter
> 依赖外部环境
- redis
- OpenOffice或者LibreOffice
- redis (可选默认不用)
- OpenOffice 或者 LibreOffice( Windows 下已内置Linux 脚本启动模式会自动安装Mac OS 下需要手动安装)
1. 第一步pull项目https://github.com/kekingcn/file-online-preview.git
1. 第一步pull 项目 https://github.com/kekingcn/file-online-preview.git
2. 第二步配置redis地址和OpenOffice目录
```
#=============================================#spring Redisson配置#===================================#
spring.redisson.address = 192.168.1.204:6379
##资源映射路径(因为jar方式运行的原因)
file.dir = C:\\Users\\yudian\\Desktop\\dev\\
## openoffice相关配置
office.home = C:\\Program Files (x86)\\OpenOffice 4
```
file.dir为转换文件实际存储地址注意要以/结尾
3. 第三步运行FilePreviewApplication的main方法服务启动后访问http://localhost:8012/
3. 第二步运行 ServerMain main 方法服务启动后访问 http://localhost:8012/
会看到如下界面代表服务启动成功
![输入图片说明](https://gitee.com/uploads/images/2017/1213/100221_ea15202e_492218.png "屏幕截图.png")
### 历史更新记录
> 2021年7月6日v4.0.0 版本发布
1. 底层集成OpenOffice替换为LibreOfficeOffice文件兼容性增强预览效果提升
2. 修复压缩文件目录穿越漏洞
3. 修复PPT预览使用PDF模式无效
4. 修复PPT图片预览模式前端显示异常
5. 新增功能首页文件上传功能可通过配置实时开启或禁用
6. 优化增加Office进程关闭日志
7. 优化Windows环境下查找Office组件逻辑(内置的LibreOffice优先)
8. 优化启动Office进程改同步执行
> 2021年6月17日v3.6.0 版本发布
ofd 类型文件支持版本本次版本重要功能均由社区开发贡献感谢 @gaoxingzaq@zhangxiaoxiao9527 的代码贡献
1. 新增 ofd 类型文件预览支持ofd 是国产的类似 pdf 格式的文件
2. 新增了 ffmpeg 视频文件转码预览支持打开转码功能后理论上支持所有主流视频的预览 rmrmvbflv
3. 美化了 pptpptx 类型文件预览效果比之前版本好看太多
4. 更新了 pdfboxxstreamcommon-io 等依赖的版本
> 2021年1月28日
2020农历年最后一个版本发布主要包含了部分 UI 改进和解决了 QQ 群友 Issue 里反馈的 Bug 修复最最重要的是发个新版过个好年
1. 引入galimatias,解决不规范文件名导致文件下载异常
2. 更新index接入演示界面UI风格
3. 更新markdown文件预览UI风格
4. 更新XML文件预览UI风格调整类文本预览架构更方便扩展
5. 更新simTxT文件预览UI风格
6. 调整多图连续预览上下翻图的UI
7. 采用apache-common-io包简化所有的文件下载io操作
8. XML文件预览支持切换纯文本模式
9. 增强url base64解码失败时的提示信息
10. 修复导包错误以及图片预览 bug
11. 修复发行包运行时找不到日志目录的问题
12. 修复压缩包内多图连续预览的bug
13. 修复大小写文件类型后缀没通用匹配的问题
14. 指定Base64转码采用Apache Commons-code中的实现修复base64部分jdk版本下出现的异常
15. 修复类文本类型HTML文件预览的bug
16. 修复dwg文件预览时无法在jpg和pdf两种类型之间切换
17. escaping of dangerous characters to prevent reflected xss
18. 修复重复编码导致文档转图片预览失败的问题&编码规范
> 2020年12月27日
2020年年终大版本更新架构全面设计代码全面重构代码质量全面提升二次开发更便捷欢迎拉源码品鉴提issuepr共同建设
1. 架构模块调整,大量的代码重构代码质量提升N个等级欢迎品鉴
2. 增强XML文件预览效果新增XML文档数结构预览
3. 新增markdown文件预览支持预览支持md渲染和源文本切换支持
4. 切换底层web server为jetty解决这个issuehttps://github.com/kekingcn/kkFileView/issues/168
5. 引入cpdetector解决文件编码识别问题
6. url采用base64+urlencode双编码彻底解决各种奇葩文件名预览问题
7. 新增配置项office.preview.switch.disabled控制offic文件预览切换开关
8. 优化文本类型文件预览逻辑采用Base64传输内容避免预览时再次请求文件内容
9. office预览图片模式禁用图片放大效果达到图片和pdf预览效果一致的体验
10. 直接代码静态设置pdfbox兼容低版本jdk在IDEA中运行也不会有警告提示
11. 移除guavahutool等非必须的工具包减少代码体积
12. Office组件加载异步化提速应用启动速度最快到5秒内
13. 合理设置预览消费队列的线程数
14. 修复压缩包里文件再次预览失败的bug
15. 修复图片预览的bug
> 2020年05月20日
1. 新增支持全局水印并支持通过参数动态改变水印内容
2. 新增支持CAD文件预览
3. 新增base.url配置支持使用nginx反向代理和使用context-path
4. 支持所有配置项支持从环境变量里读取方便Docker镜像部署和集群中大规模使用
5. 支持配置限信任站点只能预览来自信任点的文件源保护预览服务不被滥用
6. 支持配置自定义缓存清理时间cron表达式
7. 全部能识别的纯文本直接预览不用再转跳下载.md .java .py等
8. 支持配置限制转换后的PDF文件下载
9. 优化maven打包配置解决 .sh 脚本可能出现换行符问题
10. 将前端所有CDN依赖放到本地方便没有外网连接的用户使用
11. 首页评论服务由搜狐畅言切换到Gitalk
12. 修复url中包含特殊字符可能会引起的预览异常
13. 修复转换文件队列addTask异常
14. 修复其他已经问题
15. 官网建设[https://kkfileview.keking.cn](https://kkfileview.keking.cn)
16. 官方Docker镜像仓库建设[https://hub.docker.com/r/keking/kkfileview](https://hub.docker.com/r/keking/kkfileview)
> 2019年06月18日
1. 支持自动清理缓存及预览文件
2. 支持http/https下载流url文件预览
3. 支持FTP url文件预览
4. 加入Docker构建
> 2019年04月08日
1. 缓存及队列实现抽象提供JDK和REDIS两种实现(REDIS成为可选依赖)
2. 打包方式提供zip和tar.gz包并提供一键启动脚本
> 2018年01月19日
1. 大文件入队提前处理
@@ -99,5 +226,13 @@ file.dir为转换文件实际存储地址注意要以/结尾
1. 引入pdf.js预览doc等文件支持doc标题生成pdf预览菜单支持手机端预览
### 使用登记
如果这个项目解决了你的实际问题可在https://gitee.com/kekingcn/file-online-preview/issues/IGSBV
如果这个项目解决了你的实际问题可在 https://gitee.com/kekingcn/file-online-preview/issues/IGSBV
登记下如果节省了你的三方预览服务费用也愿意支持下的话可点击下方捐助请作者喝杯咖啡也是非常感谢
### Stars 趋势图
#### Gitee
[![Stargazers over time](https://whnb.wang/img/kekingcn/file-online-preview)](https://whnb.wang/kekingcn/file-online-preview?e=86400)
#### GitHub
[![Stargazers over time](https://starchart.cc/kekingcn/kkFileView.svg)](https://starchart.cc/kekingcn/kkFileView)

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -0,0 +1,38 @@
FROM ubuntu:20.04
MAINTAINER chenjh "842761733@qq.com"
# 内置一些常用的中文字体,避免普遍性乱码
COPY fonts/* /usr/share/fonts/chinese/
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
apt-get clean && apt-get update &&\
apt-get install -y locales && apt-get install -y language-pack-zh-hans &&\
localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 && locale-gen zh_CN.UTF-8 &&\
export DEBIAN_FRONTEND=noninteractive &&\
apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
apt-get install -y libxrender1 && apt-get install -y libxt6 && apt-get install -y libxext-dev && apt-get install -y libfreetype6-dev &&\
apt-get install -y wget && apt-get install -y ttf-mscorefonts-installer && apt-get install -y fontconfig &&\
apt-get install ttf-wqy-microhei &&\
apt-get install ttf-wqy-zenhei &&\
apt-get install xfonts-wqy &&\
cd /tmp &&\
wget https://kkfileview.keking.cn/server-jre-8u251-linux-x64.tar.gz &&\
tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
# 安装 libreoffice
apt-get install -y libxinerama1 libcairo2 libcups2 libx11-xcb1 &&\
wget https://kkfileview.keking.cn/LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.1.4.2_Linux_x86-64_deb/DEBS &&\
dpkg -i *.deb &&\
# 清理临时文件
rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
cd /usr/share/fonts/chinese &&\
mkfontscale &&\
mkfontdir &&\
fc-cache -fv
ENV JAVA_HOME /usr/local/jdk1.8.0_251
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ENTRYPOINT ["java","-version"]

View File

@@ -0,0 +1,2 @@
# 执行如下命令构建基础镜像加快kkfileview docker镜像构建与发布
docker build --tag keking/kkfileview-jdk:4.1.1 .

View File

View File

@@ -1,160 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.keking</groupId>
<artifactId>jodconverter-core</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<!-- required for org.hyperic:sigar -->
<id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>juh</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>ridl</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>unoil</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<!-- for the command line tool -->
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hyperic</groupId>
<artifactId>sigar</artifactId>
<version>1.6.5.132</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 要将源码放上去需要加入这个插件 -->
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<configuration>
<!-- don't run tests in parallel -->
<perCoreThreadCount>false</perCoreThreadCount>
<threadCount>1</threadCount>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifest>
<mainClass>org.artofsolving.jodconverter.cli.Convert</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/dist.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</reporting>
<!-- distribute目录 -->
<distributionManagement>
<repository>
<id>repo</id>
<name>User Project Releases</name>
<url>http://192.168.1.204:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>repo</id>
<name>User Project SNAPSHOTS</name>
<url>http://192.168.1.204:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>

View File

@@ -1,111 +0,0 @@
//
// JODConverter - Java OpenDocument Converter
// Copyright 2004-2012 Mirko Nasato and contributors
//
// JODConverter is Open Source software, you can redistribute it and/or
// modify it under either (at your option) of the following licenses
//
// 1. The GNU Lesser General Public License v3 (or later)
// -> http://www.gnu.org/licenses/lgpl-3.0.txt
// 2. The Apache License, Version 2.0
// -> http://www.apache.org/licenses/LICENSE-2.0.txt
//
package org.artofsolving.jodconverter.office;
import java.io.File;
import java.util.Map;
import org.artofsolving.jodconverter.util.PlatformUtils;
import com.sun.star.beans.PropertyValue;
import com.sun.star.uno.UnoRuntime;
public class OfficeUtils {
public static final String SERVICE_DESKTOP = "com.sun.star.frame.Desktop";
private OfficeUtils() {
throw new AssertionError("utility class must not be instantiated");
}
public static <T> T cast(Class<T> type, Object object) {
return (T) UnoRuntime.queryInterface(type, object);
}
public static PropertyValue property(String name, Object value) {
PropertyValue propertyValue = new PropertyValue();
propertyValue.Name = name;
propertyValue.Value = value;
return propertyValue;
}
@SuppressWarnings("unchecked")
public static PropertyValue[] toUnoProperties(Map<String,?> properties) {
PropertyValue[] propertyValues = new PropertyValue[properties.size()];
int i = 0;
for (Map.Entry<String,?> entry : properties.entrySet()) {
Object value = entry.getValue();
if (value instanceof Map) {
Map<String,Object> subProperties = (Map<String,Object>) value;
value = toUnoProperties(subProperties);
}
propertyValues[i++] = property((String) entry.getKey(), value);
}
return propertyValues;
}
public static String toUrl(File file) {
String path = file.toURI().getRawPath();
String url = path.startsWith("//") ? "file:" + path : "file://" + path;
return url.endsWith("/") ? url.substring(0, url.length() - 1) : url;
}
public static File getDefaultOfficeHome() {
if (System.getProperty("office.home") != null) {
return new File(System.getProperty("office.home"));
}
if (PlatformUtils.isWindows()) {
// %ProgramFiles(x86)% on 64-bit machines; %ProgramFiles% on 32-bit ones
String programFiles = System.getenv("ProgramFiles(x86)");
if (programFiles == null) {
programFiles = System.getenv("ProgramFiles");
}
return findOfficeHome(
programFiles + File.separator + "OpenOffice 4",
programFiles + File.separator + "LibreOffice 4"
);
} else if (PlatformUtils.isMac()) {
return findOfficeHome(
"/Applications/OpenOffice.org.app/Contents",
"/Applications/LibreOffice.app/Contents"
);
} else {
// Linux or other *nix variants
return findOfficeHome(
"/opt/openoffice.org3",
"/opt/libreoffice",
"/usr/lib/openoffice",
"/usr/lib/libreoffice"
);
}
}
private static File findOfficeHome(String... knownPaths) {
for (String path : knownPaths) {
File home = new File(path);
if (getOfficeExecutable(home).isFile()) {
return home;
}
}
return null;
}
public static File getOfficeExecutable(File officeHome) {
if (PlatformUtils.isMac()) {
return new File(officeHome, "MacOS/soffice.bin");
} else {
return new File(officeHome, "program/soffice.bin");
}
}
}

View File

@@ -1,171 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jodconverter-web</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<ufile.sdk.verison>1.0-SNAPSHOT</ufile.sdk.verison>
<logging.path>${basedir}/target/classes/logs</logging.path>
<appName>file-preview</appName>
</properties>
<repositories>
<repository>
<!-- required for org.hyperic:sigar -->
<id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cn.keking</groupId>
<artifactId>jodconverter-core</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- REDISSON -->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>org.apache.poi.xwpf.converter.core</artifactId>
<version>1.0.5</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>org.apache.poi.xwpf.converter.xhtml</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.document</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!-- 解压(apache) -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.9</version>
</dependency>
<!-- 解压(rar)-->
<dependency>
<groupId>com.github.junrar</groupId>
<artifactId>junrar</artifactId>
<version>0.7</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jchardet</groupId>
<artifactId>jchardet</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,18 +0,0 @@
package cn.keking;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.Properties;
@SpringBootApplication
@EnableScheduling
@ComponentScan(value = "cn.keking.*")
public class FilePreviewApplication {
public static void main(String[] args) {
Properties properties = System.getProperties();
System.out.println(properties.get("user.dir"));
SpringApplication.run(FilePreviewApplication.class, args);
}
}

View File

@@ -1,211 +0,0 @@
package cn.keking.extend;
import com.google.common.collect.Maps;
import com.sun.star.beans.PropertyValue;
import org.artofsolving.jodconverter.document.DocumentFamily;
import org.artofsolving.jodconverter.document.DocumentFormat;
import org.artofsolving.jodconverter.document.SimpleDocumentFormatRegistry;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 重写了DefaultDocumentFormatRegistry类因为要添加自定义行为比如字符编码。。。
* @author yudian-it
* @date 2017/12/5
*/
public class ControlDocumentFormatRegistry extends SimpleDocumentFormatRegistry {
public ControlDocumentFormatRegistry() {
DocumentFormat pdf = new DocumentFormat("Portable Document Format", "pdf", "application/pdf");
pdf.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "writer_pdf_Export"));
pdf.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "calc_pdf_Export"));
pdf.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress_pdf_Export"));
pdf.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw_pdf_Export"));
addFormat(pdf);
DocumentFormat swf = new DocumentFormat("Macromedia Flash", "swf", "application/x-shockwave-flash");
swf.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress_flash_Export"));
swf.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw_flash_Export"));
addFormat(swf);
// disabled because it's not always available
//DocumentFormat xhtml = new DocumentFormat("XHTML", "xhtml", "application/xhtml+xml");
//xhtml.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "XHTML Writer File"));
//xhtml.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "XHTML Calc File"));
//xhtml.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "XHTML Impress File"));
//addFormat(xhtml);
DocumentFormat html = new DocumentFormat("HTML", "html", "text/html");
// HTML is treated as Text when supplied as input, but as an output it is also
// available for exporting Spreadsheet and Presentation formats
html.setInputFamily(DocumentFamily.TEXT);
html.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "HTML (StarWriter)"));
Map<String,Object> htmlLoadAndStoreProperties = new LinkedHashMap<String,Object>();
htmlLoadAndStoreProperties.put("FilterName", "HTML (StarCalc)");
htmlLoadAndStoreProperties.put("FilterOptions", "utf8");
html.setStoreProperties(DocumentFamily.SPREADSHEET, htmlLoadAndStoreProperties);
html.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress_html_Export"));
addFormat(html);
DocumentFormat odt = new DocumentFormat("OpenDocument Text", "odt", "application/vnd.oasis.opendocument.text");
odt.setInputFamily(DocumentFamily.TEXT);
odt.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "writer8"));
addFormat(odt);
DocumentFormat sxw = new DocumentFormat("OpenOffice.org 1.0 Text Document", "sxw", "application/vnd.sun.xml.writer");
sxw.setInputFamily(DocumentFamily.TEXT);
sxw.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "StarOffice XML (Writer)"));
addFormat(sxw);
DocumentFormat doc = new DocumentFormat("Microsoft Word", "doc", "application/msword");
doc.setInputFamily(DocumentFamily.TEXT);
doc.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "MS Word 97"));
addFormat(doc);
DocumentFormat docx = new DocumentFormat("Microsoft Word 2007 XML", "docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
docx.setInputFamily(DocumentFamily.TEXT);
addFormat(docx);
DocumentFormat rtf = new DocumentFormat("Rich Text Format", "rtf", "text/rtf");
rtf.setInputFamily(DocumentFamily.TEXT);
rtf.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "Rich Text Format"));
addFormat(rtf);
DocumentFormat wpd = new DocumentFormat("WordPerfect", "wpd", "application/wordperfect");
wpd.setInputFamily(DocumentFamily.TEXT);
addFormat(wpd);
DocumentFormat txt = new DocumentFormat("Plain Text", "txt", "text/plain");
txt.setInputFamily(DocumentFamily.TEXT);
Map<String,Object> txtLoadAndStoreProperties = new LinkedHashMap<String,Object>();
txtLoadAndStoreProperties.put("FilterName", "Text (encoded)");
txtLoadAndStoreProperties.put("FilterOptions", "utf8");
txt.setLoadProperties(txtLoadAndStoreProperties);
txt.setStoreProperties(DocumentFamily.TEXT, txtLoadAndStoreProperties);
addFormat(txt);
DocumentFormat wikitext = new DocumentFormat("MediaWiki wikitext", "wiki", "text/x-wiki");
wikitext.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "MediaWiki"));
//addFormat(wikitext);
DocumentFormat ods = new DocumentFormat("OpenDocument Spreadsheet", "ods", "application/vnd.oasis.opendocument.spreadsheet");
ods.setInputFamily(DocumentFamily.SPREADSHEET);
ods.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "calc8"));
addFormat(ods);
DocumentFormat sxc = new DocumentFormat("OpenOffice.org 1.0 Spreadsheet", "sxc", "application/vnd.sun.xml.calc");
sxc.setInputFamily(DocumentFamily.SPREADSHEET);
sxc.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "StarOffice XML (Calc)"));
addFormat(sxc);
DocumentFormat xls = new DocumentFormat("Microsoft Excel", "xls", "application/vnd.ms-excel");
xls.setInputFamily(DocumentFamily.SPREADSHEET);
xls.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "MS Excel 97"));
addFormat(xls);
DocumentFormat xlsx = new DocumentFormat("Microsoft Excel 2007 XML", "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
xlsx.setInputFamily(DocumentFamily.SPREADSHEET);
addFormat(xlsx);
DocumentFormat csv = new DocumentFormat("Comma Separated Values", "csv", "text/csv");
csv.setInputFamily(DocumentFamily.SPREADSHEET);
Map<String,Object> csvLoadAndStoreProperties = new LinkedHashMap<String,Object>();
csvLoadAndStoreProperties.put("FilterName", "Text - txt - csv (StarCalc)");
csvLoadAndStoreProperties.put("FilterOptions", "44,34,0"); // Field Separator: ','; Text Delimiter: '"'
csv.setLoadProperties(csvLoadAndStoreProperties);
csv.setStoreProperties(DocumentFamily.SPREADSHEET, csvLoadAndStoreProperties);
addFormat(csv);
DocumentFormat tsv = new DocumentFormat("Tab Separated Values", "tsv", "text/tab-separated-values");
tsv.setInputFamily(DocumentFamily.SPREADSHEET);
Map<String,Object> tsvLoadAndStoreProperties = new LinkedHashMap<String,Object>();
tsvLoadAndStoreProperties.put("FilterName", "Text - txt - csv (StarCalc)");
tsvLoadAndStoreProperties.put("FilterOptions", "9,34,0"); // Field Separator: '\t'; Text Delimiter: '"'
tsv.setLoadProperties(tsvLoadAndStoreProperties);
tsv.setStoreProperties(DocumentFamily.SPREADSHEET, tsvLoadAndStoreProperties);
addFormat(tsv);
DocumentFormat odp = new DocumentFormat("OpenDocument Presentation", "odp", "application/vnd.oasis.opendocument.presentation");
odp.setInputFamily(DocumentFamily.PRESENTATION);
odp.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress8"));
addFormat(odp);
DocumentFormat sxi = new DocumentFormat("OpenOffice.org 1.0 Presentation", "sxi", "application/vnd.sun.xml.impress");
sxi.setInputFamily(DocumentFamily.PRESENTATION);
sxi.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "StarOffice XML (Impress)"));
addFormat(sxi);
DocumentFormat ppt = new DocumentFormat("Microsoft PowerPoint", "ppt", "application/vnd.ms-powerpoint");
ppt.setInputFamily(DocumentFamily.PRESENTATION);
ppt.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "MS PowerPoint 97"));
addFormat(ppt);
DocumentFormat pptx = new DocumentFormat("Microsoft PowerPoint 2007 XML", "pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
pptx.setInputFamily(DocumentFamily.PRESENTATION);
addFormat(pptx);
DocumentFormat odg = new DocumentFormat("OpenDocument Drawing", "odg", "application/vnd.oasis.opendocument.graphics");
odg.setInputFamily(DocumentFamily.DRAWING);
odg.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw8"));
addFormat(odg);
DocumentFormat svg = new DocumentFormat("Scalable Vector Graphics", "svg", "image/svg+xml");
svg.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw_svg_Export"));
addFormat(svg);
}
/**
* 创建默认的导出属性
* @return
*/
private PropertyValue[] getCommonPropertyValue() {
PropertyValue[] aFilterData = new PropertyValue[11];
// 不显示文档标题
aFilterData[0] = new PropertyValue();
aFilterData[0].Name = "DisplayPDFDocumentTitle";
aFilterData[0].Value= true;
// 导出文件编码方式
aFilterData[1] = new PropertyValue();
aFilterData[1].Name = "Encoding";
aFilterData[1].Value= "UTF-8";
// 隐藏工具条
aFilterData[2] = new PropertyValue();
aFilterData[2].Name = "HideViewerToolbar";
aFilterData[2].Value= false;
// 隐藏窗口控制条
aFilterData[3] = new PropertyValue();
aFilterData[3].Name = "HideViewerWindowControls";
aFilterData[3].Value= true;
// 全屏展示
aFilterData[4] = new PropertyValue();
aFilterData[4].Name = "OpenInFullScreenMode";
aFilterData[4].Value= false;
// 第一页左边展示
aFilterData[5] = new PropertyValue();
aFilterData[5].Name = "MathToMathType";
aFilterData[5].Value= true;
// 文档标题内容
aFilterData[6] = new PropertyValue();
aFilterData[6].Name = "Watermark";
aFilterData[6].Value= "KEKING.CN";
// 导出文件编码方式
aFilterData[7] = new PropertyValue();
aFilterData[7].Name = "CharacterSet";
aFilterData[7].Value= "UTF-8";
// 导出文件编码方式
aFilterData[8] = new PropertyValue();
aFilterData[8].Name = "Encoding";
aFilterData[8].Value= "UTF-8";
// 导出文件编码方式
aFilterData[9] = new PropertyValue();
aFilterData[9].Name = "CharSet";
aFilterData[9].Value= "UTF-8";
// 导出文件编码方式
aFilterData[10] = new PropertyValue();
aFilterData[10].Name = "charset";
aFilterData[10].Value= "UTF-8";
return aFilterData;
}
}

View File

@@ -1,33 +0,0 @@
package cn.keking.filters;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
*
* @author yudian-it
* @date 2017/11/30
*/
public class ChinesePathFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
StringBuilder pathBuilder = new StringBuilder();
pathBuilder.append(request.getScheme()).append("://").append(request.getServerName()).append(":")
.append(request.getServerPort()).append(((HttpServletRequest)request).getContextPath()).append("/");
request.setAttribute("baseUrl", pathBuilder.toString());
chain.doFilter(request, response);
}
@Override
public void destroy() {
}
}

View File

@@ -1,23 +0,0 @@
package cn.keking.filters;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
*
* @author yudian-it
* @date 2017/11/30
*/
@Configuration
public class FilterConfiguration {
@Bean
public FilterRegistrationBean getChinesePathFilter(){
ChinesePathFilter filter = new ChinesePathFilter();
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(filter);
return registrationBean;
}
}

View File

@@ -1,69 +0,0 @@
package cn.keking.model;
/**
* Created by kl on 2018/1/17.
* Content :
*/
public class FileAttribute {
private FileType type;
private String suffix;
private String name;
private String url;
private String decodedUrl;
public FileAttribute() {
}
public FileAttribute(FileType type, String suffix, String name, String url, String decodedUrl) {
this.type = type;
this.suffix = suffix;
this.name = name;
this.url = url;
this.decodedUrl = decodedUrl;
}
public FileType getType() {
return type;
}
public void setType(FileType type) {
this.type = type;
}
public String getSuffix() {
return suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDecodedUrl() {
return decodedUrl;
}
public void setDecodedUrl(String decodedUrl) {
this.decodedUrl = decodedUrl;
}
}

View File

@@ -1,28 +0,0 @@
package cn.keking.model;
/**
* Created by kl on 2018/1/17.
* Content :文件类型文本office压缩包等等
*/
public enum FileType {
picture("pictureFilePreviewImpl"),
compress("compressFilePreviewImpl"),
office("officeFilePreviewImpl"),
simText("simTextFilePreviewImpl"),
pdf("pdfFilePreviewImpl"),
other("otherFilePreviewImpl"),
media("mediaFilePreviewImpl");
private String instanceName;
FileType(String instanceName){
this.instanceName=instanceName;
}
public String getInstanceName() {
return instanceName;
}
public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
}
}

View File

@@ -1,57 +0,0 @@
package cn.keking.model;
import java.io.Serializable;
/**
* 接口返回值结构
* @author yudian-it
* @date 2017/11/17
*/
public class ReturnResponse<T> implements Serializable{
private static final long serialVersionUID = 313975329998789878L;
/**
* 返回状态
* 0. 成功
* 1. 失败
*/
private int code;
/**
* 返回状态描述
* XXX成功
* XXX失败
*/
private String msg;
private T content;
public ReturnResponse(int code, String msg, T content) {
this.code = code;
this.msg = msg;
this.content = content;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getContent() {
return content;
}
public void setContent(T content) {
this.content = content;
}
}

View File

@@ -1,84 +0,0 @@
package cn.keking.service;
import cn.keking.model.FileAttribute;
import cn.keking.model.FileType;
import cn.keking.utils.FileUtils;
import org.redisson.api.RBlockingQueue;
import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.ExtendedModelMap;
import javax.annotation.PostConstruct;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Created by kl on 2018/1/19.
* Content :消费队列中的转换文件
*/
@Service
public class FileConverQueueTask {
Logger logger= LoggerFactory.getLogger(getClass());
public static final String queueTaskName="FileConverQueueTask";
@Autowired
FilePreviewFactory previewFactory;
@Autowired
RedissonClient redissonClient;
@Autowired
FileUtils fileUtils;
@PostConstruct
public void startTask(){
ExecutorService executorService = Executors.newFixedThreadPool(3);
executorService.submit(new ConverTask(previewFactory,redissonClient,fileUtils));
logger.info("队列处理文件转换任务启动完成 ");
}
class ConverTask implements Runnable{
FilePreviewFactory previewFactory;
RedissonClient redissonClient;
FileUtils fileUtils;
public ConverTask(FilePreviewFactory previewFactory, RedissonClient redissonClient,FileUtils fileUtils) {
this.previewFactory = previewFactory;
this.redissonClient = redissonClient;
this.fileUtils=fileUtils;
}
@Override
public void run() {
while (true) {
try {
final RBlockingQueue<String> queue = redissonClient.getBlockingQueue(FileConverQueueTask.queueTaskName);
String url = queue.take();
if(url!=null){
FileAttribute fileAttribute=fileUtils.getFileAttribute(url);
logger.info("正在处理转换任务,文件名称【{}】",fileAttribute.getName());
FileType fileType=fileAttribute.getType();
if(fileType.equals(FileType.compress) || fileType.equals(FileType.office)){
FilePreview filePreview=previewFactory.get(url);
filePreview.filePreviewHandle(url,new ExtendedModelMap());
}
}
} catch (Exception e) {
try {
Thread.sleep(1000*10);
}catch (Exception ex){
ex.printStackTrace();
}
e.printStackTrace();
}
}
}
}
}

View File

@@ -1,11 +0,0 @@
package cn.keking.service;
import org.springframework.ui.Model;
/**
* Created by kl on 2018/1/17.
* Content :
*/
public interface FilePreview {
String filePreviewHandle(String url, Model model);
}

View File

@@ -1,30 +0,0 @@
package cn.keking.service;
import cn.keking.model.FileAttribute;
import cn.keking.utils.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import java.util.Map;
/**
* Created by kl on 2018/1/17.
* Content :
*/
@Service
public class FilePreviewFactory {
@Autowired
FileUtils fileUtils;
@Autowired
ApplicationContext context;
public FilePreview get(String url) {
Map<String, FilePreview> filePreviewMap = context.getBeansOfType(FilePreview.class);
FileAttribute fileAttribute = fileUtils.getFileAttribute(url);
return filePreviewMap.get(fileAttribute.getType().getInstanceName());
}
}

View File

@@ -1,62 +0,0 @@
package cn.keking.service.impl;
import cn.keking.model.FileAttribute;
import cn.keking.model.ReturnResponse;
import cn.keking.service.FilePreview;
import cn.keking.utils.DownloadUtils;
import cn.keking.utils.FileUtils;
import cn.keking.utils.ZipReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
/**
* Created by kl on 2018/1/17.
* Content :处理压缩包文件
*/
@Service
public class CompressFilePreviewImpl implements FilePreview{
@Autowired
FileUtils fileUtils;
@Autowired
DownloadUtils downloadUtils;
@Autowired
ZipReader zipReader;
@Override
public String filePreviewHandle(String url, Model model) {
FileAttribute fileAttribute=fileUtils.getFileAttribute(url);
String fileName=fileAttribute.getName();
String decodedUrl=fileAttribute.getDecodedUrl();
String suffix=fileAttribute.getSuffix();
String fileTree = null;
// 判断文件名是否存在(redis缓存读取)
if (!StringUtils.hasText(fileUtils.getConvertedFile(fileName))) {
ReturnResponse<String> response = downloadUtils.downLoad(decodedUrl, suffix, fileName);
if (0 != response.getCode()) {
model.addAttribute("msg", response.getMsg());
return "fileNotSupported";
}
String filePath = response.getContent();
if ("zip".equalsIgnoreCase(suffix) || "jar".equalsIgnoreCase(suffix) || "gzip".equalsIgnoreCase(suffix)) {
fileTree = zipReader.readZipFile(filePath, fileName);
} else if ("rar".equalsIgnoreCase(suffix)) {
fileTree = zipReader.unRar(filePath, fileName);
}
fileUtils.addConvertedFile(fileName, fileTree);
} else {
fileTree = fileUtils.getConvertedFile(fileName);
}
if (null != fileTree) {
model.addAttribute("fileTree", fileTree);
return "compress";
} else {
model.addAttribute("msg", "压缩文件类型不受支持尝试在压缩的时候选择RAR4格式");
return "fileNotSupported";
}
}
}

View File

@@ -1,27 +0,0 @@
package cn.keking.service.impl;
import cn.keking.service.FilePreview;
import cn.keking.utils.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
/**
* @author : kl
* @authorboke : kailing.pub
* @create : 2018-03-25 上午11:58
* @description:
**/
@Service
public class MediaFilePreviewImpl implements FilePreview {
@Autowired
FileUtils fileUtils;
@Override
public String filePreviewHandle(String url, Model model) {
model.addAttribute("mediaUrl", url);
return "media";
}
}

View File

@@ -1,74 +0,0 @@
package cn.keking.service.impl;
import cn.keking.model.FileAttribute;
import cn.keking.model.ReturnResponse;
import cn.keking.service.FilePreview;
import cn.keking.utils.DownloadUtils;
import cn.keking.utils.FileUtils;
import cn.keking.utils.OfficeToPdf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.ui.ExtendedModelMap;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import java.io.File;
/**
* Created by kl on 2018/1/17.
* Content :处理office文件
*/
@Service
public class OfficeFilePreviewImpl implements FilePreview {
@Autowired
FileUtils fileUtils;
@Value("${file.dir}")
String fileDir;
@Autowired
DownloadUtils downloadUtils;
@Autowired
private OfficeToPdf officeToPdf;
@Override
public String filePreviewHandle(String url, Model model) {
FileAttribute fileAttribute=fileUtils.getFileAttribute(url);
String suffix=fileAttribute.getSuffix();
String fileName=fileAttribute.getName();
String decodedUrl=fileAttribute.getDecodedUrl();
boolean isHtml = suffix.equalsIgnoreCase("xls") || suffix.equalsIgnoreCase("xlsx");
String pdfName = fileName.substring(0, fileName.lastIndexOf(".") + 1) + (isHtml ? "html" : "pdf");
// 判断之前是否已转换过,如果转换过,直接返回,否则执行转换
if (!fileUtils.listConvertedFiles().containsKey(pdfName)) {
String filePath = fileDir + fileName;
if (!new File(filePath).exists()) {
ReturnResponse<String> response = downloadUtils.downLoad(decodedUrl, suffix, null);
if (0 != response.getCode()) {
model.addAttribute("msg", response.getMsg());
return "fileNotSupported";
}
filePath = response.getContent();
}
String outFilePath = fileDir + pdfName;
if (StringUtils.hasText(outFilePath)) {
officeToPdf.openOfficeToPDF(filePath, outFilePath);
File f = new File(filePath);
if (f.exists()) {
f.delete();
}
if (isHtml) {
// 对转换后的文件进行操作(改变编码方式)
fileUtils.doActionConvertedFile(outFilePath);
}
// 加入缓存
fileUtils.addConvertedFile(pdfName, fileUtils.getRelativePath(outFilePath));
}
}
model.addAttribute("pdfUrl", pdfName);
return isHtml ? "html" : "pdf";
}
}

View File

@@ -1,28 +0,0 @@
package cn.keking.service.impl;
import cn.keking.model.FileAttribute;
import cn.keking.service.FilePreview;
import cn.keking.utils.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
/**
* Created by kl on 2018/1/17.
* Content :其他文件
*/
@Service
public class OtherFilePreviewImpl implements FilePreview {
@Autowired
FileUtils fileUtils;
@Override
public String filePreviewHandle(String url, Model model) {
FileAttribute fileAttribute=fileUtils.getFileAttribute(url);
model.addAttribute("fileType",fileAttribute.getSuffix());
model.addAttribute("msg", "系统还不支持该格式文件的在线预览," +
"如有需要请按下方显示的邮箱地址联系系统维护人员");
return "fileNotSupported";
}
}

View File

@@ -1,19 +0,0 @@
package cn.keking.service.impl;
import cn.keking.service.FilePreview;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
/**
* Created by kl on 2018/1/17.
* Content :处理pdf文件
*/
@Service
public class PdfFilePreviewImpl implements FilePreview{
@Override
public String filePreviewHandle(String url, Model model) {
model.addAttribute("pdfUrl", url);
return "pdf";
}
}

View File

@@ -1,37 +0,0 @@
package cn.keking.service.impl;
import cn.keking.service.FilePreview;
import cn.keking.utils.FileUtils;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.web.context.request.RequestContextHolder;
import java.util.List;
/**
* Created by kl on 2018/1/17.
* Content :图片文件处理
*/
@Service
public class PictureFilePreviewImpl implements FilePreview {
@Autowired
FileUtils fileUtils;
@Override
public String filePreviewHandle(String url, Model model) {
String fileKey=(String) RequestContextHolder.currentRequestAttributes().getAttribute("fileKey",0);
List imgUrls = Lists.newArrayList(url);
try{
imgUrls.clear();
imgUrls.addAll(fileUtils.getRedisImgUrls(fileKey));
}catch (Exception e){
imgUrls = Lists.newArrayList(url);
}
model.addAttribute("imgurls", imgUrls);
model.addAttribute("currentUrl",url);
return "picture";
}
}

View File

@@ -1,40 +0,0 @@
package cn.keking.service.impl;
import cn.keking.model.FileAttribute;
import cn.keking.model.ReturnResponse;
import cn.keking.service.FilePreview;
import cn.keking.utils.FileUtils;
import cn.keking.utils.SimTextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
/**
* Created by kl on 2018/1/17.
* Content :处理文本文件
*/
@Service
public class SimTextFilePreviewImpl implements FilePreview{
@Autowired
SimTextUtil simTextUtil;
@Autowired
FileUtils fileUtils;
@Override
public String filePreviewHandle(String url, Model model){
FileAttribute fileAttribute=fileUtils.getFileAttribute(url);
String decodedUrl=fileAttribute.getDecodedUrl();
String fileName=fileAttribute.getName();
ReturnResponse<String> response = simTextUtil.readSimText(decodedUrl, fileName);
if (0 != response.getCode()) {
model.addAttribute("msg", response.getMsg());
model.addAttribute("fileType",fileAttribute.getSuffix());
return "fileNotSupported";
}
model.addAttribute("ordinaryUrl", response.getMsg());
return "txt";
}
}

View File

@@ -1,68 +0,0 @@
package cn.keking.utils;
import com.sun.star.document.UpdateDocMode;
import cn.keking.extend.ControlDocumentFormatRegistry;
import org.artofsolving.jodconverter.OfficeDocumentConverter;
import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
import org.artofsolving.jodconverter.office.OfficeManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
/**
* 创建文件转换器
*
* @author yudian-it
* @date 2017/11/13
*/
@Component
public class ConverterUtils {
@Value("${office.home}")
String officeHome;
// OpenOfficeConnection connection;
OfficeManager officeManager;
@PostConstruct
public void initOfficeManager() {
//// connection = new SocketOpenOfficeConnection(host,8100);
//// connection.connect();
DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
configuration.setOfficeHome(officeHome);
configuration.setPortNumber(8100);
officeManager = configuration.buildOfficeManager();
officeManager.start();
// 设置任务执行超时为5分钟
// configuration.setTaskExecutionTimeout(1000 * 60 * 5L);//
// 设置任务队列超时为24小时
// configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);//
}
public OfficeDocumentConverter getDocumentConverter() {
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager, new ControlDocumentFormatRegistry());
converter.setDefaultLoadProperties(getLoadProperties());
return converter;
}
private Map<String,?> getLoadProperties() {
Map<String,Object> loadProperties = new HashMap<>(10);
loadProperties.put("Hidden", true);
loadProperties.put("ReadOnly", true);
loadProperties.put("UpdateDocMode", UpdateDocMode.QUIET_UPDATE);
loadProperties.put("CharacterSet", Charset.forName("UTF-8").name());
return loadProperties;
}
@PreDestroy
public void destroyOfficeManager(){
if (null != officeManager && officeManager.isRunning()) {
officeManager.stop();
}
}
}

View File

@@ -1,74 +0,0 @@
package cn.keking.utils;
import java.io.File;
public class DeleteFileUtil {
/**
* 删除单个文件
*
* @param fileName
* 要删除的文件的文件名
* @return 单个文件删除成功返回true否则返回false
*/
public static boolean deleteFile(String fileName) {
File file = new File(fileName);
// 如果文件路径所对应的文件存在,并且是一个文件,则直接删除
if (file.exists() && file.isFile()) {
if (file.delete()) {
System.out.println("删除单个文件" + fileName + "成功!");
return true;
} else {
System.out.println("删除单个文件" + fileName + "失败!");
return false;
}
} else {
System.out.println("删除单个文件失败:" + fileName + "不存在!");
return false;
}
}
/**
* 删除目录及目录下的文件
*
* @param dir
* 要删除的目录的文件路径
* @return 目录删除成功返回true否则返回false
*/
public static boolean deleteDirectory(String dir) {
// 如果dir不以文件分隔符结尾自动添加文件分隔符
if (!dir.endsWith(File.separator)) {
dir = dir + File.separator;
}
File dirFile = new File(dir);
// 如果dir对应的文件不存在或者不是一个目录则退出
if ((!dirFile.exists()) || (!dirFile.isDirectory())) {
System.out.println("删除目录失败:" + dir + "不存在!");
return false;
}
boolean flag = true;
// 删除文件夹中的所有文件包括子目录
File[] files = dirFile.listFiles();
for (int i = 0; i < files.length; i++) {
// 删除子文件
if (files[i].isFile()) {
flag = DeleteFileUtil.deleteFile(files[i].getAbsolutePath());
if (!flag)
break;
}
// 删除子目录
else if (files[i].isDirectory()) {
flag = DeleteFileUtil.deleteDirectory(files[i]
.getAbsolutePath());
if (!flag)
break;
}
}
if (!flag) {
System.out.println("删除目录失败!");
return false;
}
return true;
}
}

View File

@@ -1,197 +0,0 @@
package cn.keking.utils;
import cn.keking.model.ReturnResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.*;
import java.net.*;
import java.util.UUID;
/**
* @author yudian-it
*/
@Component
public class DownloadUtils {
@Value("${file.dir}")
String fileDir;
/**
* 一开始测试的时候发现有些文件没有下载下来,而有些可以;当时也是郁闷了好一阵,但是最终还是不得解
* 再次测试的时候通过前台对比url发现原来参数中有+号特殊字符存在,但是到后之后却变成了空格,突然恍然大悟
* 应该是转义出了问题url转义中会把+号当成空格来计算所以才会出现这种情况遂想要通过整体替换空格为加号因为url
* 中的参数部分是不会出现空格的但是文件名中就不好确定了所以只对url参数部分做替换
* 注: 针对URLEncoder.encode(s,charset)会将空格转成+的情况需要做下面的替换工作
* @param urlAddress
* @param type
* @return
*/
public ReturnResponse<String> downLoad(String urlAddress, String type, String fileName){
ReturnResponse<String> response = new ReturnResponse<>(0, "下载成功!!!", "");
URL url = null;
try {
urlAddress = replacePlusMark(urlAddress);
urlAddress = encodeUrlParam(urlAddress);
// 因为tomcat不能处理'+'号,所以讲'+'号替换成'%20%'
urlAddress = urlAddress.replaceAll("\\+", "%20");
url = new URL(urlAddress);
} catch (MalformedURLException e) {
e.printStackTrace();
}
UUID uuid = UUID.randomUUID();
if (null == fileName) {
fileName = uuid+ "."+type;
}else { // 文件后缀不一致时以type为准(针对simText【将类txt文件转为txt】)
fileName = fileName.replace(fileName.substring(fileName.lastIndexOf(".") + 1), type);
}
String realPath = fileDir + fileName;
File dirFile = new File(fileDir);
if (!dirFile.exists()) {
dirFile.mkdirs();
}
try {
URLConnection connection = url.openConnection();
InputStream in = connection.getInputStream();
FileOutputStream os = new FileOutputStream(realPath);
byte[] buffer = new byte[4 * 1024];
int read;
while ((read = in.read(buffer)) > 0) {
os.write(buffer, 0, read);
}
os.close();
in.close();
response.setContent(realPath);
// 同样针对类txt文件如果成功msg包含的是转换后的文件名
response.setMsg(fileName);
// txt转换文件编码为utf8
if("txt".equals(type)){
convertTextPlainFileCharsetToUtf8(realPath);
}
return response;
} catch (IOException e) {
e.printStackTrace();
response.setCode(1);
response.setContent(null);
if (e instanceof FileNotFoundException) {
response.setMsg("文件不存在!!!");
}else {
response.setMsg(e.getMessage());
}
return response;
}
}
/**
* 注:可能是原来因为前端通过encodeURI来编码的因为通过encodeURI编码+会被转成+号(亦即没有转)
* 而通过encodeURIComponent则会转成%2B这样URLDecoder是可以正确处理的所以也就没有必要在这里替换了
* 转换url参数部分的空格为加号(因为在url编解码的过程中出现+转为空格的情况)
* @param urlAddress
* @return
*/
private String replacePlusMark(String urlAddress) {
if (urlAddress.contains("?")) {
String nonParamStr = urlAddress.substring(0,urlAddress.indexOf("?") + 1);
String paramStr = urlAddress.substring(nonParamStr.length());
return nonParamStr + paramStr.replace(" ", "+");
}
return urlAddress;
}
/**
* 对最有一个路径进行转码
* @param urlAddress
* http://192.168.2.111:8013/demo/Handle中文.zip
* @return
*/
private String encodeUrlParam(String urlAddress) {
String newUrl = "";
try {
String path = "";
String param = "";
if (urlAddress.contains("?")) {
path = urlAddress.substring(0, urlAddress.indexOf("?"));
param = urlAddress.substring(urlAddress.indexOf("?"));
}else {
path = urlAddress;
}
String lastPath = path.substring(path.lastIndexOf("/") + 1);
String leftPath = path.substring(0, path.lastIndexOf("/") + 1);
String encodeLastPath = URLEncoder.encode(lastPath, "UTF-8");
newUrl += leftPath + encodeLastPath;
if (urlAddress.contains("?")) {
newUrl += param;
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return newUrl;
}
/**
* 因为jodConvert2.1不支持ms2013版本的office转换这里偷懒尝试看改一下文件类型让jodConvert2.1去
* 处理ms2013看结果如何如果问题很大的话只能采取其他方式如果没有问题暂时使用该版本来转换
* @param type
* @return
*/
private String dealWithMS2013(String type) {
String newType = null;
switch (type){
case "docx":
newType = "doc";
break;
case "xlsx":
newType = "doc";
break;
case "pptx":
newType = "ppt";
break;
default:
newType = type;
break;
}
return newType;
}
/**
* 转换文本文件编码为utf8
* 探测源文件编码,探测到编码切不为utf8则进行转码
* @param filePath 文件路径
*/
private static void convertTextPlainFileCharsetToUtf8(String filePath) throws IOException {
File sourceFile = new File(filePath);
if(sourceFile.exists() && sourceFile.isFile() && sourceFile.canRead()) {
String encoding = null;
try {
FileCharsetDetector.Observer observer = FileCharsetDetector.guessFileEncoding(sourceFile);
// 为准确探测到编码,不适用猜测的编码
encoding = observer.isFound()?observer.getEncoding():null;
// 为准确探测到编码,可以考虑使用GBK 大部分文件都是windows系统产生的
} catch (IOException e) {
// 编码探测失败,
e.printStackTrace();
}
if(encoding != null && !"UTF-8".equals(encoding)){
// 不为utf8,进行转码
File tmpUtf8File = new File(filePath+".utf8");
Writer writer = new OutputStreamWriter(new FileOutputStream(tmpUtf8File),"UTF-8");
Reader reader = new BufferedReader(new InputStreamReader(new FileInputStream(sourceFile),encoding));
char[] buf = new char[1024];
int read;
while ((read = reader.read(buf)) > 0){
writer.write(buf, 0, read);
}
reader.close();
writer.close();
// 删除源文件
sourceFile.delete();
// 重命名
tmpUtf8File.renameTo(sourceFile);
}
}
}
}

View File

@@ -1,157 +0,0 @@
package cn.keking.utils;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.mozilla.intl.chardet.nsDetector;
import org.mozilla.intl.chardet.nsICharsetDetectionObserver;
/**
* 文本文件编码探测工具类
*
* @author HWliao
* @date 2017-12-24
*/
public class FileCharsetDetector {
/**
* 传入一个文件(File)对象,检查文件编码
*
* @param file File对象实例
* @return 文件编码若无则返回null
* @throws FileNotFoundException
* @throws IOException
*/
public static Observer guessFileEncoding(File file)
throws FileNotFoundException, IOException {
return guessFileEncoding(file, new nsDetector());
}
/**
* <pre>
* 获取文件的编码
* @param file
* File对象实例
* @param languageHint
* 语言提示区域代码 @see #nsPSMDetector ,取值如下:
* 1 : Japanese
* 2 : Chinese
* 3 : Simplified Chinese
* 4 : Traditional Chinese
* 5 : Korean
* 6 : Dont know(default)
* </pre>
*
* @return 文件编码egUTF-8,GBK,GB2312形式(不确定的时候,返回可能的字符编码序列)若无则返回null
* @throws FileNotFoundException
* @throws IOException
*/
public static Observer guessFileEncoding(File file, int languageHint)
throws FileNotFoundException, IOException {
return guessFileEncoding(file, new nsDetector(languageHint));
}
/**
* 获取文件的编码
*
* @param file
* @param det
* @return
* @throws FileNotFoundException
* @throws IOException
*/
private static Observer guessFileEncoding(File file, nsDetector det)
throws FileNotFoundException, IOException {
// new Observer
Observer observer = new Observer();
// set Observer
// The Notify() will be called when a matching charset is found.
det.Init(observer);
BufferedInputStream imp = new BufferedInputStream(new FileInputStream(
file));
byte[] buf = new byte[1024];
int len;
boolean done = false;
boolean isAscii = false;
while ((len = imp.read(buf, 0, buf.length)) != -1) {
// Check if the stream is only ascii.
isAscii = det.isAscii(buf, len);
if (isAscii) {
break;
}
// DoIt if non-ascii and not done yet.
done = det.DoIt(buf, len, false);
if (done) {
break;
}
}
imp.close();
det.DataEnd();
if (isAscii) {
observer.encoding = "ASCII";
observer.found = true;
}
if (!observer.isFound()) {
String[] prob = det.getProbableCharsets();
// // 这里将可能的字符集组合起来返回
// for (int i = 0; i < prob.length; i++) {
// if (i == 0) {
// encoding = prob[i];
// } else {
// encoding += "," + prob[i];
// }
// }
if (prob.length > 0) {
// 在没有发现情况下,去第一个可能的编码
observer.encoding = prob[0];
} else {
observer.encoding = null;
}
}
return observer;
}
/**
* @author liaohongwei
* @Description: 文件字符编码观察者, 但判断出字符编码时候调用
* @date 2016年6月20日 下午2:27:06
*/
public static class Observer implements nsICharsetDetectionObserver {
/**
* @Fields encoding : 字符编码
*/
private String encoding = null;
/**
* @Fields found : 是否找到字符集
*/
private boolean found = false;
@Override
public void Notify(String charset) {
this.encoding = charset;
this.found = true;
}
public String getEncoding() {
return encoding;
}
public boolean isFound() {
return found;
}
@Override
public String toString() {
return "Observer [encoding=" + encoding + ", found=" + found + "]";
}
}
}

View File

@@ -1,282 +0,0 @@
package cn.keking.utils;
import cn.keking.model.FileAttribute;
import cn.keking.model.FileType;
import com.google.common.collect.Lists;
import org.redisson.api.RMapCache;
import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.*;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
*
* @author yudian-it
* @date 2017/11/13
*/
@Component
public class FileUtils {
Logger log= LoggerFactory.getLogger(getClass());
final String REDIS_FILE_PREVIEW_PDF_KEY = "converted-preview-pdf-file";
final String REDIS_FILE_PREVIEW_IMGS_KEY = "converted-preview-imgs-file";//压缩包内图片文件集合
@Autowired
RedissonClient redissonClient;
@Value("${file.dir}")
String fileDir;
@Value("${converted.file.charset}")
String charset;
@Value("${simText}")
String[] simText;
@Value("${media}")
String[] media;
/**
* 已转换过的文件集合(redis缓存)
* @return
*/
public Map<String, String> listConvertedFiles() {
RMapCache<String, String> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_PDF_KEY);
return convertedList;
}
/**
* 已转换过的文件,根据文件名获取
* @return
*/
public String getConvertedFile(String key) {
RMapCache<String, String> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_PDF_KEY);
return convertedList.get(key);
}
/**
* 查看文件类型(防止参数中存在.点号或者其他特殊字符,所以先抽取文件名,然后再获取文件类型)
*
* @param url
* @return
*/
public FileType typeFromUrl(String url) {
String nonPramStr = url.substring(0, url.indexOf("?") != -1 ? url.indexOf("?") : url.length());
String fileName = nonPramStr.substring(nonPramStr.lastIndexOf("/") + 1);
String fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
if (listPictureTypes().contains(fileType.toLowerCase())) {
return FileType.picture;
}
if (listArchiveTypes().contains(fileType.toLowerCase())) {
return FileType.compress;
}
if (listOfficeTypes().contains(fileType.toLowerCase())) {
return FileType.office;
}
if (Arrays.asList(simText).contains(fileType.toLowerCase())) {
return FileType.simText;
}
if (Arrays.asList(media).contains(fileType.toLowerCase())) {
return FileType.media;
}
if("pdf".equalsIgnoreCase(fileType)){
return FileType.pdf;
}
return FileType.other;
}
/**
* 从url中剥离出文件名
* @param url
* 格式如http://keking.ufile.ucloud.com.cn/20171113164107_月度绩效表模板(新).xls?UCloudPublicKey=ucloudtangshd@weifenf.com14355492830001993909323&Expires=&Signature=I D1NOFtAJSPT16E6imv6JWuq0k=
* @return
*/
public String getFileNameFromURL(String url) {
// 因为url的参数中可能会存在/的情况所以直接url.lastIndexOf("/")会有问题
// 所以先从处将url截断然后运用url.lastIndexOf("/")获取文件名
String noQueryUrl = url.substring(0, url.indexOf("?") != -1 ? url.indexOf("?"): url.length());
String fileName = noQueryUrl.substring(noQueryUrl.lastIndexOf("/") + 1);
return fileName;
}
/**
* 获取文件后缀
* @param fileName
* @return
*/
public String getSuffixFromFileName(String fileName) {
String suffix = fileName.substring(fileName.lastIndexOf("."));
return suffix;
}
/**
* 从路径中获取
* @param path
* 类似这种C:\Users\yudian-it\Downloads
* @return
*/
public String getFileNameFromPath(String path) {
return path.substring(path.lastIndexOf(File.separator) + 1);
}
public List<String> listPictureTypes(){
List<String> list = Lists.newArrayList();
list.add("jpg");
list.add("jpeg");
list.add("png");
list.add("gif");
list.add("bmp");
list.add("ico");
list.add("RAW");
return list;
}
public List<String> listArchiveTypes(){
List<String> list = Lists.newArrayList();
list.add("rar");
list.add("zip");
list.add("jar");
list.add("7-zip");
list.add("tar");
list.add("gzip");
list.add("7z");
return list;
}
public List<String> listOfficeTypes() {
List<String> list = Lists.newArrayList();
list.add("docx");
list.add("doc");
list.add("xls");
list.add("xlsx");
list.add("ppt");
list.add("pptx");
return list;
}
/**
* 获取相对路径
* @param absolutePath
* @return
*/
public String getRelativePath(String absolutePath) {
return absolutePath.substring(fileDir.length());
}
public void addConvertedFile(String fileName, String value){
RMapCache<String, String> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_PDF_KEY);
convertedList.fastPut(fileName, value);
}
/**
* 获取redis中压缩包内图片文件
* @param fileKey
* @return
*/
public List getRedisImgUrls(String fileKey){
RMapCache<String, List> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_IMGS_KEY);
return convertedList.get(fileKey);
}
/**
* 设置redis中压缩包内图片文件
* @param fileKey
* @param imgs
*/
public void setRedisImgUrls(String fileKey,List imgs){
RMapCache<String, List> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_IMGS_KEY);
convertedList.fastPut(fileKey,imgs);
}
/**
* 判断文件编码格式
* @param path
* @return
*/
public String getFileEncodeUTFGBK(String path){
String enc = Charset.forName("GBK").name();
File file = new File(path);
InputStream in= null;
try {
in = new FileInputStream(file);
byte[] b = new byte[3];
in.read(b);
in.close();
if (b[0] == -17 && b[1] == -69 && b[2] == -65) {
enc = Charset.forName("UTF-8").name();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("文件编码格式为:" + enc);
return enc;
}
/**
* 对转换后的文件进行操作(改变编码方式)
* @param outFilePath
*/
public void doActionConvertedFile(String outFilePath) {
StringBuffer sb = new StringBuffer();
try (InputStream inputStream = new FileInputStream(outFilePath);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, charset))){
String line;
while(null != (line = reader.readLine())){
if (line.contains("charset=gb2312")) {
line = line.replace("charset=gb2312", "charset=utf-8");
}
sb.append(line);
}
// 添加sheet控制头
sb.append("<script src=\"js/jquery-3.0.0.min.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\"js/excel.header.js\" type=\"text/javascript\"></script>");
sb.append("<link rel=\"stylesheet\" href=\"http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css\">");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// 重新写入文件
try(FileOutputStream fos = new FileOutputStream(outFilePath);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos))){
writer.write(sb.toString());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 获取文件后缀
* @param url
* @return
*/
private String suffixFromUrl(String url) {
String nonPramStr = url.substring(0, url.indexOf("?") != -1 ? url.indexOf("?") : url.length());
String fileName = nonPramStr.substring(nonPramStr.lastIndexOf("/") + 1);
String fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
return fileType;
}
public FileAttribute getFileAttribute(String url) {
String decodedUrl=null;
try {
decodedUrl = URLDecoder.decode(url, "utf-8");
}catch (UnsupportedEncodingException e){
log.debug("url解码失败");
}
// 路径转码
FileType type = typeFromUrl(url);
String suffix = suffixFromUrl(url);
// 抽取文件并返回文件列表
String fileName = getFileNameFromURL(decodedUrl);
return new FileAttribute(type,suffix,fileName,url,decodedUrl);
}
}

View File

@@ -1,112 +0,0 @@
package cn.keking.utils;
import org.artofsolving.jodconverter.OfficeDocumentConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
/**
* @author yudian-it
*/
@Component
public class OfficeToPdf {
/**
* 获取OpenOffice.org 3的安装目录
*
* @return OpenOffice.org 3的安装目录
*/
@Autowired
ConverterUtils converterUtils;
/**
* 使Office2003-2007全部格式的文档(.doc|.docx|.xls|.xlsx|.ppt|.pptx) 转化为pdf文件<br>
*
* @param inputFilePath
* 源文件路径,如:"e:/test.docx"
* @param outputFilePath
* 目标文件路径,如:"e:/test_docx.pdf"
* @return
*/
public boolean openOfficeToPDF(String inputFilePath, String outputFilePath) {
return office2pdf(inputFilePath, outputFilePath);
}
/**
* 转换文件
*
* @param inputFile
* @param outputFilePath_end
* @param inputFilePath
* @param outputFilePath
* @param converter
*/
public static void converterFile(File inputFile, String outputFilePath_end,
String inputFilePath, String outputFilePath,
OfficeDocumentConverter converter) {
File outputFile = new File(outputFilePath_end);
// 假如目标路径不存在,则新建该路径
if (!outputFile.getParentFile().exists()) {
outputFile.getParentFile().mkdirs();
}
converter.convert(inputFile, outputFile);
}
/**
* 使Office2003-2007全部格式的文档(.doc|.docx|.xls|.xlsx|.ppt|.pptx) 转化为pdf文件
*
* @param inputFilePath
* 源文件路径,如:"e:/test.docx"
* @param outputFilePath
* 目标文件路径,如:"e:/test_docx.pdf"
* @return
*/
public boolean office2pdf(String inputFilePath, String outputFilePath) {
boolean flag = false;
OfficeDocumentConverter converter = converterUtils.getDocumentConverter();
if (null != inputFilePath) {
File inputFile = new File(inputFilePath);
// 判断目标文件路径是否为空
if (null == outputFilePath) {
// 转换后的文件路径
String outputFilePath_end = getOutputFilePath(inputFilePath);
if (inputFile.exists()) {// 找不到源文件, 则返回
converterFile(inputFile, outputFilePath_end, inputFilePath,
outputFilePath, converter);
flag = true;
}
} else {
if (inputFile.exists()) {// 找不到源文件, 则返回
converterFile(inputFile, outputFilePath, inputFilePath,
outputFilePath, converter);
flag = true;
}
}
// officeManager.stop();
} else {
flag = false;
}
return flag;
}
/**
* 获取输出文件
*
* @param inputFilePath
* @return
*/
public static String getOutputFilePath(String inputFilePath) {
String outputFilePath = inputFilePath.replaceAll("."
+ getPostfix(inputFilePath), ".pdf");
return outputFilePath;
}
/**
* 获取inputFilePath的后缀名"e:/test.pptx"的后缀名为:"pptx"
*
* @param inputFilePath
* @return
*/
public static String getPostfix(String inputFilePath) {
return inputFilePath.substring(inputFilePath.lastIndexOf(".") + 1);
}
}

View File

@@ -1,16 +0,0 @@
package cn.keking.utils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class ShedulerClean {
@Value("${file.dir}")
String fileDir;
// @Scheduled(cron = "0 0 23 * * ?") //每晚23点执行一次
public void clean(){
System.out.println("执行一次清空文件夹");
DeleteFileUtil.deleteDirectory(fileDir);
}
}

View File

@@ -1,24 +0,0 @@
package cn.keking.utils;
import cn.keking.model.ReturnResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* 读取类文本文件
* @author yudian-it
* @date 2017/12/13
*/
@Component
public class SimTextUtil {
@Value("${file.dir}")
String fileDir;
@Autowired
DownloadUtils downloadUtils;
public ReturnResponse<String> readSimText(String url, String fileName){
ReturnResponse<String> response = downloadUtils.downLoad(url, "txt", fileName);
return response;
}
}

View File

@@ -1,460 +0,0 @@
package cn.keking.utils;
import cn.keking.model.FileType;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.junrar.Archive;
import com.github.junrar.exception.RarException;
import com.github.junrar.rarfile.FileHeader;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import java.io.*;
import java.math.BigDecimal;
import java.text.CollationKey;
import java.text.Collator;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
* @author yudian-it
* @date 2017/11/27
*/
@Component
public class ZipReader {
static Pattern pattern = Pattern.compile("^\\d+");
@Autowired
FileUtils fileUtils;
@Value("${file.dir}")
String fileDir;
ExecutorService executors = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
/**
* 读取压缩文件
* 文件压缩到统一目录fileDir下并且命名使用压缩文件名+文件名因为文件名
* 可能会重复(在系统中对于同一种类型的材料压缩文件内的文件是一样的,如果文件名
* 重复,那么这里会被覆盖[同一个压缩文件中的不同目录中的相同文件名暂时不考虑])
* <b>注:</b>
* <p>
* 文件名命名中的参数的说明:
* 1.archiveName为避免解压的文件中有重名的文件会彼此覆盖所以加上了archiveName因为在ufile中archiveName
* 是不会重复的。
* 2.level这里层级结构的列表我是通过一个map来构造的map的key是文件的名字值是对应的文件这样每次向map中
* 加入节点的时候都会获取父节点是否存在存在则会获取父节点的value并将当前节点加入到父节点的childList中(这里利用
* 的是java语言的引用的特性)。
* </p>
* @param filePath
*/
public String readZipFile(String filePath,String fileKey) {
String archiveSeparator = "/";
Map<String, FileNode> appender = Maps.newHashMap();
List imgUrls=Lists.newArrayList();
String baseUrl= (String) RequestContextHolder.currentRequestAttributes().getAttribute("baseUrl",0);
String archiveFileName = fileUtils.getFileNameFromPath(filePath);
try {
ZipFile zipFile = new ZipFile(filePath, fileUtils.getFileEncodeUTFGBK(filePath));
Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();
// 排序
entries = sortZipEntries(entries);
List<Map<String, ZipArchiveEntry>> entriesToBeExtracted = Lists.newArrayList();
while (entries.hasMoreElements()){
ZipArchiveEntry entry = entries.nextElement();
String fullName = entry.getName();
int level = fullName.split(archiveSeparator).length;
// 展示名
String originName = getLastFileName(fullName, archiveSeparator);
String childName = level + "_" + originName;
boolean directory = entry.isDirectory();
if (!directory) {
childName = archiveFileName + "_" + originName;
entriesToBeExtracted.add(Collections.singletonMap(childName, entry));
}
String parentName = getLast2FileName(fullName, archiveSeparator, archiveFileName);
parentName = (level-1) + "_" + parentName;
FileType type=fileUtils.typeFromUrl(childName);
if (type.equals(FileType.picture)){//添加图片文件到图片列表
imgUrls.add(baseUrl+childName);
}
FileNode node = new FileNode(originName, childName, parentName, new ArrayList<>(), directory,fileKey);
addNodes(appender, parentName, node);
appender.put(childName, node);
}
// 开启新的线程处理文件解压
executors.submit(new ZipExtractorWorker(entriesToBeExtracted, zipFile, filePath));
fileUtils.setRedisImgUrls(fileKey,imgUrls);
return new ObjectMapper().writeValueAsString(appender.get(""));
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* 排序zipEntries(对原来列表倒序)
* @param entries
*/
private Enumeration<ZipArchiveEntry> sortZipEntries(Enumeration<ZipArchiveEntry> entries) {
List<ZipArchiveEntry> sortedEntries = Lists.newArrayList();
while(entries.hasMoreElements()){
sortedEntries.add(entries.nextElement());
}
Collections.sort(sortedEntries, Comparator.comparingInt(o -> o.getName().length()));
return Collections.enumeration(sortedEntries);
}
public String unRar(String filePath,String fileKey){
Map<String, FileNode> appender = Maps.newHashMap();
List imgUrls=Lists.newArrayList();
String baseUrl= (String) RequestContextHolder.currentRequestAttributes().getAttribute("baseUrl",0);
try {
Archive archive = new Archive(new File(filePath));
List<FileHeader> headers = archive.getFileHeaders();
headers = sortedHeaders(headers);
String archiveFileName = fileUtils.getFileNameFromPath(filePath);
List<Map<String, FileHeader>> headersToBeExtracted = Lists.newArrayList();
for (FileHeader header : headers) {
String fullName;
if (header.isUnicode()) {
fullName = header.getFileNameW();
}else {
fullName = header.getFileNameString();
}
// 展示名
String originName = getLastFileName(fullName, "\\");
String childName = originName;
boolean directory = header.isDirectory();
if (!directory) {
childName = archiveFileName + "_" + originName;
headersToBeExtracted.add(Collections.singletonMap(childName, header));
}
String parentName = getLast2FileName(fullName, "\\", archiveFileName);
FileType type=fileUtils.typeFromUrl(childName);
if (type.equals(FileType.picture)){//添加图片文件到图片列表
imgUrls.add(baseUrl+childName);
}
FileNode node = new FileNode(originName, childName, parentName, new ArrayList<>(), directory,fileKey);
addNodes(appender, parentName, node);
appender.put(childName, node);
}
executors.submit(new RarExtractorWorker(headersToBeExtracted, archive, filePath));
fileUtils.setRedisImgUrls(fileKey,imgUrls);
return new ObjectMapper().writeValueAsString(appender.get(""));
} catch (RarException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
private void addNodes(Map<String, FileNode> appender, String parentName, FileNode node) {
if (appender.containsKey(parentName)) {
appender.get(parentName).getChildList().add(node);
Collections.sort(appender.get(parentName).getChildList(), sortComparator);
// appender.get(parentName).getChildList().sort((final FileNode h1, final FileNode h2) -> h1.getOriginName().compareTo(h2.getOriginName()));//排序
}else { // 根节点
FileNode nodeRoot = new FileNode(parentName, parentName, "", new ArrayList<>(), true);
nodeRoot.getChildList().add(node);
appender.put("", nodeRoot);
appender.put(parentName, nodeRoot);
}
}
private List<FileHeader> sortedHeaders(List<FileHeader> headers) {
List<FileHeader> sortedHeaders = new ArrayList<>();
Map<Integer, FileHeader> mapHeaders = new TreeMap<>();
headers.forEach(header -> mapHeaders.put(header.getFileNameW().length(), header));
for (Map.Entry<Integer, FileHeader> entry : mapHeaders.entrySet()){
for (FileHeader header : headers) {
if (entry.getKey().intValue() == header.getFileNameW().length()) {
sortedHeaders.add(header);
}
}
}
return sortedHeaders;
}
/**
* 获取倒数第二个文件(夹)名
* @param fullName
* @param seperator
* 压缩文件解压后不同的压缩格式分隔符不一样zip是/而rar是\
* @param rootName
* 根目录名:如果倒数第二个路径为空那么赋值为rootName
* @return
*/
private static String getLast2FileName(String fullName, String seperator, String rootName) {
if (fullName.endsWith(seperator)) {
fullName = fullName.substring(0, fullName.length()-1);
}
// 1.获取剩余部分
int endIndex = fullName.lastIndexOf(seperator);
String leftPath = fullName.substring(0, endIndex == -1 ? 0 : endIndex);
if (null != leftPath && leftPath.length() > 1) {
// 2.获取倒数第二个
return getLastFileName(leftPath, seperator);
}else {
return rootName;
}
}
/**
* 获取最后一个文件(夹)的名字
* @param fullName
* @param seperator
* 压缩文件解压后不同的压缩格式分隔符不一样zip是/而rar是\
* @return
*/
private static String getLastFileName(String fullName, String seperator) {
if (fullName.endsWith(seperator)) {
fullName = fullName.substring(0, fullName.length()-1);
}
String newName = fullName;
if (null != fullName && fullName.contains(seperator)) {
newName = fullName.substring(fullName.lastIndexOf(seperator) + 1);
}
return newName;
}
public static Comparator<FileNode> sortComparator = new Comparator<FileNode>() {
Collator cmp = Collator.getInstance(Locale.US);
@Override
public int compare(FileNode o1, FileNode o2) {
// 判断两个对比对象是否是开头包含数字,如果包含数字则获取数字并按数字真正大小进行排序
BigDecimal num1,num2;
if (null != (num1 = isStartNumber(o1))
&& null != (num2 = isStartNumber(o2))) {
return num1.subtract(num2).intValue();
}
CollationKey c1 = cmp.getCollationKey(o1.getOriginName());
CollationKey c2 = cmp.getCollationKey(o2.getOriginName());
return cmp.compare(c1.getSourceString(), c2.getSourceString());
}
};
private static BigDecimal isStartNumber(FileNode src) {
Matcher matcher = pattern.matcher(src.getOriginName());
if (matcher.find()) {
return new BigDecimal(matcher.group());
}
return null;
}
/**
* 文件节点(区分文件上下级)
*/
public class FileNode{
private String originName;
private String fileName;
private String parentFileName;
private boolean directory;
private String fileKey;//用于图片预览时寻址
private List<FileNode> childList;
public FileNode() {
}
public FileNode(String originName, String fileName, String parentFileName, List<FileNode> childList, boolean directory) {
this.originName = originName;
this.fileName = fileName;
this.parentFileName = parentFileName;
this.childList = childList;
this.directory = directory;
}
public FileNode(String originName, String fileName, String parentFileName, List<FileNode> childList, boolean directory,String fileKey) {
this.originName = originName;
this.fileName = fileName;
this.parentFileName = parentFileName;
this.childList = childList;
this.directory = directory;
this.fileKey=fileKey;
}
public String getFileKey() {
return fileKey;
}
public void setFileKey(String fileKey) {
this.fileKey = fileKey;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getParentFileName() {
return parentFileName;
}
public void setParentFileName(String parentFileName) {
this.parentFileName = parentFileName;
}
public List<FileNode> getChildList() {
return childList;
}
public void setChildList(List<FileNode> childList) {
this.childList = childList;
}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException e) {
e.printStackTrace();
return "";
}
}
public String getOriginName() {
return originName;
}
public void setOriginName(String originName) {
this.originName = originName;
}
public boolean isDirectory() {
return directory;
}
public void setDirectory(boolean directory) {
this.directory = directory;
}
}
/**
* Zip文件抽取线程
*/
class ZipExtractorWorker implements Runnable {
private List<Map<String, ZipArchiveEntry>> entriesToBeExtracted;
private ZipFile zipFile;
private String filePath;
public ZipExtractorWorker(List<Map<String, ZipArchiveEntry>> entriesToBeExtracted, ZipFile zipFile, String filePath) {
this.entriesToBeExtracted = entriesToBeExtracted;
this.zipFile = zipFile;
this.filePath = filePath;
}
@Override
public void run() {
System.out.println("解析压缩文件开始《《《《《《《《《《《《《《《《《《《《《《《");
for (Map<String, ZipArchiveEntry> entryMap : entriesToBeExtracted) {
String childName = entryMap.keySet().iterator().next();
ZipArchiveEntry entry = entryMap.values().iterator().next();
try {
extractZipFile(childName, zipFile.getInputStream(entry));
} catch (IOException e) {
e.printStackTrace();
}
}
try {
zipFile.close();
} catch (IOException e) {
e.printStackTrace();
}
if (new File(filePath).exists()) {
new File(filePath).delete();
}
System.out.println("解析压缩文件结束《《《《《《《《《《《《《《《《《《《《《《《");
}
/**
* 读取压缩文件并写入到fileDir文件夹下
* @param childName
* @param zipFile
*/
private void extractZipFile(String childName, InputStream zipFile) {
String outPath = fileDir + childName;
try (OutputStream ot = new FileOutputStream(outPath)){
byte[] inByte = new byte[1024];
int len;
while ((-1 != (len = zipFile.read(inByte)))){
ot.write(inByte, 0, len);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* Rar文件抽取
*/
class RarExtractorWorker implements Runnable {
private List<Map<String, FileHeader>> headersToBeExtracted;
private Archive archive;
/**
* 用以删除源文件
*/
private String filePath;
public RarExtractorWorker(List<Map<String, FileHeader>> headersToBeExtracted, Archive archive, String filePath) {
this.headersToBeExtracted = headersToBeExtracted;
this.archive = archive;
this.filePath = filePath;
}
@Override
public void run() {
System.out.println("解析压缩文件开始《《《《《《《《《《《《《《《《《《《《《《《");
for (Map<String, FileHeader> entryMap : headersToBeExtracted) {
String childName = entryMap.keySet().iterator().next();
extractRarFile(childName, entryMap.values().iterator().next(), archive);
}
try {
archive.close();
} catch (IOException e) {
e.printStackTrace();
}
if (new File(filePath).exists()) {
new File(filePath).delete();
}
System.out.println("解析压缩文件结束《《《《《《《《《《《《《《《《《《《《《《《");
}
/**
* 抽取rar文件到指定目录下
* @param childName
* @param header
* @param archive
*/
private void extractRarFile(String childName, FileHeader header, Archive archive) {
String outPath = fileDir + childName;
try(OutputStream ot = new FileOutputStream(outPath)) {
archive.extractFile(header, ot);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (RarException e) {
e.printStackTrace();
}
}
}
}

View File

@@ -1,113 +0,0 @@
package cn.keking.web.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import cn.keking.model.ReturnResponse;
import cn.keking.utils.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
*
* @author yudian-it
* @date 2017/12/1
*/
@RestController
public class FileController {
@Value("${file.dir}")
String fileDir;
@Autowired
FileUtils fileUtils;
String demoDir = "demo";
String demoPath = demoDir + File.separator;
@RequestMapping(value = "fileUpload", method = RequestMethod.POST)
public String fileUpload(@RequestParam("file") MultipartFile file,
HttpServletRequest request) throws JsonProcessingException {
String fileName = file.getOriginalFilename();
// 判断该文件类型是否有上传过,如果上传过则提示不允许再次上传
if (existsTypeFile(fileName)) {
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(1, "每一种类型只可以上传一个文件,请先删除原有文件再次上传", null));
}
File outFile = new File(fileDir + demoPath);
if (!outFile.exists()) {
outFile.mkdirs();
}
try(InputStream in = file.getInputStream();
OutputStream ot = new FileOutputStream(fileDir + demoPath + fileName)){
byte[] buffer = new byte[1024];
int len;
while ((-1 != (len = in.read(buffer)))) {
ot.write(buffer, 0, len);
}
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(0, "SUCCESS", null));
} catch (IOException e) {
e.printStackTrace();
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(1, "FAILURE", null));
}
}
@RequestMapping(value = "deleteFile", method = RequestMethod.GET)
public String deleteFile(String fileName) throws JsonProcessingException {
if (fileName.contains("/")) {
fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
}
File file = new File(fileDir + demoPath + fileName);
if (file.exists()) {
file.delete();
}
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(0, "SUCCESS", null));
}
@RequestMapping(value = "listFiles", method = RequestMethod.GET)
public String getFiles() throws JsonProcessingException {
List<Map<String, String>> list = Lists.newArrayList();
File file = new File(fileDir + demoPath);
if (file.exists()) {
Arrays.stream(file.listFiles()).forEach(file1 -> list.add(ImmutableMap.of("fileName", demoDir + "/" + file1.getName())));
}
return new ObjectMapper().writeValueAsString(list);
}
private String getFileName(String name) {
String suffix = name.substring(name.lastIndexOf("."));
String nameNoSuffix = name.substring(0, name.lastIndexOf("."));
String uuid = UUID.randomUUID().toString();
return uuid + "-" + nameNoSuffix + suffix;
}
/**
* 是否存在该类型的文件
* @return
* @param fileName
*/
private boolean existsTypeFile(String fileName) {
boolean result = false;
String suffix = fileUtils.getSuffixFromFileName(fileName);
File file = new File(fileDir + demoPath);
if (file.exists()) {
for(File file1 : file.listFiles()){
String existsFileSuffix = fileUtils.getSuffixFromFileName(file1.getName());
if (suffix.equals(existsFileSuffix)) {
result = true;
break;
}
}
}
return result;
}
}

View File

@@ -1,134 +0,0 @@
package cn.keking.web.controller;
import cn.keking.service.FileConverQueueTask;
import cn.keking.service.FilePreview;
import cn.keking.service.FilePreviewFactory;
import org.apache.commons.io.IOUtils;
import org.redisson.api.RBlockingQueue;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yudian-it
*/
@Controller
public class OnlinePreviewController {
@Autowired
FilePreviewFactory previewFactory;
@Autowired
RedissonClient redissonClient;
/**
* @param url
* @param model
* @return
*/
@RequestMapping(value = "onlinePreview", method = RequestMethod.GET)
public String onlinePreview(String url, Model model, HttpServletRequest req) {
req.setAttribute("fileKey", req.getParameter("fileKey"));
FilePreview filePreview = previewFactory.get(url);
return filePreview.filePreviewHandle(url, model);
}
/**
* 多图片切换预览
*
* @param model
* @param req
* @return
* @throws UnsupportedEncodingException
*/
@RequestMapping(value = "picturesPreview", method = RequestMethod.GET)
public String picturesPreview(String urls, String currentUrl, Model model, HttpServletRequest req) throws UnsupportedEncodingException {
// 路径转码
String decodedUrl = URLDecoder.decode(urls, "utf-8");
String decodedCurrentUrl = URLDecoder.decode(currentUrl, "utf-8");
// 抽取文件并返回文件列表
String[] imgs = decodedUrl.split("\\|");
List imgurls = Arrays.asList(imgs);
model.addAttribute("imgurls", imgurls);
model.addAttribute("currentUrl",decodedCurrentUrl);
return "picture";
}
@RequestMapping(value = "picturesPreview", method = RequestMethod.POST)
public String picturesPreview(Model model, HttpServletRequest req) throws UnsupportedEncodingException {
String urls = req.getParameter("urls");
String currentUrl = req.getParameter("currentUrl");
// 路径转码
String decodedUrl = URLDecoder.decode(urls, "utf-8");
String decodedCurrentUrl = URLDecoder.decode(currentUrl, "utf-8");
// 抽取文件并返回文件列表
String[] imgs = decodedUrl.split("\\|");
List imgurls = Arrays.asList(imgs);
model.addAttribute("imgurls", imgurls);
model.addAttribute("currentUrl",decodedCurrentUrl);
return "picture";
}
/**
* 根据url获取文件内容
* 当pdfjs读取存在跨域问题的文件时将通过此接口读取
*
* @param urlPath
* @param resp
*/
@RequestMapping(value = "/getCorsFile", method = RequestMethod.GET)
public void getCorsFile(String urlPath, HttpServletResponse resp) {
InputStream inputStream = null;
try {
String strUrl = urlPath.trim();
URL url = new URL(strUrl);
//打开请求连接
URLConnection connection = url.openConnection();
HttpURLConnection httpURLConnection = (HttpURLConnection) connection;
httpURLConnection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
inputStream = httpURLConnection.getInputStream();
byte[] bs = new byte[1024];
int len;
while (-1 != (len = inputStream.read(bs))) {
resp.getOutputStream().write(bs, 0, len);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (inputStream != null) {
IOUtils.closeQuietly(inputStream);
}
}
}
/**
* 通过api接口入队
* @param url 请编码后在入队
*/
@GetMapping("/addTask")
@ResponseBody
public String addQueueTask(String url) {
final RBlockingQueue<String> queue = redissonClient.getBlockingQueue(FileConverQueueTask.queueTaskName);
queue.addAsync(url);
return "success";
}
}

View File

@@ -1 +0,0 @@
app.id=file-preview

View File

@@ -1,15 +0,0 @@
#=============================================#spring Redisson<EFBFBD><EFBFBD><EFBFBD><EFBFBD>#===================================#
spring.redisson.address = 127.0.0.1:6379
##<EFBFBD><EFBFBD>Դӳ<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>Ϊjar<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ԭ<EFBFBD><EFBFBD>)
file.dir = /Users/chenkailing/test/
spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir}
## openoffice<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
office.home = /Applications/LibreOffice.app/Contents
server.tomcat.uri-encoding = UTF-8
converted.file.charset = GBK
#======================================#<EFBFBD>ļ<EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#======================================#
spring.http.multipart.max-file-size=100MB
spring.http.multipart.max-request-size=100MB
## ֧<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
simText = txt,html,xml,java,properties,sql
media=mp3,mp4,flv,rmvb

View File

@@ -1,19 +0,0 @@
#=============================================#spring Redisson<EFBFBD><EFBFBD><EFBFBD><EFBFBD>#===================================#
spring.redisson.address = 10.19.140.7:6379
spring.redisson.database = 0
##<EFBFBD><EFBFBD>Դӳ<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>Ϊjar<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ԭ<EFBFBD><EFBFBD>)
file.dir = /data/file-preview/convertedFile/
spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir}
## openoffice<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
office.home = /opt/openoffice4
## <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
server.tomcat.uri-encoding = utf-8
converted.file.charset = utf-8
## <EFBFBD>ļ<EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
spring.http.multipart.max-file-size = 100MB
## ֧<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
simText = txt,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,log,htm,css,cnf
media=mp3,mp4,flv

View File

@@ -1,15 +0,0 @@
#=============================================#spring Redisson<EFBFBD><EFBFBD><EFBFBD><EFBFBD>#===================================#
spring.redisson.address = 192.168.1.204:6379
spring.redisson.database = 3
##<EFBFBD><EFBFBD>Դӳ<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>Ϊjar<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ԭ<EFBFBD><EFBFBD>)
file.dir = /data/filepreview/
spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir}
## openoffice<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
openOfficePath = 123
office.home = /opt/openoffice4
server.tomcat.uri-encoding = utf-8
converted.file.charset = utf-8
spring.http.multipart.max-file-size = 100MB
## ֧<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
simText = txt,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,log,htm,css,cnf
media=mp3,mp4,flv

View File

@@ -1,15 +0,0 @@
server.port = 8012
spring.http.encoding.charset = utf8
## Freemarker 配置
spring.freemarker.template-loader-path = classpath:/web/
spring.freemarker.cache = false
spring.freemarker.charset = UTF-8
spring.freemarker.check-template-location = true
spring.freemarker.content-type = text/html
spring.freemarker.expose-request-attributes = true
spring.freemarker.expose-session-attributes = true
spring.freemarker.request-context-attribute = request
spring.freemarker.suffix = .ftl
#默认环境
spring.profiles.active=dev

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOG_FILE" value="@logging.path@/app.log"></property>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
<logger name="org.springframework.web" level="info"/>
<appender name="stash" class="net.logstash.logback.appender.LogstashSocketAppender">
<port>10800</port>
<host>192.168.1.109</host>
<includeCallerData>true</includeCallerData>
<customFields>{"app_name":"@appName@"}</customFields>
</appender>
<root level="INFO">
<!--<appender-ref ref="dailyRollingFile"/>
<appender-ref ref="consoleRolling"/>-->
<appender-ref ref="stash"/>
</root>
</configuration>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,620 +0,0 @@
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var FontInspector = (function FontInspectorClosure() {
var fonts;
var active = false;
var fontAttribute = 'data-font-name';
function removeSelection() {
var divs = document.querySelectorAll('div[' + fontAttribute + ']');
for (var i = 0, ii = divs.length; i < ii; ++i) {
var div = divs[i];
div.className = '';
}
}
function resetSelection() {
var divs = document.querySelectorAll('div[' + fontAttribute + ']');
for (var i = 0, ii = divs.length; i < ii; ++i) {
var div = divs[i];
div.className = 'debuggerHideText';
}
}
function selectFont(fontName, show) {
var divs = document.querySelectorAll('div[' + fontAttribute + '=' +
fontName + ']');
for (var i = 0, ii = divs.length; i < ii; ++i) {
var div = divs[i];
div.className = show ? 'debuggerShowText' : 'debuggerHideText';
}
}
function textLayerClick(e) {
if (!e.target.dataset.fontName ||
e.target.tagName.toUpperCase() !== 'DIV') {
return;
}
var fontName = e.target.dataset.fontName;
var selects = document.getElementsByTagName('input');
for (var i = 0; i < selects.length; ++i) {
var select = selects[i];
if (select.dataset.fontName !== fontName) {
continue;
}
select.checked = !select.checked;
selectFont(fontName, select.checked);
select.scrollIntoView();
}
}
return {
// Properties/functions needed by PDFBug.
id: 'FontInspector',
name: 'Font Inspector',
panel: null,
manager: null,
init: function init(pdfjsLib) {
var panel = this.panel;
panel.setAttribute('style', 'padding: 5px;');
var tmp = document.createElement('button');
tmp.addEventListener('click', resetSelection);
tmp.textContent = 'Refresh';
panel.appendChild(tmp);
fonts = document.createElement('div');
panel.appendChild(fonts);
},
cleanup: function cleanup() {
fonts.textContent = '';
},
enabled: false,
get active() {
return active;
},
set active(value) {
active = value;
if (active) {
document.body.addEventListener('click', textLayerClick, true);
resetSelection();
} else {
document.body.removeEventListener('click', textLayerClick, true);
removeSelection();
}
},
// FontInspector specific functions.
fontAdded: function fontAdded(fontObj, url) {
function properties(obj, list) {
var moreInfo = document.createElement('table');
for (var i = 0; i < list.length; i++) {
var tr = document.createElement('tr');
var td1 = document.createElement('td');
td1.textContent = list[i];
tr.appendChild(td1);
var td2 = document.createElement('td');
td2.textContent = obj[list[i]].toString();
tr.appendChild(td2);
moreInfo.appendChild(tr);
}
return moreInfo;
}
var moreInfo = properties(fontObj, ['name', 'type']);
var fontName = fontObj.loadedName;
var font = document.createElement('div');
var name = document.createElement('span');
name.textContent = fontName;
var download = document.createElement('a');
if (url) {
url = /url\(['"]?([^\)"']+)/.exec(url);
download.href = url[1];
} else if (fontObj.data) {
url = URL.createObjectURL(new Blob([fontObj.data], {
type: fontObj.mimeType,
}));
download.href = url;
}
download.textContent = 'Download';
var logIt = document.createElement('a');
logIt.href = '';
logIt.textContent = 'Log';
logIt.addEventListener('click', function(event) {
event.preventDefault();
console.log(fontObj);
});
var select = document.createElement('input');
select.setAttribute('type', 'checkbox');
select.dataset.fontName = fontName;
select.addEventListener('click', (function(select, fontName) {
return (function() {
selectFont(fontName, select.checked);
});
})(select, fontName));
font.appendChild(select);
font.appendChild(name);
font.appendChild(document.createTextNode(' '));
font.appendChild(download);
font.appendChild(document.createTextNode(' '));
font.appendChild(logIt);
font.appendChild(moreInfo);
fonts.appendChild(font);
// Somewhat of a hack, should probably add a hook for when the text layer
// is done rendering.
setTimeout(() => {
if (this.active) {
resetSelection();
}
}, 2000);
},
};
})();
var opMap;
// Manages all the page steppers.
var StepperManager = (function StepperManagerClosure() {
var steppers = [];
var stepperDiv = null;
var stepperControls = null;
var stepperChooser = null;
var breakPoints = Object.create(null);
return {
// Properties/functions needed by PDFBug.
id: 'Stepper',
name: 'Stepper',
panel: null,
manager: null,
init: function init(pdfjsLib) {
var self = this;
this.panel.setAttribute('style', 'padding: 5px;');
stepperControls = document.createElement('div');
stepperChooser = document.createElement('select');
stepperChooser.addEventListener('change', function(event) {
self.selectStepper(this.value);
});
stepperControls.appendChild(stepperChooser);
stepperDiv = document.createElement('div');
this.panel.appendChild(stepperControls);
this.panel.appendChild(stepperDiv);
if (sessionStorage.getItem('pdfjsBreakPoints')) {
breakPoints = JSON.parse(sessionStorage.getItem('pdfjsBreakPoints'));
}
opMap = Object.create(null);
for (var key in pdfjsLib.OPS) {
opMap[pdfjsLib.OPS[key]] = key;
}
},
cleanup: function cleanup() {
stepperChooser.textContent = '';
stepperDiv.textContent = '';
steppers = [];
},
enabled: false,
active: false,
// Stepper specific functions.
create: function create(pageIndex) {
var debug = document.createElement('div');
debug.id = 'stepper' + pageIndex;
debug.setAttribute('hidden', true);
debug.className = 'stepper';
stepperDiv.appendChild(debug);
var b = document.createElement('option');
b.textContent = 'Page ' + (pageIndex + 1);
b.value = pageIndex;
stepperChooser.appendChild(b);
var initBreakPoints = breakPoints[pageIndex] || [];
var stepper = new Stepper(debug, pageIndex, initBreakPoints);
steppers.push(stepper);
if (steppers.length === 1) {
this.selectStepper(pageIndex, false);
}
return stepper;
},
selectStepper: function selectStepper(pageIndex, selectPanel) {
var i;
pageIndex = pageIndex | 0;
if (selectPanel) {
this.manager.selectPanel(this);
}
for (i = 0; i < steppers.length; ++i) {
var stepper = steppers[i];
if (stepper.pageIndex === pageIndex) {
stepper.panel.removeAttribute('hidden');
} else {
stepper.panel.setAttribute('hidden', true);
}
}
var options = stepperChooser.options;
for (i = 0; i < options.length; ++i) {
var option = options[i];
option.selected = (option.value | 0) === pageIndex;
}
},
saveBreakPoints: function saveBreakPoints(pageIndex, bps) {
breakPoints[pageIndex] = bps;
sessionStorage.setItem('pdfjsBreakPoints', JSON.stringify(breakPoints));
},
};
})();
// The stepper for each page's IRQueue.
var Stepper = (function StepperClosure() {
// Shorter way to create element and optionally set textContent.
function c(tag, textContent) {
var d = document.createElement(tag);
if (textContent) {
d.textContent = textContent;
}
return d;
}
function simplifyArgs(args) {
if (typeof args === 'string') {
var MAX_STRING_LENGTH = 75;
return args.length <= MAX_STRING_LENGTH ? args :
args.substr(0, MAX_STRING_LENGTH) + '...';
}
if (typeof args !== 'object' || args === null) {
return args;
}
if ('length' in args) { // array
var simpleArgs = [], i, ii;
var MAX_ITEMS = 10;
for (i = 0, ii = Math.min(MAX_ITEMS, args.length); i < ii; i++) {
simpleArgs.push(simplifyArgs(args[i]));
}
if (i < args.length) {
simpleArgs.push('...');
}
return simpleArgs;
}
var simpleObj = {};
for (var key in args) {
simpleObj[key] = simplifyArgs(args[key]);
}
return simpleObj;
}
function Stepper(panel, pageIndex, initialBreakPoints) {
this.panel = panel;
this.breakPoint = 0;
this.nextBreakPoint = null;
this.pageIndex = pageIndex;
this.breakPoints = initialBreakPoints;
this.currentIdx = -1;
this.operatorListIdx = 0;
}
Stepper.prototype = {
init: function init(operatorList) {
var panel = this.panel;
var content = c('div', 'c=continue, s=step');
var table = c('table');
content.appendChild(table);
table.cellSpacing = 0;
var headerRow = c('tr');
table.appendChild(headerRow);
headerRow.appendChild(c('th', 'Break'));
headerRow.appendChild(c('th', 'Idx'));
headerRow.appendChild(c('th', 'fn'));
headerRow.appendChild(c('th', 'args'));
panel.appendChild(content);
this.table = table;
this.updateOperatorList(operatorList);
},
updateOperatorList: function updateOperatorList(operatorList) {
var self = this;
function cboxOnClick() {
var x = +this.dataset.idx;
if (this.checked) {
self.breakPoints.push(x);
} else {
self.breakPoints.splice(self.breakPoints.indexOf(x), 1);
}
StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints);
}
var MAX_OPERATORS_COUNT = 15000;
if (this.operatorListIdx > MAX_OPERATORS_COUNT) {
return;
}
var chunk = document.createDocumentFragment();
var operatorsToDisplay = Math.min(MAX_OPERATORS_COUNT,
operatorList.fnArray.length);
for (var i = this.operatorListIdx; i < operatorsToDisplay; i++) {
var line = c('tr');
line.className = 'line';
line.dataset.idx = i;
chunk.appendChild(line);
var checked = this.breakPoints.indexOf(i) !== -1;
var args = operatorList.argsArray[i] || [];
var breakCell = c('td');
var cbox = c('input');
cbox.type = 'checkbox';
cbox.className = 'points';
cbox.checked = checked;
cbox.dataset.idx = i;
cbox.onclick = cboxOnClick;
breakCell.appendChild(cbox);
line.appendChild(breakCell);
line.appendChild(c('td', i.toString()));
var fn = opMap[operatorList.fnArray[i]];
var decArgs = args;
if (fn === 'showText') {
var glyphs = args[0];
var newArgs = [];
var str = [];
for (var j = 0; j < glyphs.length; j++) {
var glyph = glyphs[j];
if (typeof glyph === 'object' && glyph !== null) {
str.push(glyph.fontChar);
} else {
if (str.length > 0) {
newArgs.push(str.join(''));
str = [];
}
newArgs.push(glyph); // null or number
}
}
if (str.length > 0) {
newArgs.push(str.join(''));
}
decArgs = [newArgs];
}
line.appendChild(c('td', fn));
line.appendChild(c('td', JSON.stringify(simplifyArgs(decArgs))));
}
if (operatorsToDisplay < operatorList.fnArray.length) {
line = c('tr');
var lastCell = c('td', '...');
lastCell.colspan = 4;
chunk.appendChild(lastCell);
}
this.operatorListIdx = operatorList.fnArray.length;
this.table.appendChild(chunk);
},
getNextBreakPoint: function getNextBreakPoint() {
this.breakPoints.sort(function(a, b) {
return a - b;
});
for (var i = 0; i < this.breakPoints.length; i++) {
if (this.breakPoints[i] > this.currentIdx) {
return this.breakPoints[i];
}
}
return null;
},
breakIt: function breakIt(idx, callback) {
StepperManager.selectStepper(this.pageIndex, true);
var self = this;
var dom = document;
self.currentIdx = idx;
var listener = function(e) {
switch (e.keyCode) {
case 83: // step
dom.removeEventListener('keydown', listener);
self.nextBreakPoint = self.currentIdx + 1;
self.goTo(-1);
callback();
break;
case 67: // continue
dom.removeEventListener('keydown', listener);
var breakPoint = self.getNextBreakPoint();
self.nextBreakPoint = breakPoint;
self.goTo(-1);
callback();
break;
}
};
dom.addEventListener('keydown', listener);
self.goTo(idx);
},
goTo: function goTo(idx) {
var allRows = this.panel.getElementsByClassName('line');
for (var x = 0, xx = allRows.length; x < xx; ++x) {
var row = allRows[x];
if ((row.dataset.idx | 0) === idx) {
row.style.backgroundColor = 'rgb(251,250,207)';
row.scrollIntoView();
} else {
row.style.backgroundColor = null;
}
}
},
};
return Stepper;
})();
var Stats = (function Stats() {
var stats = [];
function clear(node) {
while (node.hasChildNodes()) {
node.removeChild(node.lastChild);
}
}
function getStatIndex(pageNumber) {
for (var i = 0, ii = stats.length; i < ii; ++i) {
if (stats[i].pageNumber === pageNumber) {
return i;
}
}
return false;
}
return {
// Properties/functions needed by PDFBug.
id: 'Stats',
name: 'Stats',
panel: null,
manager: null,
init(pdfjsLib) {
this.panel.setAttribute('style', 'padding: 5px;');
pdfjsLib.PDFJS.enableStats = true;
},
enabled: false,
active: false,
// Stats specific functions.
add(pageNumber, stat) {
if (!stat) {
return;
}
var statsIndex = getStatIndex(pageNumber);
if (statsIndex !== false) {
var b = stats[statsIndex];
this.panel.removeChild(b.div);
stats.splice(statsIndex, 1);
}
var wrapper = document.createElement('div');
wrapper.className = 'stats';
var title = document.createElement('div');
title.className = 'title';
title.textContent = 'Page: ' + pageNumber;
var statsDiv = document.createElement('div');
statsDiv.textContent = stat.toString();
wrapper.appendChild(title);
wrapper.appendChild(statsDiv);
stats.push({ pageNumber, div: wrapper, });
stats.sort(function(a, b) {
return a.pageNumber - b.pageNumber;
});
clear(this.panel);
for (var i = 0, ii = stats.length; i < ii; ++i) {
this.panel.appendChild(stats[i].div);
}
},
cleanup() {
stats = [];
clear(this.panel);
},
};
})();
// Manages all the debugging tools.
window.PDFBug = (function PDFBugClosure() {
var panelWidth = 300;
var buttons = [];
var activePanel = null;
return {
tools: [
FontInspector,
StepperManager,
Stats
],
enable(ids) {
var all = false, tools = this.tools;
if (ids.length === 1 && ids[0] === 'all') {
all = true;
}
for (var i = 0; i < tools.length; ++i) {
var tool = tools[i];
if (all || ids.indexOf(tool.id) !== -1) {
tool.enabled = true;
}
}
if (!all) {
// Sort the tools by the order they are enabled.
tools.sort(function(a, b) {
var indexA = ids.indexOf(a.id);
indexA = indexA < 0 ? tools.length : indexA;
var indexB = ids.indexOf(b.id);
indexB = indexB < 0 ? tools.length : indexB;
return indexA - indexB;
});
}
},
init(pdfjsLib, container) {
/*
* Basic Layout:
* PDFBug
* Controls
* Panels
* Panel
* Panel
* ...
*/
var ui = document.createElement('div');
ui.id = 'PDFBug';
var controls = document.createElement('div');
controls.setAttribute('class', 'controls');
ui.appendChild(controls);
var panels = document.createElement('div');
panels.setAttribute('class', 'panels');
ui.appendChild(panels);
container.appendChild(ui);
container.style.right = panelWidth + 'px';
// Initialize all the debugging tools.
var tools = this.tools;
var self = this;
for (var i = 0; i < tools.length; ++i) {
var tool = tools[i];
var panel = document.createElement('div');
var panelButton = document.createElement('button');
panelButton.textContent = tool.name;
panelButton.addEventListener('click', (function(selected) {
return function(event) {
event.preventDefault();
self.selectPanel(selected);
};
})(i));
controls.appendChild(panelButton);
panels.appendChild(panel);
tool.panel = panel;
tool.manager = this;
if (tool.enabled) {
tool.init(pdfjsLib);
} else {
panel.textContent = tool.name + ' is disabled. To enable add ' +
' "' + tool.id + '" to the pdfBug parameter ' +
'and refresh (separate multiple by commas).';
}
buttons.push(panelButton);
}
this.selectPanel(0);
},
cleanup() {
for (var i = 0, ii = this.tools.length; i < ii; i++) {
if (this.tools[i].enabled) {
this.tools[i].cleanup();
}
}
},
selectPanel(index) {
if (typeof index !== 'number') {
index = this.tools.indexOf(index);
}
if (index === activePanel) {
return;
}
activePanel = index;
var tools = this.tools;
for (var j = 0; j < tools.length; ++j) {
if (j === index) {
buttons[j].setAttribute('class', 'active');
tools[j].active = true;
tools[j].panel.removeAttribute('hidden');
} else {
buttons[j].setAttribute('class', '');
tools[j].active = false;
tools[j].panel.setAttribute('hidden', 'true');
}
}
},
};
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Some files were not shown because too many files have changed in this diff Show More