You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes: #9452
Issue link: #9452
* Move the logic about `fileNameGenerator` configuration out of `AbstractZipTransformer`
since this property is not used by `UnZipTransformer` implementation
* Add more docs about `ZipTransformer` logic
Copy file name to clipboardExpand all lines: spring-integration-zip/src/main/java/org/springframework/integration/zip/transformer/AbstractZipTransformer.java
+1-10Lines changed: 1 addition & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2015-2023 the original author or authors.
2
+
* Copyright 2015-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-integration-zip/src/test/java/org/springframework/integration/zip/config/xml/UnZipTransformerParserTests.java
+1-9Lines changed: 1 addition & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2015-2023 the original author or authors.
2
+
* Copyright 2015-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/whats-new.adoc
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,3 +78,9 @@ See xref:sftp/session-factory.adoc[SFTP Session Factory] for more information.
78
78
Multiple instances of `MqttPahoMessageDrivenChannelAdapter` and `Mqttv5PahoMessageDrivenChannelAdapter` can now be added at runtime using corresponding `ClientManager` through `IntegrationFlowContext`
79
79
Also a `MqttMessageNotDeliveredEvent` event has been introduced to emit when action callback reacts to the delivery failure.
80
80
See xref:mqtt.adoc[MQTT Support] for more information.
81
+
82
+
[[x6.4-zip-support-changes]]
83
+
=== Zip Support Changes
84
+
85
+
The `ZipTransformer` now exposes a `fileNameGenerator` property to customize a target zip file (and optional zip entry) name generation.
86
+
See xref:zip.adoc[Zip Support] for more information.
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/zip.adoc
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,14 @@ The `ZipTransformer` can be customized by setting several properties:
69
69
Default is `Deflater#DEFAULT_COMPRESSION`.
70
70
71
71
* `useFileAttributes` - specifies whether the name of the file shall be used for the zip entry.
72
+
* `fileNameGenerator` - uses to generate an original file name based on the request message.
73
+
Defaults to `DefaultFileNameGenerator`.
74
+
The `.zip` extension is added into this name for the target zip file name.
75
+
Unless it is already present as a result of this generator.
76
+
77
+
In addition, a `ZipHeaders.ZIP_ENTRY_FILE_NAME` and `ZipHeaders.ZIP_ENTRY_LAST_MODIFIED_DATE` can be supplied for the name of zip entry and its `lastmodified` attribute.
78
+
If not provided, the entry name is exact result of the `fileNameGenerator` and `lastmodified` falls back to the current date and time.
79
+
If the payload of request message is an `Iterable`, then this entry name is modified with an index starting `1`.
72
80
73
81
For example to zip a simple `test.txt` file into a `test.txt.zip`, only this configuration is enough:
0 commit comments