# spring-boot-file-server **Repository Path**: lingyangcj/spring-boot-file-server ## Basic Information - **Project Name**: spring-boot-file-server - **Description**: 基于Spring Boot文件服务器,war包部署方式,文件可以直接访问。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://www.cnblogs.com/luckyang/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-14 - **Last Updated**: 2022-06-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # spring-boot-file-server #### 介绍 单体文件服务器,war包部署 #### 软件架构 软件架构说明 Spring Boot #### 使用说明 **系统环境:** **windows10 专业版 x64,apache-tomcat-9.0.41-windows-x64** 1.环境准备 > jave-1.0.2.jar安装到本地,maven官方库无此jar包 > > **-Dfile= 后面填写jave的全路径地址** > > maven指令: > > `mvn install:install-file -Dfile=C:\Users\lingyang\Desktop\jave-1.0.2.jar -DgroupId=it.sauronsoftware -DartifactId=jave -Dversion=1.0.2 -Dpackaging=jar` 2.注意事项 > 1.com.lycj.file.common.filter.MyInterceptor的preHandle方法 > > ​ 需要根据自己业务的用户登录的校验逻辑修改,自测时可以考虑注释掉,直接return true; > > 2.com.lycj.file.common.filter.WebConfig的addInterceptors方法 > > ​ 添加或排除请求接口 3.部署服务 3.1下载好tomcat 下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.41/bin/apache-tomcat-9.0.41-windows-x64.zip 3.2将sql导入数据库 3.3修改application-dev的file-server下的配置,linux系统参考application-pro的配置 3.2打包项目得到 `D:\my_work_place\spring-boot-file-server\target\fileServer.war`(具体路径以你自己本地为准) 3.3将fileServer.war放入 `D:\JavaService\apache-tomcat-9.0.41\webapps` 下(具体路径以你自己本地为准) 3.4修改tomcat的端口为你自己需要的端口,我的是8086`D:\JavaService\apache-tomcat-9.0.41\conf\server.xml`(具体路径以你自己本地为准) 3.5`D:\JavaService\apache-tomcat-9.0.41\bin\startup.bat` windows下执行该文件,linux系统则不同。 3.6文件上传接口http://127.0.0.1:8086/fileServer/files/upload 4.可能出现的问题 4.1windows控制台乱码,因为中文系统默认编码格式为GBK,修改为UTF8。 #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)