public class JarFileUtils extends Object
| 构造器和说明 |
|---|
JarFileUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
copyJarDirectoryToDirectory(String folderPath,
String targetDir)
if (new OsInfo().isWindows()) {
// 从应用程序jar里面的classpath下的files目录,拷贝 7z等文件到应用程序jar包同级目录
FileUtils.copyJarDirectoryToDirectory("files", Const.PROJECT_PATH);
log.debug("Copy classpath:files to " + Const.PROJECT_PATH + "files finished!")
|
public static void copyJarDirectoryToDirectory(String folderPath, String targetDir) throws IOException, URISyntaxException
folderPath - 文件夹路径,如类路径下:filestargetDir - 如:传入PROJECT_PATH = System.getProperty("user.dir")会在此目录下创建folerPath名称的目录IOExceptionURISyntaxExceptionCopyright © 2022. All rights reserved.