diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..63c228a --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,18 @@ +name: Maven Build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Build with Maven + run: mvn -B install --no-transfer-progress --file pom.xml diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml new file mode 100644 index 0000000..f25bfa1 --- /dev/null +++ b/.github/workflows/release-to-maven-central.yml @@ -0,0 +1,56 @@ +name: release-to-maven-central +on: + workflow_dispatch: + inputs: + releaseversion: + description: 'Release version' + required: true + default: '2.0.0' +jobs: + publish: + runs-on: ubuntu-latest + steps: + - run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}" + + - uses: actions/checkout@v2 + + - name: Set up settings.xml for Maven Central Repository + uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: oss.sonatype.org + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Set projects Maven version to GitHub Action GUI set version + run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress + + - name: Publish package + run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true + env: + MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + - name: Generate changelog + id: changelog + uses: metcalfc/changelog-generator@v0.4.4 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.inputs.releaseversion }} + release_name: ${{ github.event.inputs.releaseversion }} + body: | + Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/reedelk/module-file/${{ github.event.inputs.releaseversion }}/ + ### Things that changed in this release + ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: false \ No newline at end of file diff --git a/pom.xml b/pom.xml index 380c65e..3a2ac80 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ 4.0.0 - com.reedelk + de.codecentric.reedelk module-parent - 1.0.6 + 2.0.0 bundle - 1.0.6 + 2.0.0 module-file diff --git a/src/main/java/com/reedelk/file/ModuleDefinition.java b/src/main/java/com/reedelk/file/ModuleDefinition.java deleted file mode 100644 index 0a2c07a..0000000 --- a/src/main/java/com/reedelk/file/ModuleDefinition.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.reedelk.file; - -import com.reedelk.runtime.api.annotation.Module; - -@Module("File Module") -public class ModuleDefinition { -} - diff --git a/src/main/java/com/reedelk/file/internal/attribute/FileAttribute.java b/src/main/java/com/reedelk/file/internal/attribute/FileAttribute.java deleted file mode 100644 index ee5f229..0000000 --- a/src/main/java/com/reedelk/file/internal/attribute/FileAttribute.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.reedelk.file.internal.attribute; - -import com.reedelk.runtime.api.annotation.Type; -import com.reedelk.runtime.api.annotation.TypeProperty; -import com.reedelk.runtime.api.message.MessageAttributes; - -import static com.reedelk.file.internal.attribute.FileAttribute.FILE_NAME; -import static com.reedelk.file.internal.attribute.FileAttribute.TIMESTAMP; - -@Type -@TypeProperty(name = FILE_NAME, type = String.class) -@TypeProperty(name = TIMESTAMP, type = long.class) -public class FileAttribute extends MessageAttributes { - - static final String FILE_NAME = "fileName"; - static final String TIMESTAMP = "timestamp"; - - public FileAttribute(String fileName) { - put(FILE_NAME, fileName); - put(TIMESTAMP, System.currentTimeMillis()); - } -} diff --git a/src/main/java/com/reedelk/file/internal/commons/FileOperation.java b/src/main/java/com/reedelk/file/internal/commons/FileOperation.java deleted file mode 100644 index c769859..0000000 --- a/src/main/java/com/reedelk/file/internal/commons/FileOperation.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.reedelk.file.internal.commons; - -public enum FileOperation { - READ, - WRITE -} diff --git a/src/main/java/com/reedelk/file/internal/commons/LockType.java b/src/main/java/com/reedelk/file/internal/commons/LockType.java deleted file mode 100644 index 152836f..0000000 --- a/src/main/java/com/reedelk/file/internal/commons/LockType.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.reedelk.file.internal.commons; - -public enum LockType { - LOCK, - NONE -} diff --git a/src/main/java/com/reedelk/file/internal/read/ReadMode.java b/src/main/java/com/reedelk/file/internal/read/ReadMode.java deleted file mode 100644 index 5958ac2..0000000 --- a/src/main/java/com/reedelk/file/internal/read/ReadMode.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.reedelk.file.internal.read; - -import com.reedelk.runtime.api.annotation.DisplayName; - -public enum ReadMode { - @DisplayName("Default") - DEFAULT, - @DisplayName("Stream") - STREAM -} diff --git a/src/main/java/de/codecentric/reedelk/file/ModuleDefinition.java b/src/main/java/de/codecentric/reedelk/file/ModuleDefinition.java new file mode 100644 index 0000000..68287af --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/file/ModuleDefinition.java @@ -0,0 +1,8 @@ +package de.codecentric.reedelk.file; + +import de.codecentric.reedelk.runtime.api.annotation.Module; + +@Module("File Module") +public class ModuleDefinition { +} + diff --git a/src/main/java/com/reedelk/file/component/FileDelete.java b/src/main/java/de/codecentric/reedelk/file/component/FileDelete.java similarity index 69% rename from src/main/java/com/reedelk/file/component/FileDelete.java rename to src/main/java/de/codecentric/reedelk/file/component/FileDelete.java index 7396135..feb75c8 100644 --- a/src/main/java/com/reedelk/file/component/FileDelete.java +++ b/src/main/java/de/codecentric/reedelk/file/component/FileDelete.java @@ -1,16 +1,16 @@ -package com.reedelk.file.component; - -import com.reedelk.file.internal.attribute.FileAttribute; -import com.reedelk.file.internal.exception.FileDeleteException; -import com.reedelk.file.internal.exception.NotValidFileException; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.component.ProcessorSync; -import com.reedelk.runtime.api.flow.FlowContext; -import com.reedelk.runtime.api.message.Message; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.runtime.api.message.content.MimeType; -import com.reedelk.runtime.api.script.ScriptEngineService; -import com.reedelk.runtime.api.script.dynamicvalue.DynamicString; +package de.codecentric.reedelk.file.component; + +import de.codecentric.reedelk.file.internal.attribute.FileAttribute; +import de.codecentric.reedelk.file.internal.exception.FileDeleteException; +import de.codecentric.reedelk.file.internal.exception.NotValidFileException; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.component.ProcessorSync; +import de.codecentric.reedelk.runtime.api.flow.FlowContext; +import de.codecentric.reedelk.runtime.api.message.Message; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.runtime.api.message.content.MimeType; +import de.codecentric.reedelk.runtime.api.script.ScriptEngineService; +import de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ServiceScope; @@ -20,9 +20,9 @@ import java.nio.file.Paths; import java.util.Optional; -import static com.reedelk.file.internal.commons.Messages.FileDelete.ERROR_FILE_DELETE; -import static com.reedelk.file.internal.commons.Messages.FileDelete.FILE_NAME_ERROR; -import static com.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotNull; +import static de.codecentric.reedelk.file.internal.commons.Messages.FileDelete.ERROR_FILE_DELETE; +import static de.codecentric.reedelk.file.internal.commons.Messages.FileDelete.FILE_NAME_ERROR; +import static de.codecentric.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotNull; @ModuleComponent("File Delete") @ComponentOutput( diff --git a/src/main/java/com/reedelk/file/component/FileExists.java b/src/main/java/de/codecentric/reedelk/file/component/FileExists.java similarity index 79% rename from src/main/java/com/reedelk/file/component/FileExists.java rename to src/main/java/de/codecentric/reedelk/file/component/FileExists.java index 35b6184..3d477c6 100644 --- a/src/main/java/com/reedelk/file/component/FileExists.java +++ b/src/main/java/de/codecentric/reedelk/file/component/FileExists.java @@ -1,15 +1,15 @@ -package com.reedelk.file.component; - -import com.reedelk.file.internal.attribute.FileAttribute; -import com.reedelk.file.internal.exception.NotValidFileException; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.commons.DynamicValueUtils; -import com.reedelk.runtime.api.component.ProcessorSync; -import com.reedelk.runtime.api.flow.FlowContext; -import com.reedelk.runtime.api.message.Message; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.runtime.api.script.ScriptEngineService; -import com.reedelk.runtime.api.script.dynamicvalue.DynamicString; +package de.codecentric.reedelk.file.component; + +import de.codecentric.reedelk.file.internal.attribute.FileAttribute; +import de.codecentric.reedelk.file.internal.exception.NotValidFileException; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.commons.DynamicValueUtils; +import de.codecentric.reedelk.runtime.api.component.ProcessorSync; +import de.codecentric.reedelk.runtime.api.flow.FlowContext; +import de.codecentric.reedelk.runtime.api.message.Message; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.runtime.api.script.ScriptEngineService; +import de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ServiceScope; @@ -19,8 +19,8 @@ import java.nio.file.Paths; import java.util.Optional; -import static com.reedelk.file.internal.commons.Messages.FileRead.FILE_NAME_ERROR; -import static com.reedelk.runtime.api.commons.StringUtils.isBlank; +import static de.codecentric.reedelk.file.internal.commons.Messages.FileRead.FILE_NAME_ERROR; +import static de.codecentric.reedelk.runtime.api.commons.StringUtils.isBlank; @ModuleComponent("File Exists") diff --git a/src/main/java/com/reedelk/file/component/FileRead.java b/src/main/java/de/codecentric/reedelk/file/component/FileRead.java similarity index 80% rename from src/main/java/com/reedelk/file/component/FileRead.java rename to src/main/java/de/codecentric/reedelk/file/component/FileRead.java index fb847b9..25a6236 100644 --- a/src/main/java/com/reedelk/file/component/FileRead.java +++ b/src/main/java/de/codecentric/reedelk/file/component/FileRead.java @@ -1,17 +1,18 @@ -package com.reedelk.file.component; - -import com.reedelk.file.internal.attribute.FileAttribute; -import com.reedelk.file.internal.exception.NotValidFileException; -import com.reedelk.file.internal.read.*; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.commons.MimeTypeUtils; -import com.reedelk.runtime.api.component.ProcessorSync; -import com.reedelk.runtime.api.flow.FlowContext; -import com.reedelk.runtime.api.message.Message; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.runtime.api.message.content.MimeType; -import com.reedelk.runtime.api.script.ScriptEngineService; -import com.reedelk.runtime.api.script.dynamicvalue.DynamicString; +package de.codecentric.reedelk.file.component; + +import de.codecentric.reedelk.file.internal.attribute.FileAttribute; +import de.codecentric.reedelk.file.internal.exception.NotValidFileException; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.commons.MimeTypeUtils; +import de.codecentric.reedelk.runtime.api.component.ProcessorSync; +import de.codecentric.reedelk.runtime.api.flow.FlowContext; +import de.codecentric.reedelk.runtime.api.message.Message; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.runtime.api.message.content.MimeType; +import de.codecentric.reedelk.runtime.api.script.ScriptEngineService; +import de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString; +import de.codecentric.reedelk.file.internal.commons.Messages; +import de.codecentric.reedelk.file.internal.read.*; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ServiceScope; @@ -20,8 +21,7 @@ import java.nio.file.Paths; import java.util.Optional; -import static com.reedelk.file.internal.commons.Messages.FileRead.FILE_NAME_ERROR; -import static com.reedelk.runtime.api.commons.StringUtils.isBlank; +import static de.codecentric.reedelk.runtime.api.commons.StringUtils.isBlank; @ModuleComponent("File Read") @ComponentOutput( @@ -115,7 +115,7 @@ public Message apply(FlowContext flowContext, Message message) { .attributes(attributes) .build(); - }).orElseThrow(() -> new NotValidFileException(FILE_NAME_ERROR.format(fileName.toString()))); + }).orElseThrow(() -> new NotValidFileException(Messages.FileRead.FILE_NAME_ERROR.format(fileName.toString()))); } public void setConfiguration(FileReadConfiguration configuration) { diff --git a/src/main/java/com/reedelk/file/component/FileReadConfiguration.java b/src/main/java/de/codecentric/reedelk/file/component/FileReadConfiguration.java similarity index 93% rename from src/main/java/com/reedelk/file/component/FileReadConfiguration.java rename to src/main/java/de/codecentric/reedelk/file/component/FileReadConfiguration.java index 61979ec..74de60c 100644 --- a/src/main/java/com/reedelk/file/component/FileReadConfiguration.java +++ b/src/main/java/de/codecentric/reedelk/file/component/FileReadConfiguration.java @@ -1,7 +1,7 @@ -package com.reedelk.file.component; +package de.codecentric.reedelk.file.component; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.component.Implementor; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.component.Implementor; import org.osgi.service.component.annotations.Component; import static org.osgi.service.component.annotations.ServiceScope.PROTOTYPE; diff --git a/src/main/java/com/reedelk/file/component/FileWrite.java b/src/main/java/de/codecentric/reedelk/file/component/FileWrite.java similarity index 71% rename from src/main/java/com/reedelk/file/component/FileWrite.java rename to src/main/java/de/codecentric/reedelk/file/component/FileWrite.java index 660f779..a313040 100644 --- a/src/main/java/com/reedelk/file/component/FileWrite.java +++ b/src/main/java/de/codecentric/reedelk/file/component/FileWrite.java @@ -1,20 +1,21 @@ -package com.reedelk.file.component; - -import com.reedelk.file.internal.attribute.FileAttribute; -import com.reedelk.file.internal.exception.FileWriteException; -import com.reedelk.file.internal.write.WriteConfiguration; -import com.reedelk.file.internal.write.WriteMode; -import com.reedelk.file.internal.write.Writer; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.component.OnResult; -import com.reedelk.runtime.api.component.ProcessorAsync; -import com.reedelk.runtime.api.converter.ConverterService; -import com.reedelk.runtime.api.exception.PlatformException; -import com.reedelk.runtime.api.flow.FlowContext; -import com.reedelk.runtime.api.message.Message; -import com.reedelk.runtime.api.message.content.TypedPublisher; -import com.reedelk.runtime.api.script.ScriptEngineService; -import com.reedelk.runtime.api.script.dynamicvalue.DynamicString; +package de.codecentric.reedelk.file.component; + +import de.codecentric.reedelk.file.internal.attribute.FileAttribute; +import de.codecentric.reedelk.file.internal.exception.FileWriteException; +import de.codecentric.reedelk.file.internal.write.WriteConfiguration; +import de.codecentric.reedelk.file.internal.write.WriteMode; +import de.codecentric.reedelk.file.internal.write.Writer; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.component.OnResult; +import de.codecentric.reedelk.runtime.api.component.ProcessorAsync; +import de.codecentric.reedelk.runtime.api.converter.ConverterService; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.runtime.api.flow.FlowContext; +import de.codecentric.reedelk.runtime.api.message.Message; +import de.codecentric.reedelk.runtime.api.message.content.TypedPublisher; +import de.codecentric.reedelk.runtime.api.script.ScriptEngineService; +import de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString; +import de.codecentric.reedelk.file.internal.commons.Messages; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ServiceScope; @@ -24,10 +25,8 @@ import java.nio.file.Paths; import java.util.Optional; -import static com.reedelk.file.internal.commons.Messages.FileWrite.ERROR_FILE_WRITE; -import static com.reedelk.file.internal.commons.Messages.FileWrite.ERROR_FILE_WRITE_WITH_PATH; -import static com.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; -import static com.reedelk.runtime.api.commons.StringUtils.isBlank; +import static de.codecentric.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; +import static de.codecentric.reedelk.runtime.api.commons.StringUtils.isBlank; @ModuleComponent("File Write") @ComponentOutput( @@ -103,8 +102,8 @@ public void apply(FlowContext flowContext, Message message, OnResult callback) { } catch (Exception exception) { String errorMessage = finalPath != null ? - ERROR_FILE_WRITE_WITH_PATH.format(finalPath.toString(), rootCauseMessageOf(exception)) : - ERROR_FILE_WRITE.format(rootCauseMessageOf(exception)); + Messages.FileWrite.ERROR_FILE_WRITE_WITH_PATH.format(finalPath.toString(), rootCauseMessageOf(exception)) : + Messages.FileWrite.ERROR_FILE_WRITE.format(rootCauseMessageOf(exception)); callback.onError(flowContext, new FileWriteException(errorMessage, exception)); } diff --git a/src/main/java/com/reedelk/file/component/FileWriteConfiguration.java b/src/main/java/de/codecentric/reedelk/file/component/FileWriteConfiguration.java similarity index 94% rename from src/main/java/com/reedelk/file/component/FileWriteConfiguration.java rename to src/main/java/de/codecentric/reedelk/file/component/FileWriteConfiguration.java index 016ae35..f9448a4 100644 --- a/src/main/java/com/reedelk/file/component/FileWriteConfiguration.java +++ b/src/main/java/de/codecentric/reedelk/file/component/FileWriteConfiguration.java @@ -1,7 +1,7 @@ -package com.reedelk.file.component; +package de.codecentric.reedelk.file.component; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.component.Implementor; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.component.Implementor; import org.osgi.service.component.annotations.Component; import static org.osgi.service.component.annotations.ServiceScope.PROTOTYPE; diff --git a/src/main/java/de/codecentric/reedelk/file/internal/attribute/FileAttribute.java b/src/main/java/de/codecentric/reedelk/file/internal/attribute/FileAttribute.java new file mode 100644 index 0000000..0099bed --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/file/internal/attribute/FileAttribute.java @@ -0,0 +1,22 @@ +package de.codecentric.reedelk.file.internal.attribute; + +import de.codecentric.reedelk.runtime.api.annotation.Type; +import de.codecentric.reedelk.runtime.api.annotation.TypeProperty; +import de.codecentric.reedelk.runtime.api.message.MessageAttributes; + +import static de.codecentric.reedelk.file.internal.attribute.FileAttribute.FILE_NAME; +import static de.codecentric.reedelk.file.internal.attribute.FileAttribute.TIMESTAMP; + +@Type +@TypeProperty(name = FILE_NAME, type = String.class) +@TypeProperty(name = TIMESTAMP, type = long.class) +public class FileAttribute extends MessageAttributes { + + static final String FILE_NAME = "fileName"; + static final String TIMESTAMP = "timestamp"; + + public FileAttribute(String fileName) { + put(FILE_NAME, fileName); + put(TIMESTAMP, System.currentTimeMillis()); + } +} diff --git a/src/main/java/com/reedelk/file/internal/commons/CloseableUtils.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/CloseableUtils.java similarity index 90% rename from src/main/java/com/reedelk/file/internal/commons/CloseableUtils.java rename to src/main/java/de/codecentric/reedelk/file/internal/commons/CloseableUtils.java index d6157f5..07b6cc9 100644 --- a/src/main/java/com/reedelk/file/internal/commons/CloseableUtils.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/CloseableUtils.java @@ -1,4 +1,4 @@ -package com.reedelk.file.internal.commons; +package de.codecentric.reedelk.file.internal.commons; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/reedelk/file/internal/commons/Defaults.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/Defaults.java similarity index 91% rename from src/main/java/com/reedelk/file/internal/commons/Defaults.java rename to src/main/java/de/codecentric/reedelk/file/internal/commons/Defaults.java index 6908aaa..6daa917 100644 --- a/src/main/java/com/reedelk/file/internal/commons/Defaults.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/Defaults.java @@ -1,4 +1,4 @@ -package com.reedelk.file.internal.commons; +package de.codecentric.reedelk.file.internal.commons; public class Defaults { diff --git a/src/main/java/com/reedelk/file/internal/commons/FileChannelProvider.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/FileChannelProvider.java similarity index 84% rename from src/main/java/com/reedelk/file/internal/commons/FileChannelProvider.java rename to src/main/java/de/codecentric/reedelk/file/internal/commons/FileChannelProvider.java index 7ecb1e6..76aaf7b 100644 --- a/src/main/java/com/reedelk/file/internal/commons/FileChannelProvider.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/FileChannelProvider.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.commons; +package de.codecentric.reedelk.file.internal.commons; -import com.reedelk.file.internal.exception.FileReadException; +import de.codecentric.reedelk.file.internal.exception.FileReadException; import java.io.IOException; import java.nio.channels.FileChannel; @@ -10,8 +10,8 @@ import java.nio.file.Path; import java.util.function.Supplier; -import static com.reedelk.file.internal.commons.Messages.FileRead.FILE_LOCK_ERROR; -import static com.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; +import static de.codecentric.reedelk.file.internal.commons.Messages.FileRead.FILE_LOCK_ERROR; +import static de.codecentric.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; public class FileChannelProvider { diff --git a/src/main/java/com/reedelk/file/internal/commons/FileOpenOptions.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/FileOpenOptions.java similarity index 91% rename from src/main/java/com/reedelk/file/internal/commons/FileOpenOptions.java rename to src/main/java/de/codecentric/reedelk/file/internal/commons/FileOpenOptions.java index b54be90..a1922a9 100644 --- a/src/main/java/com/reedelk/file/internal/commons/FileOpenOptions.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/FileOpenOptions.java @@ -1,4 +1,4 @@ -package com.reedelk.file.internal.commons; +package de.codecentric.reedelk.file.internal.commons; import java.nio.file.OpenOption; diff --git a/src/main/java/de/codecentric/reedelk/file/internal/commons/FileOperation.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/FileOperation.java new file mode 100644 index 0000000..422b638 --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/FileOperation.java @@ -0,0 +1,6 @@ +package de.codecentric.reedelk.file.internal.commons; + +public enum FileOperation { + READ, + WRITE +} diff --git a/src/main/java/de/codecentric/reedelk/file/internal/commons/LockType.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/LockType.java new file mode 100644 index 0000000..e24a704 --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/LockType.java @@ -0,0 +1,6 @@ +package de.codecentric.reedelk.file.internal.commons; + +public enum LockType { + LOCK, + NONE +} diff --git a/src/main/java/com/reedelk/file/internal/commons/Messages.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/Messages.java similarity index 94% rename from src/main/java/com/reedelk/file/internal/commons/Messages.java rename to src/main/java/de/codecentric/reedelk/file/internal/commons/Messages.java index 746336c..f9dc31a 100644 --- a/src/main/java/com/reedelk/file/internal/commons/Messages.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/Messages.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.commons; +package de.codecentric.reedelk.file.internal.commons; -import com.reedelk.runtime.api.commons.FormattedMessage; +import de.codecentric.reedelk.runtime.api.commons.FormattedMessage; public class Messages { diff --git a/src/main/java/com/reedelk/file/internal/commons/RetryCommand.java b/src/main/java/de/codecentric/reedelk/file/internal/commons/RetryCommand.java similarity index 91% rename from src/main/java/com/reedelk/file/internal/commons/RetryCommand.java rename to src/main/java/de/codecentric/reedelk/file/internal/commons/RetryCommand.java index 7029013..cf57153 100644 --- a/src/main/java/com/reedelk/file/internal/commons/RetryCommand.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/commons/RetryCommand.java @@ -1,8 +1,8 @@ -package com.reedelk.file.internal.commons; +package de.codecentric.reedelk.file.internal.commons; -import com.reedelk.file.internal.commons.Messages.Misc; -import com.reedelk.file.internal.exception.MaxRetriesExceeded; -import com.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.file.internal.commons.Messages.Misc; +import de.codecentric.reedelk.file.internal.exception.MaxRetriesExceeded; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; import java.util.function.Supplier; diff --git a/src/main/java/com/reedelk/file/internal/delete/FileDeleteAttribute.java b/src/main/java/de/codecentric/reedelk/file/internal/delete/FileDeleteAttribute.java similarity index 88% rename from src/main/java/com/reedelk/file/internal/delete/FileDeleteAttribute.java rename to src/main/java/de/codecentric/reedelk/file/internal/delete/FileDeleteAttribute.java index 52cc97f..58a7ed0 100644 --- a/src/main/java/com/reedelk/file/internal/delete/FileDeleteAttribute.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/delete/FileDeleteAttribute.java @@ -1,4 +1,4 @@ -package com.reedelk.file.internal.delete; +package de.codecentric.reedelk.file.internal.delete; import java.io.Serializable; import java.util.Map; diff --git a/src/main/java/com/reedelk/file/internal/exception/FileDeleteException.java b/src/main/java/de/codecentric/reedelk/file/internal/exception/FileDeleteException.java similarity index 58% rename from src/main/java/com/reedelk/file/internal/exception/FileDeleteException.java rename to src/main/java/de/codecentric/reedelk/file/internal/exception/FileDeleteException.java index 6f54092..f1aeae6 100644 --- a/src/main/java/com/reedelk/file/internal/exception/FileDeleteException.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/exception/FileDeleteException.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.exception; +package de.codecentric.reedelk.file.internal.exception; -import com.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; public class FileDeleteException extends PlatformException { diff --git a/src/main/java/com/reedelk/file/internal/exception/FileReadException.java b/src/main/java/de/codecentric/reedelk/file/internal/exception/FileReadException.java similarity index 57% rename from src/main/java/com/reedelk/file/internal/exception/FileReadException.java rename to src/main/java/de/codecentric/reedelk/file/internal/exception/FileReadException.java index ef54bb1..e0d103f 100644 --- a/src/main/java/com/reedelk/file/internal/exception/FileReadException.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/exception/FileReadException.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.exception; +package de.codecentric.reedelk.file.internal.exception; -import com.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; public class FileReadException extends PlatformException { diff --git a/src/main/java/com/reedelk/file/internal/exception/FileWriteException.java b/src/main/java/de/codecentric/reedelk/file/internal/exception/FileWriteException.java similarity index 57% rename from src/main/java/com/reedelk/file/internal/exception/FileWriteException.java rename to src/main/java/de/codecentric/reedelk/file/internal/exception/FileWriteException.java index be5a1a7..da7fceb 100644 --- a/src/main/java/com/reedelk/file/internal/exception/FileWriteException.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/exception/FileWriteException.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.exception; +package de.codecentric.reedelk.file.internal.exception; -import com.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; public class FileWriteException extends PlatformException { diff --git a/src/main/java/com/reedelk/file/internal/exception/MaxRetriesExceeded.java b/src/main/java/de/codecentric/reedelk/file/internal/exception/MaxRetriesExceeded.java similarity index 52% rename from src/main/java/com/reedelk/file/internal/exception/MaxRetriesExceeded.java rename to src/main/java/de/codecentric/reedelk/file/internal/exception/MaxRetriesExceeded.java index 467c6f9..d991f8e 100644 --- a/src/main/java/com/reedelk/file/internal/exception/MaxRetriesExceeded.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/exception/MaxRetriesExceeded.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.exception; +package de.codecentric.reedelk.file.internal.exception; -import com.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; public class MaxRetriesExceeded extends PlatformException { diff --git a/src/main/java/com/reedelk/file/internal/exception/NotValidFileException.java b/src/main/java/de/codecentric/reedelk/file/internal/exception/NotValidFileException.java similarity index 67% rename from src/main/java/com/reedelk/file/internal/exception/NotValidFileException.java rename to src/main/java/de/codecentric/reedelk/file/internal/exception/NotValidFileException.java index 2973879..881e5f7 100644 --- a/src/main/java/com/reedelk/file/internal/exception/NotValidFileException.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/exception/NotValidFileException.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.exception; +package de.codecentric.reedelk.file.internal.exception; -import com.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; public class NotValidFileException extends PlatformException { diff --git a/src/main/java/com/reedelk/file/internal/read/FileReadAttribute.java b/src/main/java/de/codecentric/reedelk/file/internal/read/FileReadAttribute.java similarity index 69% rename from src/main/java/com/reedelk/file/internal/read/FileReadAttribute.java rename to src/main/java/de/codecentric/reedelk/file/internal/read/FileReadAttribute.java index ec57974..a027d49 100644 --- a/src/main/java/com/reedelk/file/internal/read/FileReadAttribute.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/read/FileReadAttribute.java @@ -1,4 +1,4 @@ -package com.reedelk.file.internal.read; +package de.codecentric.reedelk.file.internal.read; public interface FileReadAttribute { String FILE_NAME = "readFileName"; diff --git a/src/main/java/com/reedelk/file/internal/read/ReadConfigurationDecorator.java b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadConfigurationDecorator.java similarity index 89% rename from src/main/java/com/reedelk/file/internal/read/ReadConfigurationDecorator.java rename to src/main/java/de/codecentric/reedelk/file/internal/read/ReadConfigurationDecorator.java index 57ee92d..102d4ff 100644 --- a/src/main/java/com/reedelk/file/internal/read/ReadConfigurationDecorator.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadConfigurationDecorator.java @@ -1,11 +1,11 @@ -package com.reedelk.file.internal.read; +package de.codecentric.reedelk.file.internal.read; -import com.reedelk.file.component.FileReadConfiguration; -import com.reedelk.file.internal.commons.LockType; +import de.codecentric.reedelk.file.component.FileReadConfiguration; +import de.codecentric.reedelk.file.internal.commons.LockType; import java.util.Optional; -import static com.reedelk.file.internal.commons.Defaults.FileRead.*; +import static de.codecentric.reedelk.file.internal.commons.Defaults.FileRead.*; public class ReadConfigurationDecorator { diff --git a/src/main/java/de/codecentric/reedelk/file/internal/read/ReadMode.java b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadMode.java new file mode 100644 index 0000000..47cf446 --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadMode.java @@ -0,0 +1,10 @@ +package de.codecentric.reedelk.file.internal.read; + +import de.codecentric.reedelk.runtime.api.annotation.DisplayName; + +public enum ReadMode { + @DisplayName("Default") + DEFAULT, + @DisplayName("Stream") + STREAM +} diff --git a/src/main/java/com/reedelk/file/internal/read/ReadStrategy.java b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategy.java similarity index 50% rename from src/main/java/com/reedelk/file/internal/read/ReadStrategy.java rename to src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategy.java index 6891bef..62664b2 100644 --- a/src/main/java/com/reedelk/file/internal/read/ReadStrategy.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategy.java @@ -1,7 +1,7 @@ -package com.reedelk.file.internal.read; +package de.codecentric.reedelk.file.internal.read; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.runtime.api.message.content.MimeType; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.runtime.api.message.content.MimeType; import java.nio.file.Path; diff --git a/src/main/java/com/reedelk/file/internal/read/ReadStrategyDefault.java b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategyDefault.java similarity index 83% rename from src/main/java/com/reedelk/file/internal/read/ReadStrategyDefault.java rename to src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategyDefault.java index 25a88fb..5c1ccbe 100644 --- a/src/main/java/com/reedelk/file/internal/read/ReadStrategyDefault.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategyDefault.java @@ -1,9 +1,10 @@ -package com.reedelk.file.internal.read; +package de.codecentric.reedelk.file.internal.read; -import com.reedelk.file.internal.commons.LockType; -import com.reedelk.file.internal.exception.FileReadException; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.runtime.api.message.content.MimeType; +import de.codecentric.reedelk.file.internal.commons.LockType; +import de.codecentric.reedelk.file.internal.exception.FileReadException; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.runtime.api.message.content.MimeType; +import de.codecentric.reedelk.file.internal.commons.Messages; import java.io.File; import java.io.IOException; @@ -13,8 +14,6 @@ import java.nio.channels.FileLock; import java.nio.file.Path; -import static com.reedelk.file.internal.commons.Messages.FileRead.FILE_READ_ERROR; - public class ReadStrategyDefault implements ReadStrategy { private static final String LOCK_MODE = "rw"; @@ -60,7 +59,7 @@ public void read(Path path, ReadConfigurationDecorator decorator, MessageBuilder } catch (IOException exception) { - String message = FILE_READ_ERROR.format(path, exception.getMessage()); + String message = Messages.FileRead.FILE_READ_ERROR.format(path, exception.getMessage()); throw new FileReadException(message, exception); diff --git a/src/main/java/com/reedelk/file/internal/read/ReadStrategyStream.java b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategyStream.java similarity index 71% rename from src/main/java/com/reedelk/file/internal/read/ReadStrategyStream.java rename to src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategyStream.java index f9dd3bc..7a2f4ee 100644 --- a/src/main/java/com/reedelk/file/internal/read/ReadStrategyStream.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/read/ReadStrategyStream.java @@ -1,13 +1,13 @@ -package com.reedelk.file.internal.read; - -import com.reedelk.file.internal.commons.FileChannelProvider; -import com.reedelk.file.internal.commons.FileOpenOptions; -import com.reedelk.file.internal.commons.FileOperation; -import com.reedelk.file.internal.exception.FileReadException; -import com.reedelk.file.internal.exception.MaxRetriesExceeded; -import com.reedelk.file.internal.exception.NotValidFileException; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.runtime.api.message.content.MimeType; +package de.codecentric.reedelk.file.internal.read; + +import de.codecentric.reedelk.file.internal.commons.FileChannelProvider; +import de.codecentric.reedelk.file.internal.commons.FileOpenOptions; +import de.codecentric.reedelk.file.internal.commons.FileOperation; +import de.codecentric.reedelk.file.internal.exception.FileReadException; +import de.codecentric.reedelk.file.internal.exception.MaxRetriesExceeded; +import de.codecentric.reedelk.file.internal.exception.NotValidFileException; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.runtime.api.message.content.MimeType; import reactor.core.publisher.Flux; import java.nio.ByteBuffer; @@ -17,11 +17,11 @@ import java.nio.file.OpenOption; import java.nio.file.Path; -import static com.reedelk.file.internal.commons.Messages.FileRead.FILE_IS_DIRECTORY; -import static com.reedelk.file.internal.commons.Messages.FileRead.FILE_READ_ERROR; -import static com.reedelk.file.internal.commons.Messages.Misc.FILE_LOCK_MAX_RETRY_ERROR; -import static com.reedelk.file.internal.commons.Messages.Misc.FILE_NOT_FOUND; -import static com.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; +import static de.codecentric.reedelk.file.internal.commons.Messages.FileRead.FILE_IS_DIRECTORY; +import static de.codecentric.reedelk.file.internal.commons.Messages.FileRead.FILE_READ_ERROR; +import static de.codecentric.reedelk.file.internal.commons.Messages.Misc.FILE_LOCK_MAX_RETRY_ERROR; +import static de.codecentric.reedelk.file.internal.commons.Messages.Misc.FILE_NOT_FOUND; +import static de.codecentric.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; public class ReadStrategyStream implements ReadStrategy { diff --git a/src/main/java/com/reedelk/file/internal/write/FileWriteAttribute.java b/src/main/java/de/codecentric/reedelk/file/internal/write/FileWriteAttribute.java similarity index 69% rename from src/main/java/com/reedelk/file/internal/write/FileWriteAttribute.java rename to src/main/java/de/codecentric/reedelk/file/internal/write/FileWriteAttribute.java index eaf5c0a..910eac7 100644 --- a/src/main/java/com/reedelk/file/internal/write/FileWriteAttribute.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/write/FileWriteAttribute.java @@ -1,4 +1,4 @@ -package com.reedelk.file.internal.write; +package de.codecentric.reedelk.file.internal.write; public interface FileWriteAttribute { String FILE_NAME = "writeFileName"; diff --git a/src/main/java/com/reedelk/file/internal/write/WriteConfiguration.java b/src/main/java/de/codecentric/reedelk/file/internal/write/WriteConfiguration.java similarity index 91% rename from src/main/java/com/reedelk/file/internal/write/WriteConfiguration.java rename to src/main/java/de/codecentric/reedelk/file/internal/write/WriteConfiguration.java index 2c65524..3ee4a86 100644 --- a/src/main/java/com/reedelk/file/internal/write/WriteConfiguration.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/write/WriteConfiguration.java @@ -1,11 +1,11 @@ -package com.reedelk.file.internal.write; +package de.codecentric.reedelk.file.internal.write; -import com.reedelk.file.internal.commons.LockType; -import com.reedelk.file.component.FileWriteConfiguration; +import de.codecentric.reedelk.file.internal.commons.LockType; +import de.codecentric.reedelk.file.component.FileWriteConfiguration; import java.util.Optional; -import static com.reedelk.file.internal.commons.Defaults.FileWrite.*; +import static de.codecentric.reedelk.file.internal.commons.Defaults.FileWrite.*; public class WriteConfiguration { diff --git a/src/main/java/com/reedelk/file/internal/write/WriteMode.java b/src/main/java/de/codecentric/reedelk/file/internal/write/WriteMode.java similarity index 89% rename from src/main/java/com/reedelk/file/internal/write/WriteMode.java rename to src/main/java/de/codecentric/reedelk/file/internal/write/WriteMode.java index 0e3626e..4945a33 100644 --- a/src/main/java/com/reedelk/file/internal/write/WriteMode.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/write/WriteMode.java @@ -1,6 +1,6 @@ -package com.reedelk.file.internal.write; +package de.codecentric.reedelk.file.internal.write; -import com.reedelk.runtime.api.annotation.DisplayName; +import de.codecentric.reedelk.runtime.api.annotation.DisplayName; import java.nio.file.OpenOption; import java.nio.file.StandardOpenOption; diff --git a/src/main/java/com/reedelk/file/internal/write/Writer.java b/src/main/java/de/codecentric/reedelk/file/internal/write/Writer.java similarity index 79% rename from src/main/java/com/reedelk/file/internal/write/Writer.java rename to src/main/java/de/codecentric/reedelk/file/internal/write/Writer.java index 8955f32..1d0595e 100644 --- a/src/main/java/com/reedelk/file/internal/write/Writer.java +++ b/src/main/java/de/codecentric/reedelk/file/internal/write/Writer.java @@ -1,17 +1,18 @@ -package com.reedelk.file.internal.write; - -import com.reedelk.file.component.FileWrite; -import com.reedelk.file.internal.attribute.FileAttribute; -import com.reedelk.file.internal.commons.CloseableUtils; -import com.reedelk.file.internal.commons.FileChannelProvider; -import com.reedelk.file.internal.exception.FileWriteException; -import com.reedelk.file.internal.exception.MaxRetriesExceeded; -import com.reedelk.file.internal.exception.NotValidFileException; -import com.reedelk.runtime.api.component.OnResult; -import com.reedelk.runtime.api.flow.FlowContext; -import com.reedelk.runtime.api.message.Message; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.runtime.api.message.content.TypedPublisher; +package de.codecentric.reedelk.file.internal.write; + +import de.codecentric.reedelk.file.component.FileWrite; +import de.codecentric.reedelk.file.internal.attribute.FileAttribute; +import de.codecentric.reedelk.file.internal.commons.CloseableUtils; +import de.codecentric.reedelk.file.internal.commons.FileChannelProvider; +import de.codecentric.reedelk.file.internal.exception.FileWriteException; +import de.codecentric.reedelk.file.internal.exception.MaxRetriesExceeded; +import de.codecentric.reedelk.file.internal.exception.NotValidFileException; +import de.codecentric.reedelk.runtime.api.component.OnResult; +import de.codecentric.reedelk.runtime.api.flow.FlowContext; +import de.codecentric.reedelk.runtime.api.message.Message; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.runtime.api.message.content.TypedPublisher; +import de.codecentric.reedelk.file.internal.commons.Messages; import reactor.core.Exceptions; import reactor.core.publisher.Flux; import reactor.core.scheduler.Schedulers; @@ -22,9 +23,7 @@ import java.nio.file.NoSuchFileException; import java.nio.file.Path; -import static com.reedelk.file.internal.commons.Messages.FileWrite.*; -import static com.reedelk.file.internal.commons.Messages.Misc.FILE_LOCK_MAX_RETRY_ERROR; -import static com.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; +import static de.codecentric.reedelk.runtime.api.commons.StackTraceUtils.rootCauseMessageOf; public class Writer { @@ -125,19 +124,19 @@ public void write(WriteConfiguration config, FlowContext flowContext, OnResult c private Exception mapException(Path path, Throwable throwable) { if (throwable instanceof NoSuchFileException) { - String message = ERROR_FILE_NOT_FOUND.format(path.toString()); + String message = Messages.FileWrite.ERROR_FILE_NOT_FOUND.format(path.toString()); return new NotValidFileException(message, throwable); } else if (throwable instanceof MaxRetriesExceeded) { - String message = FILE_LOCK_MAX_RETRY_ERROR.format(path.toString(), rootCauseMessageOf(throwable)); + String message = Messages.Misc.FILE_LOCK_MAX_RETRY_ERROR.format(path.toString(), rootCauseMessageOf(throwable)); return new FileWriteException(message, throwable); } else if (throwable instanceof FileAlreadyExistsException) { - String message = ERROR_FILE_WRITE_ALREADY_EXISTS.format(path.toString()); + String message = Messages.FileWrite.ERROR_FILE_WRITE_ALREADY_EXISTS.format(path.toString()); return new FileWriteException(message, throwable); } else { - String errorMessage = ERROR_FILE_WRITE_WITH_PATH.format(path.toString(), rootCauseMessageOf(throwable)); + String errorMessage = Messages.FileWrite.ERROR_FILE_WRITE_WITH_PATH.format(path.toString(), rootCauseMessageOf(throwable)); return new FileWriteException(errorMessage, throwable); } } diff --git a/src/main/resources/com.reedelk.file.component.FileDelete-icon.png b/src/main/resources/de.codecentric.reedelk.file.component.FileDelete-icon.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileDelete-icon.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileDelete-icon.png diff --git a/src/main/resources/com.reedelk.file.component.FileDelete.png b/src/main/resources/de.codecentric.reedelk.file.component.FileDelete.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileDelete.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileDelete.png diff --git a/src/main/resources/com.reedelk.file.component.FileExists-icon.png b/src/main/resources/de.codecentric.reedelk.file.component.FileExists-icon.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileExists-icon.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileExists-icon.png diff --git a/src/main/resources/com.reedelk.file.component.FileExists.png b/src/main/resources/de.codecentric.reedelk.file.component.FileExists.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileExists.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileExists.png diff --git a/src/main/resources/com.reedelk.file.component.FileRead-icon.png b/src/main/resources/de.codecentric.reedelk.file.component.FileRead-icon.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileRead-icon.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileRead-icon.png diff --git a/src/main/resources/com.reedelk.file.component.FileRead.png b/src/main/resources/de.codecentric.reedelk.file.component.FileRead.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileRead.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileRead.png diff --git a/src/main/resources/com.reedelk.file.component.FileWrite-icon.png b/src/main/resources/de.codecentric.reedelk.file.component.FileWrite-icon.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileWrite-icon.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileWrite-icon.png diff --git a/src/main/resources/com.reedelk.file.component.FileWrite.png b/src/main/resources/de.codecentric.reedelk.file.component.FileWrite.png similarity index 100% rename from src/main/resources/com.reedelk.file.component.FileWrite.png rename to src/main/resources/de.codecentric.reedelk.file.component.FileWrite.png diff --git a/src/main/resources/module-descriptor.json b/src/main/resources/module-descriptor.json index e220aa2..67ec983 100644 --- a/src/main/resources/module-descriptor.json +++ b/src/main/resources/module-descriptor.json @@ -1 +1 @@ -{"name":"module-file","displayName":"File Module","version":"1.0.6","components":[{"hidden":false,"displayName":"File Delete","description":"Deletes a file from the file system with the given File name. An error is raised if the given file could not be found. The file name can be a dynamic expression.","fullyQualifiedName":"com.reedelk.file.component.FileDelete","type":"PROCESSOR","input":{"description":"The input payload is used to evaluate the file name to delete.","payload":["java.lang.Object"]},"output":{"description":"The path and name of the deleted file.","dynamicPropertyName":"","payload":["java.lang.String"],"attributes":["com.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/sample.txt","description":"The path and name of the file to be deleted from the file system.\t","displayName":"File name","type":{"classname":"com.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"com.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]}]},{"hidden":false,"displayName":"File Exists","description":"The File Exists component Tests whether a file with the given path exists. The file path can be a text only or dynamic expression.","fullyQualifiedName":"com.reedelk.file.component.FileExists","type":"PROCESSOR","input":{"description":"The input payload is used to evaluate the file name to check for existence.","payload":["java.lang.Object"]},"output":{"description":"True if the file exists, false otherwise.","dynamicPropertyName":"","payload":["boolean"],"attributes":["com.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/log1.txt","description":"The path and name of the file to be checked for existence.","displayName":"File name","type":{"classname":"com.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"com.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]},{"mandatory":false,"name":"basePath","example":"/var/logs","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs","description":"Optional base path from which files with the given \u003ci\u003eFile name\u003c/i\u003e will be checked for existence. The final file will be checked from \u003ci\u003eBase Path\u003c/i\u003e + \u003ci\u003eFile Name\u003c/i\u003e.","displayName":"Base path","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"target","group":"Advanced","example":"myFileExists","initValue":"###USE_DEFAULT_VALUE###","hintValue":"myFileExists","description":"If the property is not empty, the result of the file exists check is assigned to the given context variable instead of the message payload.","displayName":"Target Variable","type":{"classname":"com.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"com.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]}]},{"hidden":false,"displayName":"File Read","description":"Reads a file from the file system from the given file name and optionally provided base path. The file read strategy determines if the file should be streamed from the file system or loaded into memory before continuing with the execution of the flow. The component can also be configured to acquire a lock before reading the file.","fullyQualifiedName":"com.reedelk.file.component.FileRead","type":"PROCESSOR","input":{"description":"The input payload is used to evaluate the file name to read.","payload":["java.lang.Object"]},"output":{"description":"The content of the file read from the file system from the given path and file name.","dynamicPropertyName":"","payload":["byte[]"],"attributes":["com.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/log1.txt","description":"The path and name of the file to be read from the file system.","displayName":"File name","type":{"classname":"com.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"com.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]},{"mandatory":false,"name":"basePath","example":"/var/logs","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs","description":"Optional base path from which files with the given \u003ci\u003eFile name\u003c/i\u003e will be read from. The final file will be read from \u003ci\u003eBase Path\u003c/i\u003e + \u003ci\u003eFile Name\u003c/i\u003e.","displayName":"Base path","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"mode","example":"STREAM","initValue":"DEFAULT","description":"Determines the read strategy. When \u003ci\u003eDefault\u003c/i\u003e the file is completely read into memory. When \u003ci\u003eStream\u003c/i\u003e the file is read only on demand only when the message payload is being consumed. This is the preferred method to read large files from the filesystem.","displayName":"Read mode","defaultValue":"DEFAULT","type":{"classname":"com.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"STREAM":"Stream","DEFAULT":"Default"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"autoMimeType","example":"false","initValue":"true","description":"If true, the mime type of the payload is determined from the extension of the file read.","displayName":"Auto mime type","defaultValue":"false","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"boolean"}},"whens":[]},{"mandatory":false,"name":"mimeType","example":"text/xml","initValue":"###USE_DEFAULT_VALUE###","description":"The mime type of the file read from the filesystem.","displayName":"Mime type","defaultValue":"application/octet-stream","type":{"classname":"com.reedelk.module.descriptor.model.property.ComboDescriptor","instance":{"editable":true,"prototype":"XXXXXXXXXXXXXXXXXXXXXXXXXX","comboValues":["text/css","text/html","text/plain","text/richtext","text/scriptlet","text/tab-separated-values","text/csv","text/webviewhtml","text/x-component","text/x-setext","text/x-vcard","text/xml","text/json","text/javascript","image/bmp","image/gif","image/png","image/jpeg","image/pipeg","image/svg+xml","image/tiff","image/x-cmu-raster","image/x-cmx","image/x-icon","image/x-portable-anymap","image/x-portable-bitmap","image/x-portable-graymap","image/x-portable-pixmap","image/x-rgb","image/x-xbitmap","image/x-xpixmap","image/x-xwindowdump","image/ief","message/rfc822","video/mpeg","video/mp4","video/quicktime","video/x-la-asf","video/x-ms-asf","video/x-msvideo","video/x-sgi-movie","audio/basic","audio/mid","audio/mpeg","audio/x-aiff","audio/x-mpegurl","audio/x-pn-realaudio","audio/x-wav","application/envoy","application/fractals","application/futuresplash","application/hta","application/msword","application/octet-stream","application/oda","application/olescript","application/pdf","application/pics-rules","application/pkcs10","application/pkix-crl","application/postscript","application/rtf","application/set-payment-initiation","application/set-registration-initiation","application/vnd.ms-excel","application/vnd.ms-outlook","application/vnd.ms-pkicertstore","application/vnd.ms-pkiseccat","application/vnd.ms-pkistl","application/vnd.ms-powerpoint","application/vnd.ms-project","application/vnd.ms-works","application/winhlp","application/x-bcpio","application/x-cdf","application/x-compress","application/x-compressed","application/x-cpio","application/x-csh","application/x-director","application/x-dvi","application/x-gtar","application/x-gzip","application/x-hdf","application/x-internet-signup","application/javascript","application/x-latex","application/x-msaccess","application/x-mscardfile","application/x-msclip","application/x-msdownload","application/x-msmediaview","application/x-msmetafile","application/x-msmoney","application/x-mspublisher","application/x-msschedule","application/x-msterminal","application/x-mswrite","application/x-netcdf","application/x-pkcs12","application/x-pkcs7-certificates","application/x-pkcs7-certreqresp","application/x-pkcs7-mime","application/x-pkcs7-signature","application/x-sh","application/x-shar","application/x-shockwave-flash","application/x-tar","application/x-x509-ca-cert","application/zip","application/atom+xml","application/rss+xml","application/xml","application/json","application/java","application/x-www-form-urlencoded","*/*","content/unknown","multipart/form-data"],"type":"com.reedelk.runtime.api.annotation.Combo"}},"whens":[{"propertyName":"autoMimeType","propertyValue":"false"},{"propertyName":"autoMimeType","propertyValue":"###BLANK###"}]},{"mandatory":false,"name":"configuration","group":"Configuration","initValue":"###USE_DEFAULT_VALUE###","displayName":"Configuration","type":{"classname":"com.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"NO","typeFullyQualifiedName":"com.reedelk.file.component.FileReadConfiguration","objectProperties":[{"mandatory":false,"name":"lockFile","example":"true","initValue":"###USE_DEFAULT_VALUE###","description":"If true a lock on the file is acquired before reading its content.","displayName":"Lock file","defaultValue":"false","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Boolean"}},"whens":[]},{"mandatory":false,"name":"lockRetryMaxAttempts","example":"7","initValue":"###USE_DEFAULT_VALUE###","hintValue":"5","description":"Sets the max lock attempts before throwing an error.","displayName":"Lock retry max attempts","defaultValue":"3","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"lockRetryWaitTime","example":"500","initValue":"###USE_DEFAULT_VALUE###","hintValue":"700","description":"Sets the wait time between two file lock attempts in milliseconds.","displayName":"Lock retry wait time (ms)","defaultValue":"500","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Long"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"readBufferSize","example":"1024","initValue":"###USE_DEFAULT_VALUE###","hintValue":"1024","description":"The buffer size used to read the files from filesystem. This parameter can be used to improve read performances. If the files are big the buffer size should be bigger, otherwise for very small files it should be kept smaller. The read buffer size is expressed in Kb and it can only be applied when the read mode strategy is \u0027Stream\u0027.","displayName":"Read buffer size","defaultValue":"1024","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[]}],"type":"com.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[]}]},{"hidden":false,"displayName":"File Write","description":"Writes a file to the file system to the given File name and optionally provided Base path. The write mode can be used to override an existing file, create new file if it does not exists or append to the existing file if exists already.","fullyQualifiedName":"com.reedelk.file.component.FileWrite","type":"PROCESSOR","input":{"description":"The data to be written on the file. The expected input is byte array or string.","payload":["byte[]","java.lang.String"]},"output":{"description":"","dynamicPropertyName":"","payload":["java.lang.Void"],"attributes":["com.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/log1.txt","description":"The path and name of the file to be written on the file system.","displayName":"File name","type":{"classname":"com.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"com.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]},{"mandatory":false,"name":"basePath","example":"/var/logs","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs","description":"Optional base path from which files with the given \u003ci\u003eFile name\u003c/i\u003e will be written to. The final file will be written into \u003ci\u003eBase Path\u003c/i\u003e + \u003ci\u003eFile Name\u003c/i\u003e.","displayName":"Base path","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"mode","example":"APPEND","initValue":"OVERWRITE","description":"Sets the file write mode. Possible values are \u003cb\u003eOVERWRITE\u003c/b\u003e, \u003cb\u003eCREATE_NEW\u003c/b\u003e, \u003cb\u003eAPPEND\u003c/b\u003e.","displayName":"Write mode","defaultValue":"OVERWRITE","type":{"classname":"com.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"OVERWRITE":"Overwrite","CREATE_NEW":"Create new","APPEND":"Append"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"configuration","group":"Configuration","initValue":"###USE_DEFAULT_VALUE###","displayName":"Configuration","type":{"classname":"com.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"YES","typeFullyQualifiedName":"com.reedelk.file.component.FileWriteConfiguration","objectProperties":[{"mandatory":false,"name":"createParentDirectory","example":"true","initValue":"###USE_DEFAULT_VALUE###","description":"If true, missing directories will be created on the filesystem before writing the file.","displayName":"Create directories","defaultValue":"false","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Boolean"}},"whens":[]},{"mandatory":false,"name":"lockFile","example":"true","initValue":"###USE_DEFAULT_VALUE###","description":"If true a lock on the file is acquired before writing the content.","displayName":"Lock file","defaultValue":"false","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Boolean"}},"whens":[]},{"mandatory":false,"name":"lockRetryMaxAttempts","example":"5","initValue":"###USE_DEFAULT_VALUE###","hintValue":"3","description":"Sets the max lock attempts before throwing an error.","displayName":"Lock retry max attempts","defaultValue":"3","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"lockRetryWaitTime","example":"600","initValue":"###USE_DEFAULT_VALUE###","hintValue":"500","description":"Sets the wait time (in milliseconds) between two file lock attempts.","displayName":"Lock retry wait time (ms)","defaultValue":"500","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Long"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"writeBufferSize","example":"524288","initValue":"###USE_DEFAULT_VALUE###","hintValue":"65536","description":"The buffer size used to write the files to filesystem. This parameter can be used to improve write performances. If the files are big the buffer size should be bigger, otherwise for very small files it should be kept smaller.","displayName":"Write buffer size","defaultValue":"65536","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[]}],"type":"com.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[]}]}],"types":[{"global":false,"type":"com.reedelk.file.internal.attribute.FileAttribute","extendsType":"com.reedelk.runtime.api.message.MessageAttributes","description":"","mapKeyType":"java.lang.Object","mapValueType":"java.lang.Object","functions":[],"properties":[{"name":"fileName","type":"java.lang.String","example":"","description":""},{"name":"timestamp","type":"long","example":"","description":""}]}]} \ No newline at end of file +{"name":"module-file","displayName":"File Module","version":"1.1.0","components":[{"hidden":false,"displayName":"File Delete","description":"Deletes a file from the file system with the given File name. An error is raised if the given file could not be found. The file name can be a dynamic expression.","fullyQualifiedName":"de.codecentric.reedelk.file.component.FileDelete","type":"PROCESSOR","input":{"description":"The input payload is used to evaluate the file name to delete.","payload":["java.lang.Object"]},"output":{"description":"The path and name of the deleted file.","dynamicPropertyName":"","payload":["java.lang.String"],"attributes":["de.codecentric.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/sample.txt","description":"The path and name of the file to be deleted from the file system.\t","displayName":"File name","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]}]},{"hidden":false,"displayName":"File Exists","description":"The File Exists component Tests whether a file with the given path exists. The file path can be a text only or dynamic expression.","fullyQualifiedName":"de.codecentric.reedelk.file.component.FileExists","type":"PROCESSOR","input":{"description":"The input payload is used to evaluate the file name to check for existence.","payload":["java.lang.Object"]},"output":{"description":"True if the file exists, false otherwise.","dynamicPropertyName":"","payload":["boolean"],"attributes":["de.codecentric.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/log1.txt","description":"The path and name of the file to be checked for existence.","displayName":"File name","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]},{"mandatory":false,"name":"basePath","example":"/var/logs","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs","description":"Optional base path from which files with the given \u003ci\u003eFile name\u003c/i\u003e will be checked for existence. The final file will be checked from \u003ci\u003eBase Path\u003c/i\u003e + \u003ci\u003eFile Name\u003c/i\u003e.","displayName":"Base path","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"target","group":"Advanced","example":"myFileExists","initValue":"###USE_DEFAULT_VALUE###","hintValue":"myFileExists","description":"If the property is not empty, the result of the file exists check is assigned to the given context variable instead of the message payload.","displayName":"Target Variable","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]}]},{"hidden":false,"displayName":"File Read","description":"Reads a file from the file system from the given file name and optionally provided base path. The file read strategy determines if the file should be streamed from the file system or loaded into memory before continuing with the execution of the flow. The component can also be configured to acquire a lock before reading the file.","fullyQualifiedName":"de.codecentric.reedelk.file.component.FileRead","type":"PROCESSOR","input":{"description":"The input payload is used to evaluate the file name to read.","payload":["java.lang.Object"]},"output":{"description":"The content of the file read from the file system from the given path and file name.","dynamicPropertyName":"","payload":["byte[]"],"attributes":["de.codecentric.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/log1.txt","description":"The path and name of the file to be read from the file system.","displayName":"File name","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]},{"mandatory":false,"name":"basePath","example":"/var/logs","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs","description":"Optional base path from which files with the given \u003ci\u003eFile name\u003c/i\u003e will be read from. The final file will be read from \u003ci\u003eBase Path\u003c/i\u003e + \u003ci\u003eFile Name\u003c/i\u003e.","displayName":"Base path","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"mode","example":"STREAM","initValue":"DEFAULT","description":"Determines the read strategy. When \u003ci\u003eDefault\u003c/i\u003e the file is completely read into memory. When \u003ci\u003eStream\u003c/i\u003e the file is read only on demand only when the message payload is being consumed. This is the preferred method to read large files from the filesystem.","displayName":"Read mode","defaultValue":"DEFAULT","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"STREAM":"Stream","DEFAULT":"Default"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"autoMimeType","example":"false","initValue":"true","description":"If true, the mime type of the payload is determined from the extension of the file read.","displayName":"Auto mime type","defaultValue":"false","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"boolean"}},"whens":[]},{"mandatory":false,"name":"mimeType","example":"text/xml","initValue":"###USE_DEFAULT_VALUE###","description":"The mime type of the file read from the filesystem.","displayName":"Mime type","defaultValue":"application/octet-stream","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.ComboDescriptor","instance":{"editable":true,"prototype":"XXXXXXXXXXXXXXXXXXXXXXXXXX","comboValues":["text/css","text/html","text/plain","text/richtext","text/scriptlet","text/tab-separated-values","text/csv","text/webviewhtml","text/x-component","text/x-setext","text/x-vcard","text/xml","text/json","text/javascript","image/bmp","image/gif","image/png","image/jpeg","image/pipeg","image/svg+xml","image/tiff","image/x-cmu-raster","image/x-cmx","image/x-icon","image/x-portable-anymap","image/x-portable-bitmap","image/x-portable-graymap","image/x-portable-pixmap","image/x-rgb","image/x-xbitmap","image/x-xpixmap","image/x-xwindowdump","image/ief","message/rfc822","video/mpeg","video/mp4","video/quicktime","video/x-la-asf","video/x-ms-asf","video/x-msvideo","video/x-sgi-movie","audio/basic","audio/mid","audio/mpeg","audio/x-aiff","audio/x-mpegurl","audio/x-pn-realaudio","audio/x-wav","application/envoy","application/fractals","application/futuresplash","application/hta","application/msword","application/octet-stream","application/oda","application/olescript","application/pdf","application/pics-rules","application/pkcs10","application/pkix-crl","application/postscript","application/rtf","application/set-payment-initiation","application/set-registration-initiation","application/vnd.ms-excel","application/vnd.ms-outlook","application/vnd.ms-pkicertstore","application/vnd.ms-pkiseccat","application/vnd.ms-pkistl","application/vnd.ms-powerpoint","application/vnd.ms-project","application/vnd.ms-works","application/winhlp","application/x-bcpio","application/x-cdf","application/x-compress","application/x-compressed","application/x-cpio","application/x-csh","application/x-director","application/x-dvi","application/x-gtar","application/x-gzip","application/x-hdf","application/x-internet-signup","application/javascript","application/x-latex","application/x-msaccess","application/x-mscardfile","application/x-msclip","application/x-msdownload","application/x-msmediaview","application/x-msmetafile","application/x-msmoney","application/x-mspublisher","application/x-msschedule","application/x-msterminal","application/x-mswrite","application/x-netcdf","application/x-pkcs12","application/x-pkcs7-certificates","application/x-pkcs7-certreqresp","application/x-pkcs7-mime","application/x-pkcs7-signature","application/x-sh","application/x-shar","application/x-shockwave-flash","application/x-tar","application/x-x509-ca-cert","application/zip","application/atom+xml","application/rss+xml","application/xml","application/json","application/java","application/x-www-form-urlencoded","*/*","content/unknown","multipart/form-data"],"type":"de.codecentric.reedelk.runtime.api.annotation.Combo"}},"whens":[{"propertyName":"autoMimeType","propertyValue":"false"},{"propertyName":"autoMimeType","propertyValue":"###BLANK###"}]},{"mandatory":false,"name":"configuration","group":"Configuration","initValue":"###USE_DEFAULT_VALUE###","displayName":"Configuration","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"NO","typeFullyQualifiedName":"de.codecentric.reedelk.file.component.FileReadConfiguration","objectProperties":[{"mandatory":false,"name":"lockFile","example":"true","initValue":"###USE_DEFAULT_VALUE###","description":"If true a lock on the file is acquired before reading its content.","displayName":"Lock file","defaultValue":"false","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Boolean"}},"whens":[]},{"mandatory":false,"name":"lockRetryMaxAttempts","example":"7","initValue":"###USE_DEFAULT_VALUE###","hintValue":"5","description":"Sets the max lock attempts before throwing an error.","displayName":"Lock retry max attempts","defaultValue":"3","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"lockRetryWaitTime","example":"500","initValue":"###USE_DEFAULT_VALUE###","hintValue":"700","description":"Sets the wait time between two file lock attempts in milliseconds.","displayName":"Lock retry wait time (ms)","defaultValue":"500","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Long"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"readBufferSize","example":"1024","initValue":"###USE_DEFAULT_VALUE###","hintValue":"1024","description":"The buffer size used to read the files from filesystem. This parameter can be used to improve read performances. If the files are big the buffer size should be bigger, otherwise for very small files it should be kept smaller. The read buffer size is expressed in Kb and it can only be applied when the read mode strategy is \u0027Stream\u0027.","displayName":"Read buffer size","defaultValue":"1024","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[]}],"type":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[]}]},{"hidden":false,"displayName":"File Write","description":"Writes a file to the file system to the given File name and optionally provided Base path. The write mode can be used to override an existing file, create new file if it does not exists or append to the existing file if exists already.","fullyQualifiedName":"de.codecentric.reedelk.file.component.FileWrite","type":"PROCESSOR","input":{"description":"The data to be written on the file. The expected input is byte array or string.","payload":["byte[]","java.lang.String"]},"output":{"description":"","dynamicPropertyName":"","payload":["java.lang.Void"],"attributes":["de.codecentric.reedelk.file.internal.attribute.FileAttribute"]},"properties":[{"mandatory":false,"name":"fileName","example":"/var/logs/log1.txt","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs/log1.txt","description":"The path and name of the file to be written on the file system.","displayName":"File name","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.DynamicValueDescriptor","instance":{"type":"de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString"}},"whens":[]},{"mandatory":false,"name":"basePath","example":"/var/logs","initValue":"###USE_DEFAULT_VALUE###","hintValue":"/var/logs","description":"Optional base path from which files with the given \u003ci\u003eFile name\u003c/i\u003e will be written to. The final file will be written into \u003ci\u003eBase Path\u003c/i\u003e + \u003ci\u003eFile Name\u003c/i\u003e.","displayName":"Base path","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"mode","example":"APPEND","initValue":"OVERWRITE","description":"Sets the file write mode. Possible values are \u003cb\u003eOVERWRITE\u003c/b\u003e, \u003cb\u003eCREATE_NEW\u003c/b\u003e, \u003cb\u003eAPPEND\u003c/b\u003e.","displayName":"Write mode","defaultValue":"OVERWRITE","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"OVERWRITE":"Overwrite","CREATE_NEW":"Create new","APPEND":"Append"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"configuration","group":"Configuration","initValue":"###USE_DEFAULT_VALUE###","displayName":"Configuration","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"YES","typeFullyQualifiedName":"de.codecentric.reedelk.file.component.FileWriteConfiguration","objectProperties":[{"mandatory":false,"name":"createParentDirectory","example":"true","initValue":"###USE_DEFAULT_VALUE###","description":"If true, missing directories will be created on the filesystem before writing the file.","displayName":"Create directories","defaultValue":"false","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Boolean"}},"whens":[]},{"mandatory":false,"name":"lockFile","example":"true","initValue":"###USE_DEFAULT_VALUE###","description":"If true a lock on the file is acquired before writing the content.","displayName":"Lock file","defaultValue":"false","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Boolean"}},"whens":[]},{"mandatory":false,"name":"lockRetryMaxAttempts","example":"5","initValue":"###USE_DEFAULT_VALUE###","hintValue":"3","description":"Sets the max lock attempts before throwing an error.","displayName":"Lock retry max attempts","defaultValue":"3","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"lockRetryWaitTime","example":"600","initValue":"###USE_DEFAULT_VALUE###","hintValue":"500","description":"Sets the wait time (in milliseconds) between two file lock attempts.","displayName":"Lock retry wait time (ms)","defaultValue":"500","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Long"}},"whens":[{"propertyName":"lockFile","propertyValue":"true"}]},{"mandatory":false,"name":"writeBufferSize","example":"524288","initValue":"###USE_DEFAULT_VALUE###","hintValue":"65536","description":"The buffer size used to write the files to filesystem. This parameter can be used to improve write performances. If the files are big the buffer size should be bigger, otherwise for very small files it should be kept smaller.","displayName":"Write buffer size","defaultValue":"65536","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.Integer"}},"whens":[]}],"type":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[]}]}],"types":[{"global":false,"type":"de.codecentric.reedelk.file.internal.attribute.FileAttribute","extendsType":"de.codecentric.reedelk.runtime.api.message.MessageAttributes","description":"","mapKeyType":"java.lang.Object","mapValueType":"java.lang.Object","functions":[],"properties":[{"name":"fileName","type":"java.lang.String","example":"","description":""},{"name":"timestamp","type":"long","example":"","description":""}]}]} \ No newline at end of file