资源简介
SpringBoot中整合Mail实现发送带附件的邮件示例代码SpringBoot中整合Mail实现发送带附件的邮件示例代码

代码片段和文件信息
/*
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
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.
*/
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) {
System
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-27 23:39 helloSpringBoot2\
文件 1268 2019-03-17 21:43 helloSpringBoot2\.classpath
文件 277 2019-03-06 22:47 helloSpringBoot2\.gitignore
目录 0 2019-03-27 23:39 helloSpringBoot2\.mvn\
目录 0 2019-03-27 23:39 helloSpringBoot2\.mvn\wrapper\
文件 4624 2019-03-06 22:47 helloSpringBoot2\.mvn\wrapper\MavenWrapperDownloader.java
文件 48337 2019-03-06 22:47 helloSpringBoot2\.mvn\wrapper\maven-wrapper.jar
文件 116 2019-03-06 22:47 helloSpringBoot2\.mvn\wrapper\maven-wrapper.properties
文件 1135 2019-03-27 23:39 helloSpringBoot2\.project
目录 0 2019-03-27 23:39 helloSpringBoot2\.settings\
文件 155 2019-03-06 22:48 helloSpringBoot2\.settings\org.eclipse.core.resources.prefs
文件 356 2019-03-06 22:48 helloSpringBoot2\.settings\org.eclipse.jdt.core.prefs
文件 97 2019-03-06 22:47 helloSpringBoot2\.settings\org.eclipse.m2e.core.prefs
文件 145 2019-03-06 22:49 helloSpringBoot2\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 359 2019-03-06 22:47 helloSpringBoot2\HELP.md
文件 9113 2019-03-06 22:47 helloSpringBoot2\mvnw
文件 5810 2019-03-06 22:47 helloSpringBoot2\mvnw.cmd
文件 3568 2019-04-14 13:04 helloSpringBoot2\pom.xm
目录 0 2019-03-27 23:39 helloSpringBoot2\src\
目录 0 2019-03-27 23:39 helloSpringBoot2\src\main\
目录 0 2019-03-27 23:39 helloSpringBoot2\src\main\java\
目录 0 2019-03-27 23:39 helloSpringBoot2\src\main\java\com\
目录 0 2019-03-27 23:39 helloSpringBoot2\src\main\java\com\example\
目录 0 2019-04-14 13:27 helloSpringBoot2\src\main\java\com\example\demo\
文件 2177 2019-04-14 13:40 helloSpringBoot2\src\main\java\com\example\demo\HelloSpringBootApplication.java
目录 0 2019-04-04 20:52 helloSpringBoot2\src\main\java\com\example\demo\controller\
文件 1819 2019-03-21 22:12 helloSpringBoot2\src\main\java\com\example\demo\controller\BookController.java
文件 613 2019-03-24 22:48 helloSpringBoot2\src\main\java\com\example\demo\controller\SpringController.java
文件 583 2019-03-30 12:07 helloSpringBoot2\src\main\java\com\example\demo\controller\TestFastjsonController.java
文件 389 2019-04-04 20:25 helloSpringBoot2\src\main\java\com\example\demo\controller\TestFreeMarker.java
文件 394 2019-03-31 16:29 helloSpringBoot2\src\main\java\com\example\demo\controller\TestHandlerController.java
............此处省略122个文件信息
相关资源
- SpringMVC文件上传与的实现.rar
- SpringBoot+H2+mybatis-plus59130
- 基于J2EE物资出入库管理系统
- 基于SSM+CXF构建的RESTFul webservice
- 大数据中的云网络Cloud Networking for B
- Spring+MyBatis企业应用实战第一二版的源
- springboot+rabbitmq项目demo(亲测可正常运
- springboot整合RabbitMQ实现延时队列的两
- 关于Spring MVC项目maven中通过fileupload上
- Spring-Data-Redis2.0+Spring5
- 2017年-传智播客-张志君老师-SpringBoo
- springboot+mybatis整合实现注册登录
-
spring-fr
amework-5.0.2.RELEASE 源码包 - 基于web的图书馆运营系统
- springboot+webflux+mongodb+freemarker
- springboot整合activiti完整demo
- SpringBoot实战(第4版)清晰版.pdf.zip
- SpringBoot 中文文档
- springboot+jpa+thymeleaf实现增删改查分页
- es(elasticsearch)整合SpringCloudSpringBo
- Springboot日志开启SLF4J过程解析
- 原银在线信贷平台概要设计说明书v
- springcloud 微服务(全套视频)
- springCloud教学视频
- springboot全套教程2018年2.0版本
- 官网springboot项目
- Spring Boot中自定义注解结合AOP实现主备
- flowable整合Spring
- Spring Security架构以及源码详析
- SpringBoot+Mybatis+前后台隔离技术,完整
评论
共有 条评论