Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto-Gentili committed Jul 7, 2022
2 parents 105b449 + 7520bc2 commit 4e631c4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/org.burningwave/core/12)](https://maven-badges.herokuapp.com/maven-central/org.burningwave/core/)
[![GitHub](https://img.shields.io/github/license/burningwave/core)](https://github.com/burningwave/core/blob/master/LICENSE)

[![Platforms](https://img.shields.io/badge/platforms-Windows%2C%20Mac%20OS%2C%20Linux-orange)](https://github.com/burningwave/core/actions/runs/2624310384)
[![Platforms](https://img.shields.io/badge/platforms-Windows%2C%20Mac%20OS%2C%20Linux-orange)](https://github.com/burningwave/core/actions/runs/2627645302)

[![Supported JVM](https://img.shields.io/badge/supported%20JVM-8%2C%209+%20(18)-blueviolet)](https://github.com/burningwave/core/actions/runs/2624310384)
[![Supported JVM](https://img.shields.io/badge/supported%20JVM-8%2C%209+%20(18)-blueviolet)](https://github.com/burningwave/core/actions/runs/2627645302)

[![Coveralls github branch](https://img.shields.io/coveralls/github/burningwave/core/master)](https://coveralls.io/github/burningwave/core?branch=master)
[![GitHub open issues](https://img.shields.io/github/issues/burningwave/core)](https://github.com/burningwave/core/issues)
Expand Down Expand Up @@ -48,7 +48,7 @@ To include Burningwave Core library in your projects simply use with **Apache Ma
<dependency>
<groupId>org.burningwave</groupId>
<artifactId>core</artifactId>
<version>12.56.0</version>
<version>12.57.0</version>
</dependency>
```

Expand Down Expand Up @@ -1143,6 +1143,10 @@ background-executor.queued-task-executor[2].priority=\
10
background-executor.task-creation-tracking.enabled=\
${background-executor.all-tasks-monitoring.enabled}
banner.additonal-informations=\
${Implementation-Title} ${Implementation-Version}
banner.additonal-informations.retrieve-from-manifest-file-with-implementation-title=\
Burningwave Core
banner.hide=\
false
banner.file=\
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
-->
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.burningwave</groupId>
<artifactId>core</artifactId>
<version>12.56.1-SNAPSHOT</version>
<version>12.57.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Burningwave Core</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static class Key {
private static final String GROUP_NAME_FOR_NAMED_ELEMENTS = "group-name-for-named-elements";
private static final String BANNER_HIDE = "banner.hide";
private static final String BANNER_FILE = "banner.file";
private static final String BANNER_ADDITIONAL_INFORMATIONS_MANIFEST_IMPLEMENTATION_TITLE = "banner.additonal-informations.manifest-implementation-title";
private static final String BANNER_ADDITIONAL_INFORMATIONS_RETRIEVE_FROM_MANIFEST_FILE_WITH_IMPLEMENTATION_TITLE = "banner.additonal-informations.retrieve-from-manifest-file-with-implementation-title";
private static final String BANNER_ADDITIONAL_INFORMATIONS = "banner.additonal-informations";
private static final String BACKGROUND_EXECUTOR_TASK_CREATION_TRACKING_ENABLED = "background-executor.task-creation-tracking.enabled";
private static final String BACKGROUND_EXECUTOR_ALL_TASKS_MONITORING_ENABLED = "background-executor.all-tasks-monitoring.enabled";
Expand Down Expand Up @@ -152,7 +152,7 @@ public static class Default {
);

defaultValues.put(
Key.BANNER_ADDITIONAL_INFORMATIONS_MANIFEST_IMPLEMENTATION_TITLE,
Key.BANNER_ADDITIONAL_INFORMATIONS_RETRIEVE_FROM_MANIFEST_FILE_WITH_IMPLEMENTATION_TITLE,
"Burningwave Core"
);

Expand Down Expand Up @@ -597,11 +597,17 @@ private static void showBanner() throws IOException {
String additonalInformations = "";
try {
String additionalInformationsManifestImplementationTitle = IterableObjectHelper.resolveStringValue(
org.burningwave.core.iterable.IterableObjectHelper.ResolveConfig.forNamedKey(Configuration.Key.BANNER_ADDITIONAL_INFORMATIONS_MANIFEST_IMPLEMENTATION_TITLE).on(GlobalProperties)
org.burningwave.core.iterable.IterableObjectHelper.ResolveConfig.forNamedKey(
Configuration.Key.BANNER_ADDITIONAL_INFORMATIONS_RETRIEVE_FROM_MANIFEST_FILE_WITH_IMPLEMENTATION_TITLE
).on(GlobalProperties)
);
Collection<Map<String, String>> manifestAsMapByMainAttributes = Resources.getManifestAsMapByMainAttributes(
attributes -> {
return additionalInformationsManifestImplementationTitle.equals(attributes.getValue("Implementation-Title"));
},
Component.class.getClassLoader(),
Thread.currentThread().getContextClassLoader()
);
Collection<Map<String, String>> manifestAsMapByMainAttributes = Resources.getManifestAsMapByMainAttributes(attributes -> {
return additionalInformationsManifestImplementationTitle.equals(attributes.getValue("Implementation-Title"));
});
if (!manifestAsMapByMainAttributes.isEmpty()) {
additonalInformations = IterableObjectHelper.resolveStringValue(
org.burningwave.core.iterable.IterableObjectHelper.ResolveConfig.forNamedKey(Configuration.Key.BANNER_ADDITIONAL_INFORMATIONS)
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/burningwave/core/io/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ public final Collection<FileSystemItem> getAsFileSystemItems(ClassLoader classLo
return paths;
}

public final Collection<Manifest> getManifestByMainAttributes(Predicate<Attributes> attributesPredicate) {
Map<URL, InputStream> manifestISs = getAsInputStreams("META-INF/MANIFEST.MF", Resources.class.getClassLoader());
public final Collection<Manifest> getManifestByMainAttributes(Predicate<Attributes> attributesPredicate, ClassLoader... resourceClassLoaders) {
Map<URL, InputStream> manifestISs = getAsInputStreams("META-INF/MANIFEST.MF", resourceClassLoaders);
Collection<Manifest> manifests = new ArrayList<>();
for (Map.Entry<URL, InputStream> entry : manifestISs.entrySet()) {
try (InputStream iS = entry.getValue()) {
Expand All @@ -261,7 +261,7 @@ public final Collection<Manifest> getManifestByMainAttributes(Predicate<Attribut
return manifests;
}

public final Collection<Map<String, String>> getManifestAsMapByMainAttributes(Predicate<Attributes> attributesPredicate) {
public final Collection<Map<String, String>> getManifestAsMapByMainAttributes(Predicate<Attributes> attributesPredicate, ClassLoader... resourceClassLoaders) {
Collection<Manifest> manifests = getManifestByMainAttributes(attributesPredicate);
Collection<Map<String, String>> manifestMaps = new ArrayList<>();
for (Manifest manifest : manifests) {
Expand Down

0 comments on commit 4e631c4

Please sign in to comment.