-
大小: 123KB文件类型: .zip金币: 2下载: 0 次发布日期: 2021-06-18
- 语言: 其他
- 标签: springboot oss
资源简介
springboot整合oss实现文件的上传,查看,删除,下载!注释清晰,方便易懂!

代码片段和文件信息
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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
https://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.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;
public class MavenWrapperDownloader {
/**
* Default URL to download the maven-wrapper.jar from if no ‘downloadUrl‘ is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
“https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar“;
/**
* Path to the maven-wrapper.properties file which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
“.mvn/wrapper/maven-wrapper.properties“;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
“.mvn/wrapper/maven-wrapper.jar“;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = “wrapperUrl“;
public static void main(String args[]) {
System.out.println(“- Downloader started“);
File baseDirectory = new File(args[0]);
System.out.println(“- Using base directory: “ + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL url);
} catch (IOException e) {
Syst
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-08-10 18:27 springboot-oss\
文件 5811 2019-08-01 23:49 springboot-oss\mvnw.cmd
目录 0 2019-08-10 21:04 __MACOSX\
目录 0 2019-08-10 21:04 __MACOSX\springboot-oss\
文件 183 2019-08-01 23:49 __MACOSX\springboot-oss\._mvnw.cmd
目录 0 2019-08-08 13:18 springboot-oss\target\
目录 0 2019-08-10 18:59 springboot-oss\target\test-classes\
目录 0 2019-08-10 18:59 springboot-oss\target\test-classes\me
文件 16 2019-08-10 18:59 springboot-oss\target\test-classes\me
目录 0 2019-08-10 18:59 springboot-oss\target\test-classes\com\
目录 0 2019-08-10 18:59 springboot-oss\target\test-classes\com\tuanzi\
文件 619 2019-08-10 18:59 springboot-oss\target\test-classes\com\tuanzi\OssdemoApplicationTests.class
目录 0 2019-08-08 13:17 springboot-oss\target\generated-sources\
目录 0 2019-08-08 13:17 springboot-oss\target\generated-sources\annotations\
目录 0 2019-08-10 20:18 springboot-oss\target\classes\
目录 0 2019-08-10 18:59 springboot-oss\target\classes\me
文件 16 2019-08-10 18:59 springboot-oss\target\classes\me
目录 0 2019-08-10 20:58 springboot-oss\target\classes\static\
文件 1723 2019-08-10 20:58 springboot-oss\target\classes\static\manager.html
文件 2167 2019-08-10 18:59 springboot-oss\target\classes\static\upload.html
目录 0 2019-08-10 18:59 springboot-oss\target\classes\com\
目录 0 2019-08-10 20:18 springboot-oss\target\classes\com\tuanzi\
目录 0 2019-08-10 19:06 springboot-oss\target\classes\com\tuanzi\vo\
文件 2725 2019-08-10 19:06 springboot-oss\target\classes\com\tuanzi\vo\FileUploadResult.class
目录 0 2019-08-10 20:18 springboot-oss\target\classes\com\tuanzi\config\
文件 3914 2019-08-10 20:18 springboot-oss\target\classes\com\tuanzi\config\AliyunConfig.class
文件 730 2019-08-10 18:59 springboot-oss\target\classes\com\tuanzi\OssdemoApplication.class
目录 0 2019-08-10 19:06 springboot-oss\target\classes\com\tuanzi\controller\
文件 2643 2019-08-10 19:06 springboot-oss\target\classes\com\tuanzi\controller\FileUploadController.class
目录 0 2019-08-10 19:06 springboot-oss\target\classes\com\tuanzi\service\
文件 5554 2019-08-10 19:06 springboot-oss\target\classes\com\tuanzi\service\FileUploadService.class
............此处省略137个文件信息
相关资源
- Electric potential drops across a crack gap in
- springboot2+activiti 7 -- maven工程依赖配置
- jboss5.1地址
- SpringBoot+H2+mybatis-plus59130
- ucosII源代码 2.9版本全 Micrium-uCOS-II-V
- springboot+rabbitmq项目demo(亲测可正常运
- springboot整合RabbitMQ实现延时队列的两
- 四川省移动通信公司BOSS项目集中式数
- 四川移动BOSS集中式数据备份系统建设
- 2017年-传智播客-张志君老师-SpringBoo
- springboot+mybatis整合实现注册登录
- springboot+webflux+mongodb+freemarker
- springboot整合activiti完整demo
- SpringBoot实战(第4版)清晰版.pdf.zip
- SpringBoot 中文文档
- springboot+jpa+thymeleaf实现增删改查分页
- es(elasticsearch)整合SpringCloudSpringBo
- Springboot日志开启SLF4J过程解析
- Impact of bond order loss on surface and nanos
- The Existence and Stability of Nontrivial St
- springboot全套教程2018年2.0版本
- 官网springboot项目
- Ross-Konno手术后左心室流出道梗阻
- Sb Pollution in the Soil Moss and Sediments of
- Genome doubling and chromosome elimination wit
- SpringBoot+Mybatis+前后台隔离技术,完整
- Spring Boot技术栈博客企业前后端2018
- springboot从入门到精通视频教程课程源
- crossfilter tutorial
- SpringBoot +vue 框架项目.zip
评论
共有 条评论