Skip to main content

io.enterpriseai.resources.FileSecurityClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/FileSecurityClient.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class FileSecurityClient​

File security (/v1/file-security): ClamAV and YARA-X engine status, tenant policy, explicit scans without ingestion, rescans, sample purge and stats. Every file is quarantined, scanned by both engines and only released when clean; the locked rules of the policy can never be changed.

Constructor FileSecurityClient​

FileSecurityClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

FileSecurityClient.getScan​

JsonNode getScan(String scanId)

Get a scan record. One scan record: status, verdict, reasons, source and its reference, file name, declared and detected type, size, SHA-256, answer of each engine, whether a sample is kept, the scan it rescans, creator and dates (creation, scan, sample expiry). Requires a tenant principal; a record of someone else is visible only to tenant_admin, security_officer and auditor (404 not_found otherwise).

Route: /v1/file-security/scans/{scan_id} (GET).

NameTypeDefaultRequiredDescription
scanIdStringyesIdentifier of the scan record.

Returns: JsonNode. Decoded JSON answer of the operation "Get a scan record".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.listScans​

Page<JsonNode> listScans()

List the scan records. Scan records of the tenant, newest first; a principal without a reader role (tenant_admin, security_officer, auditor) only sees its own scans. Requires a tenant principal. An unknown status, verdict or source answers 400 invalid_request; a malformed cursor 400 invalid_cursor.

Route: /v1/file-security/scans (GET).

This element takes no parameter.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

FileSecurityClient.listScans​

Page<JsonNode> listScans(Map<String, ?> query)

List the scan records. Scan records of the tenant, newest first; a principal without a reader role (tenant_admin, security_officer, auditor) only sees its own scans. Requires a tenant principal. An unknown status, verdict or source answers 400 invalid_request; a malformed cursor 400 invalid_cursor.

Route: /v1/file-security/scans (GET).

NameTypeDefaultRequiredDescription
queryMap<String, ?>yesQuery string parameters of the route.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

FileSecurityClient.policy​

JsonNode policy()

Read the file security policy. Effective policy of the tenant: the locked rules, every editable rule (stored values over the defaults, the size never above the platform ceiling EAI_FILE_SCAN_MAX_BYTES), the known file types, and when and by whom it was last changed. Requires a tenant principal with tenant_admin, security_officer or auditor (403 forbidden).

Route: /v1/file-security/policy (GET).

This element takes no parameter.

Returns: JsonNode. Decoded JSON answer of the operation "Read the file security policy".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.purgeSample​

JsonNode purgeSample(String scanId)

Purge the sample of a blocked file. Deletes the encrypted sample of a blocked file now, without waiting for the end of its retention, and answers sample_retained: false. The purge is audited (file_security.sample.purge) with the SHA-256 of the file. Requires a tenant principal with security_officer or tenant_admin (403 forbidden). A scan that is unknown or not visible to the caller answers 404 not_found.

Route: /v1/file-security/scans/{scan_id}/sample (DELETE).

NameTypeDefaultRequiredDescription
scanIdStringyesIdentifier of the scan record.

Returns: JsonNode. Decoded JSON answer of the operation "Purge the sample of a blocked file".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.rescan​

JsonNode rescan(String scanId)

Rescan the sample of a blocked file. Scans the retained sample of a blocked file again, for example after a signature update, and answers 201 with a new record whose rescan_of names the original scan. The original upload is never released: a clean result only informs. Requires a tenant principal with security_officer or tenant_admin (403 forbidden). Without a retained sample: 409 file_sample_unavailable; unknown or invisible scan: 404 not_found.

Route: /v1/file-security/scans/{scan_id}/rescan (POST).

NameTypeDefaultRequiredDescription
scanIdStringyesIdentifier of the blocked scan record whose sample is scanned again.

Returns: JsonNode. Decoded JSON answer of the operation "Rescan the sample of a blocked file".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.rescan​

JsonNode rescan(String scanId, RequestOptions options)

Rescan the sample of a blocked file. Scans the retained sample of a blocked file again, for example after a signature update, and answers 201 with a new record whose rescan_of names the original scan. The original upload is never released: a clean result only informs. Requires a tenant principal with security_officer or tenant_admin (403 forbidden). Without a retained sample: 409 file_sample_unavailable; unknown or invisible scan: 404 not_found.

Route: /v1/file-security/scans/{scan_id}/rescan (POST).

NameTypeDefaultRequiredDescription
scanIdStringyesIdentifier of the blocked scan record whose sample is scanned again.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Rescan the sample of a blocked file".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.scan​

JsonNode scan(byte[] data)

Scan a file without ingesting it. Scans a file without ingesting it and answers 201 with the record, released or blocked (a blocked file is not an error here). Any tenant principal may call it (403 tenant_required otherwise).

Route: /v1/file-security/scans (POST).

