文件存储服务下载和删除
This commit is contained in:
parent
2fc7032a79
commit
3b59974bd5
|
|
@ -1,8 +0,0 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="bonus-common-log" />
|
||||
<module name="bonus-common-datascope" />
|
||||
<module name="bonus-common-sensitive" />
|
||||
<module name="bonus-common-security" />
|
||||
<module name="bonus-gateway" />
|
||||
<module name="bonus-common-seata" />
|
||||
<module name="bonus-modules-job" />
|
||||
<module name="bonus-common-core" />
|
||||
<module name="bonus-modules-file" />
|
||||
<module name="bonus-api-system" />
|
||||
<module name="bonus-common-redis" />
|
||||
<module name="bonus-common-datasource" />
|
||||
<module name="bonus-common-swagger" />
|
||||
<module name="bonus-visual-monitor" />
|
||||
<module name="bonus-modules-system" />
|
||||
<module name="bonus-auth" />
|
||||
<module name="bonus-modules-gen" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/bonus-api/bonus-api-system/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-api/bonus-api-system/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-api/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-auth/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-auth/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-core/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-core/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-datascope/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-datascope/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-datasource/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-datasource/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-log/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-log/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-redis/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-redis/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-seata/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-seata/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-security/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-security/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-sensitive/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-sensitive/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-swagger/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/bonus-common-swagger/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-common/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-gateway/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-gateway/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-file/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-file/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-gen/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-gen/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-job/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-job/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-system/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/bonus-system/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-modules/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-visual/bonus-monitor/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-visual/bonus-monitor/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-visual/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/bonus-visual/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="public" />
|
||||
<option name="name" value="aliyun nexus" />
|
||||
<option name="url" value="http://192.168.0.56:8081/repository/maven-public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://192.168.0.56:8081/repository/maven-public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AnalysisProjectProfileManager">
|
||||
<option name="PROJECT_PROFILE" />
|
||||
<option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
|
||||
<list size="0" />
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
<component name="SuppressionsComponent">
|
||||
<option name="suppComments" value="[]" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
† java:S112^"FDefine and throw a dedicated exception instead of using a generic one.(ƒ˜øÊùÿÿÿÿJ$a11442a9-8d63-4e07-b71d-8bbd99f23d2c
|
||||
š
|
||||
java:S2293W"YReplace the type specification in this constructor call with the diamond operator ("<>").(±çÞöüÿÿÿÿJ$416ded59-af84-4426-9b48-f83bd19950e0
|
||||
š
|
||||
java:S2293`"YReplace the type specification in this constructor call with the diamond operator ("<>").(±çÞöüÿÿÿÿJ$27d903c5-8337-45a5-9487-c9b6382b00de
|
||||
š
|
||||
java:S2293j"YReplace the type specification in this constructor call with the diamond operator ("<>").(±çÞöüÿÿÿÿJ$a16dd6cf-1b96-4717-87b7-c9f068b6fb5a
|
||||
ƒ
|
||||
java:S1192§"FDefine a constant instead of duplicating this literal "roles" 3 times.(ŒˆçæJ$c6896070-0294-4abc-a161-3e23920dbf5e
|
||||
<EFBFBD>
|
||||
java:S1192Î"NDefine a constant instead of duplicating this literal "新增用户'" 3 times.(Óšå§øÿÿÿÿJ$1d0d7412-1caf-4ba7-bedd-7f6977aef86f
|
||||
<EFBFBD>
|
||||
java:S1192ë"NDefine a constant instead of duplicating this literal "修改用户'" 3 times.(—º¤êüÿÿÿÿJ$955f325a-7983-4ba4-b019-c635db935788
|
||||
~
|
||||
java:S68133"BRemove this field injection and use constructor injection instead.(êæÄÞJ$18d02424-12fa-4fe9-9589-301064ff6621
|
||||
~
|
||||
java:S68136"BRemove this field injection and use constructor injection instead.(êæÄÞJ$af97443c-b483-4714-a15e-8ff638d25d48
|
||||
~
|
||||
java:S68139"BRemove this field injection and use constructor injection instead.(êæÄÞJ$304f05f5-990c-4db1-8ffc-9457d2e774de
|
||||
~
|
||||
java:S6813<"BRemove this field injection and use constructor injection instead.(êæÄÞJ$8bfcda33-286c-4fb5-8121-10afaac59e76
|
||||
~
|
||||
java:S6813?"BRemove this field injection and use constructor injection instead.(êæÄÞJ$cf9bc31d-c0ec-4699-8cad-87063e8cb226
|
||||
~
|
||||
java:S6813B"BRemove this field injection and use constructor injection instead.(êæÄÞJ$f777a01b-edea-458c-bbb2-52a029ebf061
|
||||
§
|
||||
java:S1130h"lRemove the declaration of thrown exception 'java.io.IOException', as it cannot be thrown from method's body.(ýâÍ[J$5b9bbe61-57c5-4b05-ba1e-73a0abd75888
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
–
|
||||
java:S2293“"YReplace the type specification in this constructor call with the diamond operator ("<>").(«ÇáØJ$e1a9f8da-eff9-4bdf-b97a-a600f6c356f7
|
||||
–
|
||||
java:S2293ª"YReplace the type specification in this constructor call with the diamond operator ("<>").(íž¡®J$e3523b3c-5ad8-499f-8ff7-bf9ed82d7f1a
|
||||
ƒ
|
||||
java:S1192ÿ"FDefine a constant instead of duplicating this literal "<br/>" 4 times.(Þî©ÀJ$1ba3156b-b3a6-486b-9d57-6a7aa8850a41
|
||||
j
|
||||
java:S5411<18>"(Use a primitive boolean expression here.(Чé¦ùÿÿÿÿJ$26408d15-1f4c-4cd2-a4f5-58b1b3e5fde6
|
||||
~
|
||||
java:S6813,"BRemove this field injection and use constructor injection instead.(êæÄÞJ$a84cd146-4f87-4427-9d47-5069d78e2801
|
||||
~
|
||||
java:S6813/"BRemove this field injection and use constructor injection instead.(êæÄÞJ$13bb241c-6bc4-4d7f-aac3-5d608cf5aeb1
|
||||
~
|
||||
java:S68132"BRemove this field injection and use constructor injection instead.(êæÄÞJ$761aa5b4-f63b-437e-9f34-f77b55b48e13
|
||||
~
|
||||
java:S68135"BRemove this field injection and use constructor injection instead.(êæÄÞJ$e6b2d573-8b11-428f-b5de-e38833a19041
|
||||
~
|
||||
java:S68138"BRemove this field injection and use constructor injection instead.(êæÄÞJ$5fd175a1-26cb-4a75-a852-810b655c3dbe
|
||||
~
|
||||
java:S6813;"BRemove this field injection and use constructor injection instead.(êæÄÞJ$cca9b812-26b4-43d0-b202-b70d706bcbc0
|
||||
~
|
||||
java:S6813>"BRemove this field injection and use constructor injection instead.(êæÄÞJ$6a2f9c20-2af1-486f-b54d-ce8296e21114
|
||||
~
|
||||
java:S6813A"BRemove this field injection and use constructor injection instead.(êæÄÞJ$5e5b493c-b4b9-4dbc-9e53-9db8ac63a56c
|
||||
‡
|
||||
java:S3252<18>"JUse static access with "org.apache.commons.lang3.StringUtils" for "EMPTY".(„›ÎÕJ$0ae963e1-2cb5-4ae5-ae2b-44bc612a7c59
|
||||
‡
|
||||
java:S3252 "JUse static access with "org.apache.commons.lang3.StringUtils" for "EMPTY".(„›ÎÕJ$6279aaf7-7b1f-46d0-bb4c-34c82cf9a516
|
||||
{
|
||||
java:S1155è">Use isEmpty() to check whether the collection is empty or not.(¥Â<C2A5>©J$084360c0-7ef2-403b-a292-12b957d31f5b
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
…
|
||||
java:S6813"BRemove this field injection and use constructor injection instead.(êæÄÞ8»Î”ª€2J$403f21c8-b418-475a-a8c0-81c2dc7a02d9
|
||||
†
|
||||
java:S1128"CRemove this unused import 'com.bonus.file.utils.FileDownloadUtils'.(<28>êÞ¤8ÅΔª€2J$f034c7f8-3d6e-4ecd-9b95-cd848a3a7999
|
||||
™
|
||||
java:S1128
|
||||
"QRemove this unused import 'org.springframework.web.bind.annotation.RequestParam'.(¬À·ùÿÿÿÿ8ÅΔª€2J$66d84852-c1a6-42a3-8a30-06506bcb8d2c
|
||||
x
|
||||
java:S1128"0Remove this unused import 'java.io.IOException'.(ªº»Úýÿÿÿÿ8ÅΔª€2J$372f4653-0162-4233-9cf3-fc20ef558e82
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
† java:S112"FDefine and throw a dedicated exception instead of using a generic one.( <>ܶøÿÿÿÿJ$9b182cea-bc39-42f7-909d-809033563b29
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
<EFBFBD>
|
||||
Wbonus-modules/bonus-file/src/main/java/com/bonus/file/controller/SysFileController.java,d/5/d56c65f042936ed45626ea96a8a3be8a1f991518
|
||||
7
|
||||
pom.xml,4/4/442292b8a7efeabbe4cc176709b833b1792140ec
|
||||
<EFBFBD>
|
||||
Qbonus-modules/bonus-file/src/main/java/com/bonus/file/config/ResourcesConfig.java,7/c/7ce726513da4afdbc3421b816e8def845a39a0bb
|
||||
A
|
||||
bonus-api/pom.xml,4/d/4d66766070d502e9495acbf654cd20829c4425b3
|
||||
<EFBFBD>
|
||||
^bonus-modules/bonus-system/src/main/java/com/bonus/system/service/impl/SysUserServiceImpl.java,a/a/aa608ec83cbef0157ad034a45ce178fe8d3e1f1d
|
||||
<EFBFBD>
|
||||
Vbonus-modules/bonus-system/src/main/java/com/bonus/system/service/ISysUserService.java,e/9/e9e9c8aa0ae1931dc6e028fc6aa2a4445d3ba19e
|
||||
}
|
||||
Mbonus-modules/bonus-file/src/main/java/com/bonus/file/config/MinioConfig.java,5/0/5004442f77e22ef4c1d07b99806239bb7fb7ffbd
|
||||
|
||||
Obonus-modules/bonus-file/src/main/java/com/bonus/file/BonusFileApplication.java,1/f/1fd70d40f7c9cb50a47ee5948b3fd37458651d5f
|
||||
R
|
||||
"bonus-visual/bonus-monitor/pom.xml,a/5/a567507002bfc4cb69f800244bcc422fbcc10e5d
|
||||
<EFBFBD>
|
||||
[bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysUserController.java,5/f/5f3e07e732703a75dec38fdc223ff19f81693be2
|
||||
<EFBFBD>
|
||||
Rbonus-modules/bonus-file/src/main/java/com/bonus/file/utils/FileDownloadUtils.java,9/7/9722eda79f36a8f93bcf90763a02040c63aa2fde
|
||||
<EFBFBD>
|
||||
Tbonus-api/bonus-api-system/src/main/java/com/bonus/system/api/RemoteFileService.java,8/4/840a68431ce1f8c33ff92941ebcdc18c832f00e4
|
||||
~
|
||||
Nbonus-gateway/src/main/java/com/bonus/gateway/service/ValidateCodeService.java,d/6/d6fecdfdef18b3d6832231c6f1b018c886d4fab8
|
||||
z
|
||||
Jbonus-gateway/src/main/java/com/bonus/gateway/BonusGatewayApplication.java,2/c/2cc24e5aa9771bcc9b5a17544600b0e244d9c2ad
|
||||
q
|
||||
Abonus-auth/src/main/java/com/bonus/auth/BonusAuthApplication.java,9/1/911ccbfd7be6b58e893061cdfb63c958e37d6eda
|
||||
D
|
||||
sql/bns_20240604.sql,8/5/85b1974774f16ce7959a122e4766c9a31a7a7895
|
||||
<EFBFBD>
|
||||
\bonus-modules/bonus-file/src/main/java/com/bonus/file/service/FastDfsSysFileServiceImpl.java,c/6/c6d854777bca75255487810d12805069bf1a4f45
|
||||
P
|
||||
bonus-modules/bonus-file/pom.xml,0/f/0fbb26476b87bedf6f864aa5d52284b75bde6869
|
||||
<EFBFBD>
|
||||
Ubonus-modules/bonus-system/src/main/java/com/bonus/system/BonusSystemApplication.java,a/7/a7445a685a0b55cc0d903c370a10674cfbd15608
|
||||
E
|
||||
bonus-modules/pom.xml,7/3/73fe31f1bc837e4395fd9296f4f1793cc44fbd07
|
||||
<EFBFBD>
|
||||
Pbonus-modules/bonus-file/src/main/java/com/bonus/file/utils/FileUploadUtils.java,c/9/c9d1df9f46abbc0b2e5a3d147c7b3407ef09b84e
|
||||
<EFBFBD>
|
||||
Rbonus-modules/bonus-file/src/main/java/com/bonus/file/service/ISysFileService.java,6/7/6796766c5f6d21c9e346f89b25160c0dd6401a5b
|
||||
<EFBFBD>
|
||||
Zbonus-modules/bonus-file/src/main/java/com/bonus/file/service/MinioSysFileServiceImpl.java,8/7/8721859fd7a6cfb3d43a453ba3850048c6eeb2d2
|
||||
<EFBFBD>
|
||||
Zbonus-modules/bonus-file/src/main/java/com/bonus/file/service/LocalSysFileServiceImpl.java,2/e/2ef247d050a0881cb49e4a582bc1a311f9bc6be0
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
<EFBFBD>
|
||||
Wbonus-modules/bonus-file/src/main/java/com/bonus/file/controller/SysFileController.java,d/5/d56c65f042936ed45626ea96a8a3be8a1f991518
|
||||
7
|
||||
pom.xml,4/4/442292b8a7efeabbe4cc176709b833b1792140ec
|
||||
<EFBFBD>
|
||||
Qbonus-modules/bonus-file/src/main/java/com/bonus/file/config/ResourcesConfig.java,7/c/7ce726513da4afdbc3421b816e8def845a39a0bb
|
||||
A
|
||||
bonus-api/pom.xml,4/d/4d66766070d502e9495acbf654cd20829c4425b3
|
||||
<EFBFBD>
|
||||
^bonus-modules/bonus-system/src/main/java/com/bonus/system/service/impl/SysUserServiceImpl.java,a/a/aa608ec83cbef0157ad034a45ce178fe8d3e1f1d
|
||||
<EFBFBD>
|
||||
Vbonus-modules/bonus-system/src/main/java/com/bonus/system/service/ISysUserService.java,e/9/e9e9c8aa0ae1931dc6e028fc6aa2a4445d3ba19e
|
||||
}
|
||||
Mbonus-modules/bonus-file/src/main/java/com/bonus/file/config/MinioConfig.java,5/0/5004442f77e22ef4c1d07b99806239bb7fb7ffbd
|
||||
|
||||
Obonus-modules/bonus-file/src/main/java/com/bonus/file/BonusFileApplication.java,1/f/1fd70d40f7c9cb50a47ee5948b3fd37458651d5f
|
||||
R
|
||||
"bonus-visual/bonus-monitor/pom.xml,a/5/a567507002bfc4cb69f800244bcc422fbcc10e5d
|
||||
<EFBFBD>
|
||||
[bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysUserController.java,5/f/5f3e07e732703a75dec38fdc223ff19f81693be2
|
||||
<EFBFBD>
|
||||
Rbonus-modules/bonus-file/src/main/java/com/bonus/file/utils/FileDownloadUtils.java,9/7/9722eda79f36a8f93bcf90763a02040c63aa2fde
|
||||
<EFBFBD>
|
||||
Tbonus-api/bonus-api-system/src/main/java/com/bonus/system/api/RemoteFileService.java,8/4/840a68431ce1f8c33ff92941ebcdc18c832f00e4
|
||||
~
|
||||
Nbonus-gateway/src/main/java/com/bonus/gateway/service/ValidateCodeService.java,d/6/d6fecdfdef18b3d6832231c6f1b018c886d4fab8
|
||||
z
|
||||
Jbonus-gateway/src/main/java/com/bonus/gateway/BonusGatewayApplication.java,2/c/2cc24e5aa9771bcc9b5a17544600b0e244d9c2ad
|
||||
q
|
||||
Abonus-auth/src/main/java/com/bonus/auth/BonusAuthApplication.java,9/1/911ccbfd7be6b58e893061cdfb63c958e37d6eda
|
||||
D
|
||||
sql/bns_20240604.sql,8/5/85b1974774f16ce7959a122e4766c9a31a7a7895
|
||||
<EFBFBD>
|
||||
\bonus-modules/bonus-file/src/main/java/com/bonus/file/service/FastDfsSysFileServiceImpl.java,c/6/c6d854777bca75255487810d12805069bf1a4f45
|
||||
P
|
||||
bonus-modules/bonus-file/pom.xml,0/f/0fbb26476b87bedf6f864aa5d52284b75bde6869
|
||||
<EFBFBD>
|
||||
Ubonus-modules/bonus-system/src/main/java/com/bonus/system/BonusSystemApplication.java,a/7/a7445a685a0b55cc0d903c370a10674cfbd15608
|
||||
E
|
||||
bonus-modules/pom.xml,7/3/73fe31f1bc837e4395fd9296f4f1793cc44fbd07
|
||||
<EFBFBD>
|
||||
Pbonus-modules/bonus-file/src/main/java/com/bonus/file/utils/FileUploadUtils.java,c/9/c9d1df9f46abbc0b2e5a3d147c7b3407ef09b84e
|
||||
<EFBFBD>
|
||||
Rbonus-modules/bonus-file/src/main/java/com/bonus/file/service/ISysFileService.java,6/7/6796766c5f6d21c9e346f89b25160c0dd6401a5b
|
||||
<EFBFBD>
|
||||
Zbonus-modules/bonus-file/src/main/java/com/bonus/file/service/MinioSysFileServiceImpl.java,8/7/8721859fd7a6cfb3d43a453ba3850048c6eeb2d2
|
||||
<EFBFBD>
|
||||
Zbonus-modules/bonus-file/src/main/java/com/bonus/file/service/LocalSysFileServiceImpl.java,2/e/2ef247d050a0881cb49e4a582bc1a311f9bc6be0
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.bonus.common.core.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Base64Utils {
|
||||
private static final String BASE64_MSG = "base64";
|
||||
/**
|
||||
* 将 Base64 字符串解码,再解码URL参数, 默认使用 UTF-8
|
||||
* @param source 原始 Base64 字符串
|
||||
* @return decoded string
|
||||
*
|
||||
* aHR0cHM6Ly9maWxlLmtla2luZy5jbi9kZW1vL%2BS4reaWhy5wcHR4 -> https://file.keking.cn/demo/%E4%B8%AD%E6%96%87.pptx -> https://file.keking.cn/demo/中文.pptx
|
||||
*/
|
||||
public static String decodeUrl(String source) {
|
||||
String url = decodeBase64String(source, StandardCharsets.UTF_8);
|
||||
if (! StringUtils.isNotBlank(url)){
|
||||
return null;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 Base64 字符串使用指定字符集解码
|
||||
* @param source 原始 Base64 字符串
|
||||
* @param charsets 字符集
|
||||
* @return decoded string
|
||||
*/
|
||||
public static String decodeBase64String(String source, Charset charsets) {
|
||||
/*
|
||||
* url 传入的参数里加号会被替换成空格,导致解析出错,这里需要把空格替换回加号
|
||||
* 有些 Base64 实现可能每 76 个字符插入换行符,也一并去掉
|
||||
* https://github.com/kekingcn/kkFileView/pull/340
|
||||
*/
|
||||
try {
|
||||
return new String(org.springframework.util.Base64Utils.decodeFromString(source.replaceAll(" ", "+").replaceAll("\n", "")), charsets);
|
||||
} catch (Exception e) {
|
||||
if (e.getMessage().toLowerCase().contains(BASE64_MSG)) {
|
||||
System.out.println("url解码异常,接入方法错误未使用BASE64");
|
||||
}else {
|
||||
System.out.println("url解码异常,其他错误,"+ e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String getFileNameFromURL(String url) {
|
||||
if (url.toLowerCase().startsWith("file:")) {
|
||||
try {
|
||||
URL urlObj = new URL(url);
|
||||
url = urlObj.getPath().substring(1);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// 因为url的参数中可能会存在/的情况,所以直接url.lastIndexOf("/")会有问题
|
||||
// 所以先从?处将url截断,然后运用url.lastIndexOf("/")获取文件名
|
||||
String noQueryUrl = url.substring(0, url.contains("?") ? url.indexOf("?") : url.length());
|
||||
return noQueryUrl.substring(noQueryUrl.lastIndexOf("/") + 1);
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,106 @@
|
|||
package com.bonus.file.utils;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.net.ftp.FTP;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
|
||||
public class FileDownloadUtils {
|
||||
|
||||
public static boolean downloadFile(String urlStr, String destination) throws IOException {
|
||||
if (urlStr.startsWith("http://") || urlStr.startsWith("https://")) {
|
||||
return downloadHttpFile(urlStr, destination);
|
||||
} else if (urlStr.startsWith("ftp://")) {
|
||||
return downloadFtpFile(urlStr, destination);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported protocol: " + urlStr);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean downloadHttpFile(String urlStr, String destination) throws IOException {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
|
||||
try (InputStream inputStream = connection.getInputStream();
|
||||
FileOutputStream outputStream = new FileOutputStream(destination)) {
|
||||
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead = -1;
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
System.out.println("HTTP download completed: " + destination);
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean downloadFtpFile(String urlStr, String destination) throws IOException {
|
||||
FTPClient ftpClient = new FTPClient();
|
||||
try {
|
||||
URL url = new URL(urlStr);
|
||||
String host = url.getHost();
|
||||
int port = url.getPort() == -1 ? 21 : url.getPort();
|
||||
String userInfo = url.getUserInfo();
|
||||
String[] credentials = userInfo != null ? userInfo.split(":") : new String[]{"anonymous", ""};
|
||||
String username = credentials[0];
|
||||
String password = credentials.length > 1 ? credentials[1] : "";
|
||||
String remoteFilePath = url.getPath();
|
||||
|
||||
ftpClient.connect(host, port);
|
||||
ftpClient.login(username, password);
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
|
||||
|
||||
try (InputStream inputStream = ftpClient.retrieveFileStream(remoteFilePath);
|
||||
FileOutputStream outputStream = new FileOutputStream(destination)) {
|
||||
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead = -1;
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
|
||||
if (ftpClient.completePendingCommand()) {
|
||||
System.out.println("FTP download completed: " + destination);
|
||||
} else {
|
||||
System.out.println("Failed to complete FTP download: " + destination);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
ftpClient.logout();
|
||||
ftpClient.disconnect();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// public static String replaceUrlPrefix(String originalUrl, String newPrefix) {
|
||||
// // 使用正则表达式匹配 URL 中的 "statics" 及其之前的部分
|
||||
// String regex = "^(.*?/statics)";
|
||||
// return originalUrl.replaceFirst(regex, newPrefix);
|
||||
// }
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// try {
|
||||
// // 示例下载文件
|
||||
// String httpUrl = "http://example.com/file.txt";
|
||||
// String ftpUrl = "ftp://username:password@ftp.example.com/file.txt";
|
||||
// String destination = "downloaded_file.txt";
|
||||
//
|
||||
// // 下载HTTP文件
|
||||
// downloadFile(httpUrl, destination);
|
||||
//
|
||||
// // 下载FTP文件
|
||||
// downloadFile(ftpUrl, destination);
|
||||
//
|
||||
// } catch (IOException ex) {
|
||||
// ex.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Loading…
Reference in New Issue