mirror of
https://github.com/NotoChen/Jetbrains-Help.git
synced 2025-05-24 23:16:44 +08:00
[fix]docker运行报错问题
This commit is contained in:
parent
a824cdc497
commit
02dcc8d7f4
|
@ -8,7 +8,7 @@ import org.springframework.boot.system.ApplicationHome;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.InputStream;
|
||||||
|
|
||||||
public interface FileTools {
|
public interface FileTools {
|
||||||
|
|
||||||
|
@ -30,14 +30,14 @@ public interface FileTools {
|
||||||
File file = getFile(path);
|
File file = getFile(path);
|
||||||
if (ObjectUtil.isNotNull(application.getSource())) {
|
if (ObjectUtil.isNotNull(application.getSource())) {
|
||||||
ClassPathResource classPathResource = new ClassPathResource(path);
|
ClassPathResource classPathResource = new ClassPathResource(path);
|
||||||
File classPathFile = FileUtil.file(classPathResource.getPath());
|
|
||||||
if (classPathResource.exists() && !file.exists()) {
|
if (classPathResource.exists() && !file.exists()) {
|
||||||
try {
|
try (InputStream inputStream = classPathResource.getInputStream()) {
|
||||||
FileUtil.writeFromStream(classPathResource.getInputStream(), classPathFile);
|
FileUtil.writeFromStream(inputStream, file);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new IllegalArgumentException(CharSequenceUtil.format("{} File read failed", classPathFile.getPath()), e);
|
throw new IllegalArgumentException(
|
||||||
|
CharSequenceUtil.format("{} File read or write failed", path), e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
FileUtil.copy(classPathFile, file, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user