Build package programmatically | Community
Skip to main content
ronnyfm
Level 4
Jan 2, 2017 8:31 PM UTC
Solved

Build package programmatically

Hello,

I am able to assemble a package using the JcrPackageManager assemble method, however in the package manager I get the package definition and the filters, but the package itself needs to be built. I am sure there should be a way, since it is possible via the HTTP interface using curl.

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ronnyfm
ronnyfmAccepted solution
Level 4
Jan 3, 2017 2:54 PM UTC

Found the issue, I was calling:

assemble(JcrPackageDefinition definition, ProgressTrackerListener listener, java.io.OutputStream out)

But that writes the file to the output stream requiring therefore an additional build step. The solution was to invoke:

assemble(JcrPackage pack, ProgressTrackerListener listener)

Thanks all for your time.

13 replies

smacdonald2008
Level 10
Jan 2, 2017 10:17 PM UTC

Looking at the Javadoc - it does not appear that there is a method of to build -- 

https://docs.adobe.com/docs/en/cq/5-5/javadoc/com/day/jcr/vault/packaging/JcrPackageManager.html

Translate