NameTypeDefaultRequiredDescription
databyte[]yesEither JSON {content_base64, filename?, mime_type?} or multipart/form-data with a file part and the optional filename and mime_type fields (they override the values of the part).

Returns: JsonNode. Decoded JSON answer of the operation "Scan a file without ingesting it".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.scan​

JsonNode scan(byte[] data, String filename, String mimeType)

Scan a file without ingesting it. Scans a file without ingesting it and answers 201 with the record, released or blocked (a blocked file is not an error here). Any tenant principal may call it (403 tenant_required otherwise).

Route: /v1/file-security/scans (POST).

NameTypeDefaultRequiredDescription
databyte[]yesEither JSON {content_base64, filename?, mime_type?} or multipart/form-data with a file part and the optional filename and mime_type fields (they override the values of the part).
filenameStringyesName of the scanned file, kept in the scan record.
mimeTypeStringyesMedia type of the content, for example application/pdf or image/png.

Returns: JsonNode. Decoded JSON answer of the operation "Scan a file without ingesting it".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.scan​

JsonNode scan(byte[] data, String filename, String mimeType, RequestOptions options)

Scan a file without ingesting it. Scans a file without ingesting it and answers 201 with the record, released or blocked (a blocked file is not an error here). Any tenant principal may call it (403 tenant_required otherwise).

Route: /v1/file-security/scans (POST).

NameTypeDefaultRequiredDescription
databyte[]yesEither JSON {content_base64, filename?, mime_type?} or multipart/form-data with a file part and the optional filename and mime_type fields (they override the values of the part).
filenameStringyesName of the scanned file, kept in the scan record.
mimeTypeStringyesMedia type of the content, for example application/pdf or image/png.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Scan a file without ingesting it".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.stats​

JsonNode stats()

Read the scan statistics. Number of scans over the last window_hours hours, by status, by verdict and by source, with the time of the last blocked file. Readers (tenant_admin, security_officer, auditor) count every scan of the tenant, anyone else only its own. Requires a tenant principal. A window outside 1 to 8784 hours answers 400 invalid_request.

Route: /v1/file-security/stats (GET).

This element takes no parameter.

Returns: JsonNode. Decoded JSON answer of the operation "Read the scan statistics".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.stats​

JsonNode stats(Map<String, ?> query)

Read the scan statistics. Number of scans over the last window_hours hours, by status, by verdict and by source, with the time of the last blocked file. Readers (tenant_admin, security_officer, auditor) count every scan of the tenant, anyone else only its own. Requires a tenant principal. A window outside 1 to 8784 hours answers 400 invalid_request.

Route: /v1/file-security/stats (GET).

NameTypeDefaultRequiredDescription
queryMap<String, ?>yesQuery string parameters of the route.

Returns: JsonNode. Decoded JSON answer of the operation "Read the scan statistics".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.status​

JsonNode status()

Read the scan engines status. Mode (enforce or dev), readiness, pipeline and every ClamAV gateway and YARA-X worker, probed live: version, signature version, publication and age with a stale flag against the policy, rules version, hash, count and load time, latency. The instance is ready when each engine has at least one healthy endpoint (in enforce mode, or when it is configured). Requires tenant_admin, security_officer or auditor (403 forbidden).

Route: /v1/file-security/status (GET).

This element takes no parameter.

Returns: JsonNode. Decoded JSON answer of the operation "Read the scan engines status".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.updatePolicy​

JsonNode updatePolicy(Map<String, ?> fields)

Change the file security policy. Changes the editable rules given in the body; the other rules keep their value. Sizes may only be tighter than the platform ceiling, and the locked rules never change (422 file_security_rule_locked). An unknown field, an unknown type or a value out of bounds answers 422 invalid_request with the field and the reason. Requires a tenant principal with security_officer or tenant_admin (403 forbidden). The change is audited (file_security.policy.update) with the values before and after; the answer is the new effective policy.

Route: /v1/file-security/policy (PUT).

NameTypeDefaultRequiredDescription
fieldsMap<String, ?>yesFields of the method (for example user and password), up to 16 text values.

Returns: JsonNode. Decoded JSON answer of the operation "Change the file security policy".

Raises: the typed errors of the transport (Errors).

FileSecurityClient.updatePolicy​

JsonNode updatePolicy(Map<String, ?> fields, RequestOptions options)

Change the file security policy. Changes the editable rules given in the body; the other rules keep their value. Sizes may only be tighter than the platform ceiling, and the locked rules never change (422 file_security_rule_locked). An unknown field, an unknown type or a value out of bounds answers 422 invalid_request with the field and the reason. Requires a tenant principal with security_officer or tenant_admin (403 forbidden). The change is audited (file_security.policy.update) with the values before and after; the answer is the new effective policy.

Route: /v1/file-security/policy (PUT).

NameTypeDefaultRequiredDescription
fieldsMap<String, ?>yesFields of the method (for example user and password), up to 16 text values.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Change the file security policy".

Raises: the typed errors of the transport (Errors).