ENTAXY-374 release 1.8.2

This commit is contained in:
2022-08-23 13:40:11 +03:00
parent b68642f81c
commit 1061b96c7e
616 changed files with 60896 additions and 3202 deletions

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<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/maven-v4_0_0.xsd">
<parent>
<groupId>ru.entaxy.esb.platform.runtime.base.connecting</groupId>
<artifactId>adapter</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -19,6 +18,9 @@
<properties>
<bundle.osgi.dynamicimport.pkg>*</bundle.osgi.dynamicimport.pkg>
<bundle.osgi.export.pkg>ru.entaxy.platform.adapter.file</bundle.osgi.export.pkg>
<bundle.osgi.private.pkg>template,
ru.entaxy.adapter</bundle.osgi.private.pkg>
<!-- <bundle.osgi.private.pkg>ru.entaxy.adapter</bundle.osgi.private.pkg>-->
</properties>
@ -30,11 +32,30 @@
<extensions>true</extensions>
<configuration>
<instructions>
<Entaxy-Adapter>true</Entaxy-Adapter>
<Entaxy-Adapter-Class/>
<!-- Entaxy-Adapter>true</Entaxy-Adapter>
<Entaxy-Adapter-Class / -->
<Entaxy-Factory-Provider>true</Entaxy-Factory-Provider>
<Entaxy-Template-Provider>true</Entaxy-Template-Provider>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-file</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-util</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
<artifactId>base-support</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,69 @@
/*-
* ~~~~~~licensing~~~~~~
* file-adapter
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.adapter.file;
import java.io.File;
import java.util.Map;
import org.apache.camel.component.file.FileComponent;
import org.apache.camel.component.file.GenericFileEndpoint;
import org.apache.camel.util.StringHelper;
import ru.entaxy.platform.base.support.CommonUtils;
public class ExtendedFileComponent extends FileComponent {
protected String rootDirectory = "";
@Override
protected GenericFileEndpoint<File> buildFileEndpoint(String uri, String remaining, Map<String, Object> parameters)
throws Exception {
// copied from parent
if (StringHelper.hasStartToken(remaining, "simple")) {
throw new IllegalArgumentException("Invalid directory: " + remaining + ". Dynamic expressions with ${ } placeholders is not allowed."
+ " Use the fileName option to set the dynamic expression.");
}
String current = remaining;
if (CommonUtils.isValid(rootDirectory)) {
current = rootDirectory;
if (CommonUtils.isValid(remaining) && !".".equals(remaining)) {
if (!current.endsWith("/"))
current += "/";
if (remaining.startsWith("/"))
current += remaining.substring(1);
else
current += remaining;
}
}
log.debug("CREATING ENDPOINT FOR [{}]", current);
return super.buildFileEndpoint(uri, current, parameters);
}
public String getRootDirectory() {
return rootDirectory;
}
public void setRootDirectory(String rootDirectory) {
this.rootDirectory = rootDirectory;
}
}

View File

@ -516,7 +516,7 @@
"type": "pathParameter",
"generator": "",
"config": {
"expession": "${directoryName}"
"expression": "${directoryName}"
}
},
{

View File

@ -0,0 +1,47 @@
[#ftl attributes={"generated.type":"blueprint"}]
[#--
~~~~~~licensing~~~~~~
file-adapter
==========
Copyright (C) 2020 - 2021 EmDev LLC
==========
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
~~~~~~/licensing~~~~~~
--]
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
>
<service interface="org.apache.camel.Component" ref="[=objectId]">
<service-properties>
<entry key="connection.name" value="[=objectId]"/>
</service-properties>
</service>
<bean id="[=objectId]" class="ru.entaxy.platform.adapter.file.ExtendedFileComponent">
[#if properties??]
[#list properties as key, value]
[#if !key?starts_with("##") && !key?starts_with("__")] [#-- we skip additional properties --]
<property name="[=key]" value="[=value]"/>
[/#if]
[/#list]
[/#if]
</bean>
</blueprint>

View File

@ -45,7 +45,7 @@
</service-properties>
</service>
<bean id="[=connection.name]" class="org.apache.camel.component.file.FileComponent">
<bean id="[=connection.name]" class="ru.entaxy.platform.adapter.file.ExtendedFileComponent">
[#if connection.properties??]
[#list connection.properties as key, value]
<property name="[=key]" value="[='$']{[=connection.configurationPid].[=key]}"/>