generated from camunda-community-hub/zeebe-worker-java-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
372 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
464 changes: 244 additions & 220 deletions
464
src/main/java/io/camunda/cherry/admin/RunnerRestController.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package io.camunda.cherry.admin; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.zip.ZipEntry; | ||
import java.util.zip.ZipOutputStream; | ||
|
||
public class ZipOperation { | ||
|
||
ByteArrayOutputStream zipContent; | ||
ZipOutputStream zipOut; | ||
String fileName; | ||
|
||
public ZipOperation(String zipFileName) { | ||
zipContent = new ByteArrayOutputStream(); | ||
zipOut = new ZipOutputStream(zipContent); | ||
fileName = zipFileName; | ||
} | ||
|
||
/** | ||
* Add a file in the Zip | ||
* @param fileName file name | ||
* @param content content to add | ||
* @throws IOException in case of error | ||
*/ | ||
public void addZipContent(String fileName, String content) throws IOException { | ||
ZipEntry zipEntry = new ZipEntry(fileName); | ||
zipOut.putNextEntry(zipEntry); | ||
byte[] contentByte = content.getBytes(StandardCharsets.UTF_8); | ||
|
||
zipOut.write(contentByte, 0, contentByte.length); | ||
} | ||
|
||
public void close() throws IOException { | ||
zipOut.close(); | ||
} | ||
|
||
public InputStream getInputStream() { | ||
return new ByteArrayInputStream(zipContent.toByteArray()); | ||
} | ||
|
||
public byte[] getBytes() { | ||
return zipContent.toByteArray(); | ||
} | ||
|
||
public String getFileName() { | ||
return fileName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
src/test/resources/connectorworker/PingObjectConnector.bpmn
Large diffs are not rendered by default.
Oops, something went wrong.