Legacy Knowledge Base
Published Jul. 2, 2025

How to implement a custom antivirus scanner

Written By

Sorin Pop

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

Environment

  • DXP 7.3

Resolution

  • You need to create a war hook (here's an article on war hooks: https://help.liferay.com/hc/en-us/articles/360018170611-WAR-Hook-Template)
  • Don't put any antivirus-specific properties in your portal-ext.properties file (the war-hook module will contain the necessary properties)
  • Please find attached such a war hook proof-of-concept, which you can test with these steps:

                  1. Start your 7.3 fp1 server and wait until it is fully up.
                  2. Copy the my-war-hook.war app to your deploy folder.
                  3. Log in to the server and try to upload a file to documents and media.
                  Result:
                  The console log should show you:

2021-06-10 18:09:05.396 INFO  [fileinstall-directory-watcher][BundleStartStopLogger:46] STARTED my-war-hook_7.3.10.1 [1651]
* antivirus scanner works: This is the scan file method *

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base