Commit
·
1740b0e
1
Parent(s):
d04c26a
Update log
Browse files
src/main/java/com/jetbrains/help/util/FileTools.java
CHANGED
|
@@ -4,14 +4,19 @@ import cn.hutool.core.io.FileUtil;
|
|
| 4 |
import cn.hutool.core.text.CharSequenceUtil;
|
| 5 |
import cn.hutool.core.util.ObjectUtil;
|
| 6 |
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
|
|
| 7 |
import org.springframework.boot.system.ApplicationHome;
|
| 8 |
import org.springframework.core.io.ClassPathResource;
|
| 9 |
|
| 10 |
import java.io.File;
|
| 11 |
import java.io.IOException;
|
|
|
|
| 12 |
|
| 13 |
public interface FileTools {
|
| 14 |
|
|
|
|
|
|
|
| 15 |
ApplicationHome application = new ApplicationHome();
|
| 16 |
|
| 17 |
|
|
@@ -28,6 +33,7 @@ public interface FileTools {
|
|
| 28 |
|
| 29 |
static File getFileOrCreat(String path) {
|
| 30 |
File file = getFile(path);
|
|
|
|
| 31 |
if (ObjectUtil.isNotNull(application.getSource())) {
|
| 32 |
ClassPathResource classPathResource = new ClassPathResource(path);
|
| 33 |
File classPathFile = FileUtil.file(classPathResource.getPath());
|
|
|
|
| 4 |
import cn.hutool.core.text.CharSequenceUtil;
|
| 5 |
import cn.hutool.core.util.ObjectUtil;
|
| 6 |
import cn.hutool.core.util.StrUtil;
|
| 7 |
+
import lombok.extern.java.Log;
|
| 8 |
+
import lombok.extern.slf4j.Slf4j;
|
| 9 |
import org.springframework.boot.system.ApplicationHome;
|
| 10 |
import org.springframework.core.io.ClassPathResource;
|
| 11 |
|
| 12 |
import java.io.File;
|
| 13 |
import java.io.IOException;
|
| 14 |
+
import java.util.logging.Logger;
|
| 15 |
|
| 16 |
public interface FileTools {
|
| 17 |
|
| 18 |
+
static final Logger LOGGER = Logger.getLogger(FileTools.class.getName());
|
| 19 |
+
|
| 20 |
ApplicationHome application = new ApplicationHome();
|
| 21 |
|
| 22 |
|
|
|
|
| 33 |
|
| 34 |
static File getFileOrCreat(String path) {
|
| 35 |
File file = getFile(path);
|
| 36 |
+
LOGGER.info(String.format("source: %s", application.getSource()));
|
| 37 |
if (ObjectUtil.isNotNull(application.getSource())) {
|
| 38 |
ClassPathResource classPathResource = new ClassPathResource(path);
|
| 39 |
File classPathFile = FileUtil.file(classPathResource.getPath());
|