资源简介
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个文件信息
相关资源
- 图书管理ssm框架整合篇
- springboot+shiro+md5
- 工作中用到的spring项目经验
- Spring Boot 2.0深度实践之核心技术篇
- 基于spring websocket实现广播及点对点推
- Spring MVC Cookbook.pdf英文版
- 《微分几何》(作者)丘成桐
- Spring boot 在线预览办公文件doc、docx、
- Spring study code
- 关于Spring相关的论文
- 基于SpringMVC的用户三次登录失败案例
- Spring boot in action 随书源码
- Maven+SpringMVC的HelloWord最简单入门小(
- 基于struts+spring+ibatits宠物商城
- IDEA 搭建Spring MVC环境二
- SpringMVC-Helloworld224190
- springcloud全家桶(eureka+ribbon+feign+hys
- zw_SpringMVC.zip
- Elements of Computational Statistics(Springe
- Spring.Net结合NHibernate完整代码
- 三大框架(最新)
- springboot+Shiro 实现动态授权
- Maven+SSM+Bootstrap项目
- spring boot+mybatis+thymeleaf+apache shiro开发
- SpringBoot+mybatis+redis+rabbitmq
- JPetStore (Struts + Spring + Hibernate)版
- SSHStruts、Spring、Hibernate三大框架整合
- SpringBoot+Vue前后端分离,使用SpringSe
- Spring boot -- 基于AngularJS的网络商城系
- Maven之Spring Boot_AngularJS--网络商城系统
评论
共有 条评论