Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a7efd76c6 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,2 @@
|
|||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
**/*.log
|
|
||||||
**/target
|
|
||||||
@@ -85,13 +85,13 @@ The framework is not the framework for beautifying UI, but to simplify the step
|
|||||||
- [ ] Data valication
|
- [ ] Data valication
|
||||||
- [ ] Optimize performance
|
- [ ] Optimize performance
|
||||||
|
|
||||||
## ~~Maven Repository~~
|
## Maven Repository
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.gitee.Biubiuyuyu</groupId>
|
<groupId>com.gitee.Biubiuyuyu</groupId>
|
||||||
<artifactId>javafx-plus</artifactId>
|
<artifactId>javafx-plus</artifactId>
|
||||||
<version>1.0.0-RELEASE</version>
|
<version>1.2.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>com.gitee.Biubiuyuyu</groupId>
|
|
||||||
<artifactId>javafx-plus-demo</artifactId>
|
|
||||||
<version>1.3.0-SNAPSHOT</version>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
|
||||||
<javafx-plus.version>1.3.0-SNAPSHOT</javafx-plus.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.gitee.Biubiuyuyu</groupId>
|
|
||||||
<artifactId>javafx-plus</artifactId>
|
|
||||||
<version>${javafx-plus.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<artifactId>javafx-plus-parent</artifactId>
|
|
||||||
<groupId>com.gitee.Biubiuyuyu</groupId>
|
|
||||||
<version>1.3.0-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>javafx-plus</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<!--配置Maven 对resource文件 过滤 -->
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/java</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**/*.properties</include>
|
|
||||||
<include>**/*.xml</include>
|
|
||||||
<include>**/*.fxml</include>
|
|
||||||
</includes>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
<compilerArgs>
|
|
||||||
<!-- 过期的方法的警告-->
|
|
||||||
<arg>-Xlint:deprecation</arg>
|
|
||||||
</compilerArgs>
|
|
||||||
<compilerArguments>
|
|
||||||
<!-- 是否输出所有的编译信息(包括类的加载等)-->
|
|
||||||
<!--<verbose />-->
|
|
||||||
<!-- 解决maven命令编译报错,因为rt.jar 和jce.jar在jre的lib下面,不在jdk的lib下面,
|
|
||||||
导致maven找不到(java7以后会出现这个问题),将这2个jar包拷贝到jdk的lib下面估计也好使-->
|
|
||||||
<bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
|
|
||||||
</compilerArguments>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<descriptorRefs>
|
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
|
||||||
</descriptorRefs>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
48
pom.xml
48
pom.xml
@@ -3,16 +3,13 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<packaging>pom</packaging>
|
<name>javafx-plus</name>
|
||||||
<name>javafx-plus-parent</name>
|
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>javafx-plus</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<groupId>com.gitee.Biubiuyuyu</groupId>
|
<groupId>com.gitee.Biubiuyuyu</groupId>
|
||||||
<artifactId>javafx-plus-parent</artifactId>
|
<artifactId>javafx-plus</artifactId>
|
||||||
<version>1.3.0-SNAPSHOT</version>
|
<version>1.2.1-SNAPSHOT</version>
|
||||||
|
<!-- packaging为pom时,不会加载resources 故注释-->
|
||||||
|
<!-- <packaging>pom</packaging>-->
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.sonatype.oss</groupId>
|
<groupId>org.sonatype.oss</groupId>
|
||||||
@@ -28,6 +25,7 @@
|
|||||||
<slf4j-log4j12.version>1.7.21</slf4j-log4j12.version>
|
<slf4j-log4j12.version>1.7.21</slf4j-log4j12.version>
|
||||||
<tomcat.version>9.0.48</tomcat.version>
|
<tomcat.version>9.0.48</tomcat.version>
|
||||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||||
|
<commons-io.version>2.11.0</commons-io.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- 第三方动态代理库 -->
|
<!-- 第三方动态代理库 -->
|
||||||
@@ -63,6 +61,12 @@
|
|||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>${commons-lang3.version}</version>
|
<version>${commons-lang3.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>${commons-io.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
@@ -121,6 +125,20 @@
|
|||||||
</descriptorRefs>
|
</descriptorRefs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<!-- Source 开源 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>jar-no-fork</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
@@ -129,20 +147,6 @@
|
|||||||
<id>release</id>
|
<id>release</id>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!-- Source -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>2.2.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>jar-no-fork</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<!-- Javadoc -->
|
<!-- Javadoc -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package cn.edu.scau.biubiusuisui.utils;
|
|||||||
import cn.edu.scau.biubiusuisui.exception.ProtocolNotSupport;
|
import cn.edu.scau.biubiusuisui.exception.ProtocolNotSupport;
|
||||||
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
|
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
|
||||||
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
|
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
|
||||||
|
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -34,12 +35,28 @@ public class FileUtil {
|
|||||||
* @param filePath
|
* @param filePath
|
||||||
* @return
|
* @return
|
||||||
* @description 读取resources文件夹下的file,相对于resources的文件路径,如 resources/config.conf 则只需 config.conf
|
* @description 读取resources文件夹下的file,相对于resources的文件路径,如 resources/config.conf 则只需 config.conf
|
||||||
|
* @since 1.2.0 update: 使用getResourcesAsStream读取,屏蔽jar包读取障碍
|
||||||
*/
|
*/
|
||||||
public static String readFileFromResources(String filePath) throws UnsupportedEncodingException {
|
public static String readFileFromResources(String filePath) throws UnsupportedEncodingException {
|
||||||
URL url = FileUtil.class.getClassLoader().getResource(filePath);
|
InputStream is = FileUtil.class.getClassLoader().getResourceAsStream(filePath);
|
||||||
if (url != null) {
|
if (is == null) {
|
||||||
String path = StringUtil.getRootPath(url);
|
return "";
|
||||||
return readFile(path);
|
}
|
||||||
|
StringBuffer content = new StringBuffer();
|
||||||
|
try (
|
||||||
|
InputStreamReader inputStreamReader = new InputStreamReader(is);
|
||||||
|
BufferedReader br = new BufferedReader(inputStreamReader);
|
||||||
|
) {
|
||||||
|
String temp;
|
||||||
|
while ((temp = br.readLine()) != null) {
|
||||||
|
// 一次读入一行数据
|
||||||
|
content.append(temp + "\r\n");
|
||||||
|
}
|
||||||
|
return content.toString();
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("reading file error", e);
|
||||||
|
} finally {
|
||||||
|
IOUtils.closeQuietly(is);
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -60,8 +77,7 @@ public class FileUtil {
|
|||||||
content.append(temp + "\r\n");
|
content.append(temp + "\r\n");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error(e.getMessage());
|
logger.error("reading file error", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return content.toString();
|
return content.toString();
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user