Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setup-manager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
setup-manager
Commits
2b148fc2
Commit
2b148fc2
authored
Oct 29, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改登录鉴权时间
parent
88641bf8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
setup-project-manager/pom.xml
setup-project-manager/pom.xml
+6
-0
setup-project-manager/src/main/java/com/mortals/xhx/common/utils/ZipUtils.java
.../src/main/java/com/mortals/xhx/common/utils/ZipUtils.java
+18
-2
setup-project-manager/src/main/java/com/mortals/xhx/module/setup/service/impl/SetupProjectServiceImpl.java
...hx/module/setup/service/impl/SetupProjectServiceImpl.java
+18
-2
No files found.
setup-project-manager/pom.xml
View file @
2b148fc2
...
@@ -189,6 +189,12 @@
...
@@ -189,6 +189,12 @@
<version>
5.2.2
</version>
<version>
5.2.2
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.codehaus.plexus
</groupId>
<artifactId>
plexus-archiver
</artifactId>
<version>
2.2
</version>
</dependency>
</dependencies>
</dependencies>
...
...
setup-project-manager/src/main/java/com/mortals/xhx/common/utils/ZipUtils.java
View file @
2b148fc2
...
@@ -8,6 +8,8 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
...
@@ -8,6 +8,8 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import
org.apache.commons.compress.archivers.tar.TarArchiveInputStream
;
import
org.apache.commons.compress.archivers.tar.TarArchiveInputStream
;
import
org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
;
import
org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.codehaus.plexus.archiver.tar.TarGZipUnArchiver
;
import
org.codehaus.plexus.logging.console.ConsoleLoggerManager
;
import
java.io.*
;
import
java.io.*
;
import
java.util.HashSet
;
import
java.util.HashSet
;
...
@@ -255,14 +257,28 @@ public class ZipUtils {
...
@@ -255,14 +257,28 @@ public class ZipUtils {
String
unZipPath
=
"E:\\pic\\zip\\"
;
String
unZipPath
=
"E:\\pic\\zip\\"
;
File
destDir
=
new
File
(
unZipPath
);
//ZipUtils.unGzip(fileName, unZipPath);
//ZipUtils.unGzip(fileName, unZipPath);
File
f
ile
=
new
File
(
fileName
);
File
sourceF
ile
=
new
File
(
fileName
);
/* File file = new File(fileName);
/* File file = new File(fileName);
;
;
byte[] bytes = ZipUtil.unGzip(FileUtil.readBytes(file));*/
byte[] bytes = ZipUtil.unGzip(FileUtil.readBytes(file));*/
ZipUtils
.
extractTarGZ
(
file
,
unZipPath
);
/* ZipUtils.extractTarGZ(file, unZipPath);*/
final
TarGZipUnArchiver
ua
=
new
TarGZipUnArchiver
();
// Logging - as @Akom noted, logging is mandatory in newer versions, so you can use a code like this to configure it:
ConsoleLoggerManager
manager
=
new
ConsoleLoggerManager
();
manager
.
initialize
();
ua
.
enableLogging
(
manager
.
getLoggerForComponent
(
"bla"
));
// -- end of logging part
ua
.
setSourceFile
(
sourceFile
);
destDir
.
mkdirs
();
ua
.
setDestDirectory
(
destDir
);
ua
.
extract
();
}
}
...
...
setup-project-manager/src/main/java/com/mortals/xhx/module/setup/service/impl/SetupProjectServiceImpl.java
View file @
2b148fc2
...
@@ -23,6 +23,8 @@ import com.mortals.xhx.module.setup.mode.DbSetupEntity;
...
@@ -23,6 +23,8 @@ import com.mortals.xhx.module.setup.mode.DbSetupEntity;
import
com.mortals.xhx.module.setup.mode.SiteEntity
;
import
com.mortals.xhx.module.setup.mode.SiteEntity
;
import
com.mortals.xhx.module.setup.service.SetupDbService
;
import
com.mortals.xhx.module.setup.service.SetupDbService
;
import
org.apache.commons.compress.compressors.CompressorInputStream
;
import
org.apache.commons.compress.compressors.CompressorInputStream
;
import
org.codehaus.plexus.archiver.tar.TarGZipUnArchiver
;
import
org.codehaus.plexus.logging.console.ConsoleLoggerManager
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.io.*
;
import
java.io.*
;
...
@@ -100,15 +102,29 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
...
@@ -100,15 +102,29 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
File
file
=
new
File
(
sourcePath
);
File
file
=
new
File
(
sourcePath
);
log
.
info
(
"文件存在:{}"
,
file
.
exists
());
log
.
info
(
"文件存在:{}"
,
file
.
exists
());
File
destDir
=
new
File
(
setupProjectEntity
.
getProjectPath
());
if
(!
file
.
exists
()){
if
(!
file
.
exists
()){
throw
new
AppException
(
"请上传项目工程文件!"
);
throw
new
AppException
(
"请上传项目工程文件!"
);
}
}
String
shell
=
"tar -zvxf "
+
sourcePath
+
" -C "
+
setupProjectEntity
.
getProjectPath
();
final
TarGZipUnArchiver
ua
=
new
TarGZipUnArchiver
();
// Logging - as @Akom noted, logging is mandatory in newer versions, so you can use a code like this to configure it:
ConsoleLoggerManager
manager
=
new
ConsoleLoggerManager
();
manager
.
initialize
();
ua
.
enableLogging
(
manager
.
getLoggerForComponent
(
"bla"
));
// -- end of logging part
ua
.
setSourceFile
(
file
);
destDir
.
mkdirs
();
ua
.
setDestDirectory
(
destDir
);
ua
.
extract
();
/* String shell = "tar -zvxf " + sourcePath + " -C " + setupProjectEntity.getProjectPath();
log.info("解压命令:{}", shell);
log.info("解压命令:{}", shell);
String str = RuntimeUtil.execForStr(shell);
String str = RuntimeUtil.execForStr(shell);
log
.
info
(
"解压命令结果:{}"
,
str
);
log.info("解压命令结果:{}", str);
*/
// InputStream inputStream = FileUtil.getInputStream(file);
// InputStream inputStream = FileUtil.getInputStream(file);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment