/*
* Copyright 2007-present the original author or authors.
*
* Licensed 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.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* 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/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".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.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于Springboot+WebSocket开发的web版在线客服聊天系统,一键启动直接使用无需配置,可嵌入到任何B/S架构系统 web版在线客服聊天系统 1.支持自定制广告推送和自动答复,进入监控页面底部按钮自定制消息 2.开箱即用,直接启动项目通过IP:port/index进入监控页面,IP:port/customer注册并进入客服页面,IP:port/consumer注册并进入客户页面,无侵入随时嵌入其他 任何B/S系统。 3.可同时多客服多客户对接,系统自动为客户轮询分配客服。当只有一个客服时,所有客户都将对接到该客服 基于Springboot+WebSocket开发的web版在线客服聊天系统,一键启动直接使用无需配置,可嵌入到任何B/S架构系统 web版在线客服聊天系统 1.支持自定制广告推送和自动答复,进入监控页面底部按钮自定制消息 2.开箱即用,直接启动项目通过IP:port/index进入监控页面,IP:port/customer注册并进入客服页面,IP:port/consumer注册并进入客户页面,无侵入随时嵌入其他 任何B/S系统。 3.可同时多客服多客户对
资源推荐
资源详情
资源评论
收起资源包目录
基于Springboot+WebSocket开发的web版在线客服聊天系统,一键启动直接使用无需配置,可嵌入到任何B/S架构系统 (129个子文件)
mvnw.cmd 6KB
buttons-min.css 2KB
tables-min.css 1KB
buttons-core-min.css 687B
font.css 477B
emotion.css 291B
34.gif 13KB
38.gif 10KB
17.gif 8KB
18.gif 8KB
11.gif 8KB
31.gif 7KB
46.gif 6KB
30.gif 6KB
43.gif 5KB
8.gif 5KB
28.gif 5KB
42.gif 5KB
5.gif 5KB
32.gif 4KB
40.gif 4KB
14.gif 4KB
25.gif 4KB
7.gif 4KB
10.gif 4KB
44.gif 4KB
48.gif 4KB
68.gif 3KB
9.gif 3KB
27.gif 3KB
39.gif 3KB
6.gif 3KB
16.gif 3KB
47.gif 3KB
21.gif 3KB
60.gif 3KB
26.gif 3KB
74.gif 2KB
24.gif 2KB
57.gif 2KB
51.gif 2KB
23.gif 2KB
12.gif 2KB
33.gif 2KB
70.gif 2KB
50.gif 2KB
22.gif 2KB
20.gif 2KB
4.gif 2KB
1.gif 2KB
19.gif 2KB
3.gif 2KB
37.gif 2KB
29.gif 2KB
45.gif 2KB
13.gif 2KB
36.gif 2KB
67.gif 2KB
65.gif 2KB
2.gif 2KB
41.gif 2KB
52.gif 2KB
15.gif 2KB
66.gif 2KB
64.gif 2KB
49.gif 1KB
63.gif 1KB
35.gif 1KB
73.gif 1KB
58.gif 1KB
53.gif 1KB
69.gif 1KB
54.gif 1KB
56.gif 1KB
59.gif 1KB
55.gif 1KB
62.gif 1KB
61.gif 1KB
72.gif 988B
71.gif 971B
75.gif 654B
.gitattributes 87B
.gitignore 333B
consumerSocket.html 4KB
customerSocket.html 4KB
index.html 3KB
editAd.html 2KB
editReply.html 2KB
maven-wrapper.jar 50KB
MavenWrapperDownloader.java 5KB
Manager.java 5KB
SocketServer.java 4KB
IndexPageInfo.java 3KB
IndexContorller.java 3KB
Consumer.java 2KB
Customer.java 2KB
Setting.java 1KB
IndexService.java 1KB
WebsocketConfiguration.java 972B
Message.java 807B
共 129 条
- 1
- 2
资源评论
- m0_750348432024-04-21资源值得借鉴的内容很多,那就浅学一下吧,值得下载!
- 767254132023-12-30这个资源值得下载,资源内容详细全面,与描述一致,受益匪浅。
白话机器学习
- 粉丝: 8259
- 资源: 7686
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功