Skip to content

Commit

Permalink
为了结合另外一个xf项目。更改了包结构!!!更改了依赖名!!!我保证!!!这是最后一次变更如此大的改动!!!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx committed Feb 15, 2019
1 parent 0ebf9f4 commit d0fe0b7
Show file tree
Hide file tree
Showing 47 changed files with 197 additions and 195 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ XSSFWorkbook xssfWorkBook = UtilExcelExport.UtilExcelExport();
* 参数一 maven资源库路径
* 返回值 返回清理成功与否 true:成功 false:失败
*/
boolean cleanResult = UtilMavenClean.clean(m2HomePath);
boolean cleanResult = UtilMaven.clean(m2HomePath);
```

### BusinessUtil
Expand Down Expand Up @@ -422,6 +422,14 @@ String encryptStr = UtilMD5.encryptString(proclaimed,randomStr);

## 提交日志

### 2019-02-15

**重大变更**

为了结合另外一个xf项目。更改了包结构!!!更改了依赖名!!!我保证!!!这是最后一次变更如此大的改动!!!!!



### 2019-01-24

1. 添加判断一个字符串是否包含任意列举的字符串为前缀的方法
Expand Down
10 changes: 4 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.yyx</groupId>
<artifactId>util</artifactId>
<groupId>org.yyx.xf</groupId>
<artifactId>xf-util</artifactId>
<version>1.0.8-RELEASE</version>

<name>xf-util</name>
<description>xf的util单独包</description>
<!--region Maven私服-->
<repositories>
<repository>
Expand Down Expand Up @@ -38,7 +39,6 @@
</distributionManagement>
<!-- endregion -->
<!--endregion-->

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<poi>3.17</poi>
Expand All @@ -56,7 +56,6 @@
<junit>4.12</junit>
<lombok>1.16.20</lombok>
</properties>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -96,7 +95,6 @@
</resource>
</resources>
</build>

<dependencies>
<!-- region spring boot starter web -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package org.yyx.xf.commons.domain.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* 异常基础类
* <p>
*
* @author 叶云轩 at [email protected]
* @date 2019-02-16-00:14
*/
public class BaseException extends RuntimeException {

/**
* BaseException 日志输出
*/
private final static Logger LOGGER = LoggerFactory.getLogger(BaseException.class);
private static final long serialVersionUID = -7034897190745767639L;

public BaseException() {
super();
}

public BaseException(String message) {
super(message);
LOGGER.info("[BaseException] -> [message] {} ", message);
}

public BaseException(String message, Throwable cause) {
super(message, cause);
LOGGER.info("[BaseException] -> [message] {} ", message);
}

public BaseException(Throwable cause) {
super(cause);
}

protected BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}


}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.yyx.exception;
package org.yyx.xf.commons.domain.exception;

/**
* 参数类型的异常
*
* @author 叶云轩 contact by [email protected]
* @date 2018/1/24 17:53
*/
public class ParamException extends RuntimeException {
public class ParamException extends BaseException {

/**
* 序列化标识
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.yyx.constant.maven;
package org.yyx.xf.tool.build.maven.domain.constant;

/**
* Maven文件常量
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
package org.yyx.util.maven;
package org.yyx.xf.tool.build.maven.util;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yyx.util.file.io.UtilFile;
import org.yyx.util.string.UtilString;
import org.yyx.xf.tool.document.file.util.UtilFile;
import org.yyx.xf.tool.string.util.UtilString;

import java.io.File;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import static ch.qos.logback.core.rolling.helper.FileFilterUtil.isEmptyDirectory;
import static org.yyx.constant.maven.MavenFileConstant.$;
import static org.yyx.constant.maven.MavenFileConstant.LAST_UPDATED;
import static org.yyx.constant.maven.MavenFileConstant.M2_HOME;
import static org.yyx.constant.maven.MavenFileConstant.MAVEN_HOME;
import static org.yyx.constant.maven.MavenFileConstant.UN_KNOWN;
import static org.yyx.xf.tool.build.maven.domain.constant.MavenFileConstant.$;
import static org.yyx.xf.tool.build.maven.domain.constant.MavenFileConstant.LAST_UPDATED;
import static org.yyx.xf.tool.build.maven.domain.constant.MavenFileConstant.M2_HOME;
import static org.yyx.xf.tool.build.maven.domain.constant.MavenFileConstant.MAVEN_HOME;
import static org.yyx.xf.tool.build.maven.domain.constant.MavenFileConstant.UN_KNOWN;

/**
* 清理Maven目录下.lastUpdated Unkonw 等无用文件或目录
Expand All @@ -33,17 +27,13 @@
* @author 叶云轩 at [email protected]
* @date 2018-12-31-22:26
*/
public class UtilMavenClean {
public class UtilMaven {
/**
* UtilMavenClean 日志输出
* UtilMaven 日志输出
*/
private static final Logger LOGGER = LoggerFactory.getLogger(UtilMavenClean.class);
private static ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("demo-pool-%d").build();
private static ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
private static final Logger LOGGER = LoggerFactory.getLogger(UtilMaven.class);

private UtilMavenClean() {
private UtilMaven() {
}


Expand Down Expand Up @@ -130,16 +120,11 @@ public static void clean(final String mavenRepositoryPath) {
// 将路径以文件的形式表示
File mavenRepositoryFile = new File(mavenRepositoryPath);
// 一个线程去找输入文件下目录路径
// singleThreadPool.execute(() -> {
if (mavenRepositoryFile.exists()) {
// 说明文件存在
doClean(mavenRepositoryFile);
}
// });
// 另一个线程去自动查找环境变量
// singleThreadPool.execute(() ->
checkEnv(mavenRepositoryPath)
// )
if (mavenRepositoryFile.exists()) {
// 说明文件存在
doClean(mavenRepositoryFile);
}
checkEnv(mavenRepositoryPath)
;
}

Expand Down Expand Up @@ -196,7 +181,8 @@ private static void doClean(String repositoryPath) {
* @return localRepositoryPath
*/
protected static String getLocalRepository(String mavenHome) {
String settingsFile = mavenHome + "/settings.xml";
// todo 判断
String settingsFile = mavenHome + "/conf/settings.xml";
File file = new File(settingsFile);
SAXReader reader = new SAXReader();
Document document;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.yyx.util.date;
package org.yyx.xf.tool.date.util;

import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.yyx.exception.ParamException;
import org.yyx.xf.commons.domain.exception.ParamException;

import java.text.ParseException;
import java.text.SimpleDateFormat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.yyx.domain.entity;
package org.yyx.xf.tool.db.domain.entity;

import lombok.Data;
import org.beetl.sql.core.annotatoin.AssignID;
import org.yyx.util.string.UtilString;
import org.yyx.xf.tool.string.util.UtilString;

import java.util.Date;

Expand All @@ -12,7 +13,8 @@
* @author 叶云轩 at [email protected]
* @date 2018/12/28-15:10
*/
public abstract class AbsBaseEntity implements BaseEntity {
@Data
public abstract class AbstractBaseEntity implements BaseEntity {

/**
* 数据库表记录唯一主键标识
Expand All @@ -32,42 +34,6 @@ public abstract class AbsBaseEntity implements BaseEntity {
*/
private Date gmtModified;

@Override
public Date getGmtCreate() {
return gmtCreate;
}

public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}

@Override
public Date getGmtModified() {
return gmtModified;
}

@Override
public String getPkField() {
return pkField;
}

public void setPkField(String pkField) {
this.pkField = pkField;
}

@Override
public short getStatus() {
return status;
}

public void setStatus(short status) {
this.status = status;
}

public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}

/**
* 初始化对象的方法
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.yyx.domain.entity;
package org.yyx.xf.tool.db.domain.entity;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.yyx.constant;
package org.yyx.xf.tool.document.file.domain.constant;

/**
* 文件相关的常量
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.yyx.exception.file;
package org.yyx.xf.tool.document.file.domain.exception;

import org.yyx.xf.commons.domain.exception.BaseException;

/**
* 文件异常
*
* @author 叶云轩 contact by [email protected]
* @date 2018/1/24 19:29
*/
public class FileException extends RuntimeException {
public class FileException extends BaseException {

/**
* 序列化标识
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.yyx.exception.file;
package org.yyx.xf.tool.document.file.domain.exception;

/**
* 文件类型不正确异常
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.yyx.util.file.io;
package org.yyx.xf.tool.document.file.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
import org.yyx.exception.file.FileException;
import org.yyx.util.date.UtilDate;
import org.yyx.util.string.UtilString;
import org.yyx.xf.tool.document.file.domain.exception.FileException;
import org.yyx.xf.tool.date.util.UtilDate;
import org.yyx.xf.tool.string.util.UtilString;

import java.io.File;
import java.io.FileInputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package org.yyx.util.file.io;
package org.yyx.xf.tool.document.file.util;

import org.icepdf.core.pobjects.Document;
import org.icepdf.core.pobjects.Page;
import org.icepdf.core.util.GraphicsRenderingHints;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yyx.exception.ParamException;
import org.yyx.xf.commons.domain.exception.ParamException;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import static org.yyx.constant.FileConstant.NAME_PNG;
import static org.yyx.constant.FileConstant.SUFFIX_JPG;
import static org.yyx.constant.FileConstant.SUFFIX_PDF;
import static org.yyx.xf.tool.document.file.domain.constant.FileConstant.NAME_PNG;
import static org.yyx.xf.tool.document.file.domain.constant.FileConstant.SUFFIX_JPG;
import static org.yyx.xf.tool.document.file.domain.constant.FileConstant.SUFFIX_PDF;

/**
* PDF相关工具类
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.yyx.constant;
package org.yyx.xf.tool.document.word.domain.constant;

/**
* 单元格合并方式
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.yyx.constant;
package org.yyx.xf.tool.document.word.domain.constant;

/**
* Xml文档常量
Expand Down
Loading

0 comments on commit d0fe0b7

Please sign in to comment.