Skip to content

Commit

Permalink
Fix 3.8.1 (#818)
Browse files Browse the repository at this point in the history
* fix!!!

* 3.8.1
  • Loading branch information
getrebuild authored Oct 9, 2024
1 parent 88b6153 commit 101b89b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from d9e664 to 3dd1a6
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<url>https://getrebuild.com/</url>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rebuild/core/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.8.0";
public static final String VER = "3.8.1";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3080004;
public static final int BUILD = 3080106;

static {
// Driver for DB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected File exec() throws Exception {
}
}

CompressUtils.forceZip(tmp, tmpZip, null);
CompressUtils.forceZip(tmpZip, tmp, null);
destZip = tmpZip.exists() ? tmpZip : null;

return destZip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public File backup(File backups) throws IOException {
File rbdata = RebuildConfiguration.getFileOfData("");

String destName = "backup_datafile." + CalendarUtils.getPlainDateTimeFormat().format(CalendarUtils.now()) + ".zip";
File dest = new File(backups, destName);
File destZip = new File(backups, destName);

CompressUtils.forceZip(rbdata, dest, pathname -> {
CompressUtils.forceZip(destZip, rbdata, pathname -> {
String name = pathname.getName();
return !("_backups".equals(name) || "_log".equals(name) || "temp".equals(name) || "rebuild.pid".equals(name));
});

log.info("Backup succeeded : {} ({})", dest, FileUtils.byteCountToDisplaySize(dest.length()));
log.info("Backup succeeded : {} ({})", destZip, FileUtils.byteCountToDisplaySize(destZip.length()));

return dest;
return destZip;
}
}
14 changes: 7 additions & 7 deletions src/main/java/com/rebuild/utils/CompressUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ public static void forceZip(File destZip, File fileOrDir, FileFilter filter) thr
/**
* Creates a zip output stream at the specified path with the contents of the specified directory.
*
* @param zipOutputStream
* @param destZipOutputStream
* @param fileOrDir
* @param filter
* @throws IOException
*/
public static void zip(OutputStream zipOutputStream, File fileOrDir, FileFilter filter) throws IOException {
public static void zip(OutputStream destZipOutputStream, File fileOrDir, FileFilter filter) throws IOException {
BufferedOutputStream bufferedOutputStream = null;
ZipArchiveOutputStream zipArchiveOutputStream = null;

try {
bufferedOutputStream = new BufferedOutputStream(zipOutputStream);
bufferedOutputStream = new BufferedOutputStream(destZipOutputStream);
zipArchiveOutputStream = new ZipArchiveOutputStream(bufferedOutputStream);

addFileToZip(zipArchiveOutputStream, fileOrDir, null, filter);
Expand All @@ -70,7 +70,7 @@ public static void zip(OutputStream zipOutputStream, File fileOrDir, FileFilter
}

IOUtils.closeQuietly(bufferedOutputStream);
IOUtils.closeQuietly(zipOutputStream);
IOUtils.closeQuietly(destZipOutputStream);
}
}

Expand All @@ -85,12 +85,12 @@ public static void forceZip(File destZip, File... files) throws IOException {
FileUtils.deleteQuietly(destZip);
}

OutputStream zipOutputStream = Files.newOutputStream(destZip.toPath());
OutputStream destZipOutputStream = Files.newOutputStream(destZip.toPath());
BufferedOutputStream bufferedOutputStream = null;
ZipArchiveOutputStream zipArchiveOutputStream = null;

try {
bufferedOutputStream = new BufferedOutputStream(zipOutputStream);
bufferedOutputStream = new BufferedOutputStream(destZipOutputStream);
zipArchiveOutputStream = new ZipArchiveOutputStream(bufferedOutputStream);

for (File file : files) {
Expand All @@ -104,7 +104,7 @@ public static void forceZip(File destZip, File... files) throws IOException {
}

IOUtils.closeQuietly(bufferedOutputStream);
IOUtils.closeQuietly(zipOutputStream);
IOUtils.closeQuietly(destZipOutputStream);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/rebuild/utils/CompressUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class CompressUtilsTest {
@Test
void zip() throws IOException {
CompressUtils.forceZip(
new File("D:\\GitHub\\rebuild\\rebuild"),
new File("D:\\GitHub\\rebuild.zip"),
new File("D:\\GitHub\\rebuild\\rebuild"),
pathname -> !pathname.getName().contains("node_modules")
);
}
Expand Down

0 comments on commit 101b89b

Please sign in to comment.