/*
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) {
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 direcrory '" + 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 {
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 权限控制(菜单控制,页面元素控制,url控制)
共153个文件
xml:89个
java:26个
class:25个
需积分: 50 79 下载量 198 浏览量
2019-04-13
16:44:44
上传
评论 3
收藏 150KB ZIP 举报
温馨提示
基于RBAC思想的权限控制,可先建立完整的库,也可以使用使用代码生成,包中提供两种方式, 代码先后顺序 菜单控制----》元素控制-------》url控制
资源推荐
资源详情
资源评论
收起资源包目录
SpringBoot 权限控制(菜单控制,页面元素控制,url控制) (153个子文件)
UrlFilter.class 3KB
Users.class 3KB
UsersServiceImpl.class 3KB
UrlServiceImpl.class 2KB
LoginController.class 2KB
Menu.class 2KB
ElementServiceImpl.class 2KB
MenuServiceImpl.class 2KB
Role_Element.class 2KB
Role_Menu.class 2KB
Role_Url.class 1KB
Url.class 1KB
Element.class 1023B
Role.class 1011B
ElementDao.class 788B
MenuDao.class 777B
UrlDao.class 770B
SpringbootRbacApplication.class 749B
SpringbootRbacApplicationTests.class 668B
UsersDao.class 619B
UriController.class 422B
UrlService.class 365B
UsersService.class 325B
ElementService.class 266B
MenuService.class 259B
mvnw.cmd 6KB
.gitignore 303B
springboot_rbac.iml 10KB
maven-wrapper.jar 47KB
MavenWrapperDownloader.java 5KB
UrlFilter.java 3KB
UsersServiceImpl.java 2KB
Users.java 2KB
LoginController.java 1KB
UrlServiceImpl.java 1KB
Menu.java 1KB
Role_Menu.java 1KB
Role_Element.java 1KB
ElementServiceImpl.java 1000B
MenuServiceImpl.java 932B
Role_Url.java 875B
Role.java 860B
Element.java 810B
Url.java 767B
ElementDao.java 747B
MenuDao.java 723B
UrlDao.java 636B
UsersDao.java 601B
UrlService.java 473B
ElementService.java 391B
SpringbootRbacApplicationTests.java 358B
SpringbootRbacApplication.java 345B
UsersService.java 270B
UriController.java 251B
MenuService.java 189B
main.jsp 851B
index.jsp 491B
weclome.jsp 308B
HELP.md 532B
mvnw 9KB
application.properties 743B
application.properties 743B
maven-wrapper.properties 116B
rbac.sql 2KB
workspace.xml 39KB
uiDesigner.xml 9KB
pom.xml 2KB
Project_Default.xml 1KB
Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_4_RELEASE.xml 769B
Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_1_4_RELEASE.xml 755B
Maven__org_springframework_boot_spring_boot_starter_logging_2_1_4_RELEASE.xml 748B
Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_4_RELEASE.xml 741B
Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_4_RELEASE.xml 734B
Maven__org_hibernate_common_hibernate_commons_annotations_5_0_4_Final.xml 732B
Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_8.xml 729B
Maven__org_springframework_boot_spring_boot_starter_test_2_1_4_RELEASE.xml 727B
Maven__org_springframework_boot_spring_boot_starter_json_2_1_4_RELEASE.xml 727B
Maven__org_springframework_boot_spring_boot_starter_jdbc_2_1_4_RELEASE.xml 727B
Maven__org_springframework_boot_spring_boot_starter_aop_2_1_4_RELEASE.xml 720B
Maven__org_springframework_boot_spring_boot_starter_web_2_1_4_RELEASE.xml 720B
Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml 700B
Maven__org_springframework_boot_spring_boot_starter_2_1_4_RELEASE.xml 692B
Maven__org_springframework_data_spring_data_commons_2_1_6_RELEASE.xml 692B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_8.xml 688B
Maven__org_hibernate_validator_hibernate_validator_6_0_16_Final.xml 681B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_8.xml 674B
Maven__org_springframework_boot_spring_boot_test_2_1_4_RELEASE.xml 671B
Maven__org_springframework_data_spring_data_jpa_2_1_6_RELEASE.xml 664B
Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_17.xml 660B
Maven__org_springframework_spring_expression_5_1_6_RELEASE.xml 658B
Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml 644B
compiler.xml 642B
Maven__org_apache_tomcat_embed_tomcat_embed_jasper_9_0_17.xml 639B
Maven__org_springframework_spring_aspects_5_1_6_RELEASE.xml 637B
Maven__org_springframework_spring_context_5_1_6_RELEASE.xml 637B
Maven__org_springframework_boot_spring_boot_2_1_4_RELEASE.xml 636B
Maven__org_springframework_spring_webmvc_5_1_6_RELEASE.xml 630B
Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_17.xml 625B
Maven__org_springframework_spring_beans_5_1_6_RELEASE.xml 623B
Maven__org_springframework_spring_core_5_1_6_RELEASE.xml 616B
共 153 条
- 1
- 2
资源评论
我家排行老三
- 粉丝: 14
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功