Community moderators have prevented the ability to post new answers.
It's not possible to interact with the Confluence Java API unless your code is executing directly within the running Confluence process. This is because much of our API depends on the Spring container's configuration and a direct connection to the database (your process will have neither of these things!)
To interact with Confluence remotely (ie. in a different process), you need to use the Confluence Remote API, sending messages to and from Confluence over HTTP.
Bob's Confluence CLI project can definitely help making it easier to interact with this API.
Confluence Command Line Interface getAttachmentList should do what you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.