Skip to content

Commit

Permalink
初始提交
Browse files Browse the repository at this point in the history
  • Loading branch information
yjz committed Jul 3, 2020
1 parent d52de6e commit 3c26f22
Show file tree
Hide file tree
Showing 46 changed files with 3,106 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
HELP.md
/target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
/build/

### VS Code ###
.vscode/

target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

100 changes: 100 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?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.xhiteam.dxf</groupId>
<artifactId>dxf</artifactId>
<version>0.0.2</version>
<packaging>jar</packaging>

<developers>
<developer>
<name>jianzhao you</name>
<email>youjz0714@qq.com</email>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.20</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.0</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.0-jre</version>
</dependency>

<!--测试、后面可以删除-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

<organization>
<name>Xhrtas Group</name>
<url>https://github.com/xhiteam</url>
</organization>

<distributionManagement>
<repository>
<id>releases</id>
<name>Release Repository</name>
<url>http://nexus.xhiteam.com/repository/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshot Repository</name>
<url>http://nexus.xhiteam.com/repository/snapshot/</url>
</snapshotRepository>
</distributionManagement>

<repositories>
<repository>
<id>group</id>
<url>http://nexus.xhiteam.com/repository/group/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<build>
<finalName>dxf</finalName>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
</plugin>
</plugins>
</build>

</project>
22 changes: 22 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DXF 解析项目



# 1. Change Log

### 0.0.2

- releases和snapshots推送地址更改为 http://nexus.xhiteam.com
- add: 组织信息
- add: 开发者信息
- add: maven plugin repo 设置为 aliyun maven

### 0.0.1

- 域名更改为 xhiteam.com






54 changes: 54 additions & 0 deletions src/main/java/com/xhiteam/dxf/DXF.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.xhiteam.dxf;

import com.xhiteam.dxf.collector.DxfCollector;
import com.xhiteam.dxf.collector.impl.DxfCollectorImpl;
import com.xhiteam.dxf.constant.FileConstant;
import com.xhiteam.dxf.enums.DxfFileErrorEnum;
import com.xhiteam.dxf.exception.DxfFileException;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
* @Description DXF入口
* @Author fengwen
* @Date 2019/12/21 20:46
* @Version V1.0
*/
public class DXF {

/**
* 上传文件、返回DXF数据采集者
*
* @param file 上传的文件
* @return 数据采集者
*/
public static DxfCollector build(File file) throws IOException {
if (file == null) {
throw new FileNotFoundException();
}
if (!file.getName().endsWith(FileConstant.FILE_EXTENSION)) {
throw new DxfFileException(DxfFileErrorEnum.DXF_FILE_ERROR.getMsg() + file.getName());
}
return new DxfCollectorImpl(file);
}

/**
* 通过文件文件路径、返回DXF数据采集者
*
* @param filePath 文件路径
* @return 数据采集者
*/
public static DxfCollector build(String filePath) throws IOException {
File file = new File(filePath);
if (!file.exists()) {
throw new FileNotFoundException();
}
if (!file.getName().endsWith(FileConstant.FILE_EXTENSION)) {
throw new DxfFileException(DxfFileErrorEnum.DXF_FILE_ERROR.getMsg() + file.getName());
}
return new DxfCollectorImpl(file);
}

}
Loading

0 comments on commit 3c26f22

Please sign in to comment.