com.sap.cds
cds-adapter-odata-v4
diff --git a/samples/bookshop/srv/src/main/java/customer/bookshop/handlers/MalwareScanRestHandler.java b/samples/bookshop/srv/src/main/java/customer/bookshop/handlers/MalwareScanRestHandler.java
new file mode 100644
index 000000000..bdcda325d
--- /dev/null
+++ b/samples/bookshop/srv/src/main/java/customer/bookshop/handlers/MalwareScanRestHandler.java
@@ -0,0 +1,98 @@
+package customer.bookshop.handlers;
+
+import com.sap.cds.feature.attachments.service.MalwareScannerService;
+import com.sap.cds.feature.attachments.service.malware.client.MalwareScanResultStatus;
+import jakarta.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * REST Controller demonstrating the standalone {@link MalwareScannerService} introduced in
+ * cds-feature-attachments 1.6.0.
+ *
+ * The malware scanner is decoupled from attachment storage: any content can be scanned by
+ * injecting {@link MalwareScannerService} from the CAP service catalog and calling {@code
+ * scanContent(InputStream)}. No attachment entity, composition, or CDS model changes are required.
+ *
+ *
+ * - {@code POST /api/v1/malware/scan} — raw request body
+ *
- {@code POST /api/v1/malware/scan/upload} — multipart/form-data with {@code file} field
+ *
+ *
+ * Response body: {@code {"status": "CLEAN" | "INFECTED" | "ENCRYPTED" | "NO_SCANNER" | "FAILED"}}.
+ *
+ * When no {@code malware-scanner} service binding is available the response is {@code
+ * NO_SCANNER}. To get real scan results, bind the SAP Malware Scanning Service via {@code cds bind
+ * malware-scanner -2 :} and restart in hybrid mode.
+ */
+@RestController
+@RequestMapping("/api/v1/malware")
+public class MalwareScanRestHandler {
+
+ private static final Logger logger = LoggerFactory.getLogger(MalwareScanRestHandler.class);
+
+ @Autowired
+ private MalwareScannerService malwareScannerService;
+
+ /**
+ * Scans a raw request body for malware.
+ *
+ * Example: {@code curl -u admin:admin -X POST --data-binary @somefile.pdf
+ * http://localhost:8080/api/v1/malware/scan}
+ */
+ @PostMapping("/scan")
+ public ResponseEntity