-
大小: 123KB文件类型: .zip金币: 1下载: 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个文件信息
相关资源
- SpringBoot框架,前后端分离写的新闻管
- Maven+SpringBoot+JPA单表增删改查
- 超市订单管理系统基于springbootmybati
- springboot-AOP实现多数据源动态切换Dr
- springboot简单分页
- Springboot和bootstrap实现shiro权限控制配
- springboot-mybatis-dubbo-zookeeper项目框架
- SpringBoot+Atomikos分布式事务及多数据源
- SpringBoot之整合Spring Security代码
- springboot支付宝网页支付
- springboot+webuploader 实现大文件切片上传
- SpringBoot使用JMS的小ActiveMQ实现
- springboot实现web系统Licence验证
- sharding-jdbc-demo.zip
- 服务端获取签名前端直传oss插件layu
- vert.x结合springboot开发mqtt服务,真实可
- springboot+springcloud教程视频.txt
- springboothttps
- springboot实现Excel文件导入与导出功能
- springboot + redis实现session共享
- springboot+mybatis+shiro整合demo
- SpringBoot集成app微信支付.rar
- 基于SpringBoot+Mybatis商品信息管理系统
- 蚂蚁课堂第四期结业项目SpringCloud构建
- springBoot简单后台增删改查
- SpringBoot+WebSocket--亲测可用
- springboot-mybatis整合多数据源方式之一
- 微信小程序增删改查简单Demo
- 微信小程序后端Springboot
- springboot导入Excel文件并入库
评论
共有 条评论