How To Use Openlegacy File (Meili) Connector
Step By Step Guide.
Create a new SDK project and select File Connector as a backend and click
Next
.Specify the
Base Path
to which folder we want to save a file, and specifyFile Name Pattern
, you can decide whether or not produce a file, and clickFinish
.Right-Click on
XSD
fileOpenLegacy
->Generate Model XSD
.Give your model a name, mark
Generate JUnit Test,
and clickOK
.Test the file connector:
Right Click on generated JUnit test and clickRun As
→JUnit Test
.After the JUnit test complete, go to the path we set in step 2 and you should see a generated XML file, open the file and validate that attribute has been added to the root level element.
Instead of saving the file, you can get a byte[] by following the next simple steps:
Go to application.yml
Set the property save-file to false
save-file: false
.Run the test/ API again.
At the console log response, you'll receive a field name
content
with the file’s byte[] value.
Note: whether you producing the file or not you will receive the byte[] in the response.