{"id":21359345,"url":"https://github.com/trendmicro/tm-v1-fs-java-sdk","last_synced_at":"2025-07-13T01:31:10.989Z","repository":{"id":207304207,"uuid":"715501507","full_name":"trendmicro/tm-v1-fs-java-sdk","owner":"trendmicro","description":"Trend Vision One File Security Java SDK","archived":false,"fork":false,"pushed_at":"2025-07-09T10:08:14.000Z","size":136,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-09T11:19:57.644Z","etag":null,"topics":["antimalware","antivirus","api","cloud","cnapp","developer-tools","devsecops","security","threat-detection","trend","trendvisionone"],"latest_commit_sha":null,"homepage":"https://docs.trendmicro.com/en-us/enterprise/trend-vision-one.aspx","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trendmicro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-07T09:18:41.000Z","updated_at":"2025-07-07T07:44:40.000Z","dependencies_parsed_at":"2025-07-09T11:19:43.790Z","dependency_job_id":"0bf51d21-e0be-40f5-ba26-aa049270e988","html_url":"https://github.com/trendmicro/tm-v1-fs-java-sdk","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.4444444444444444,"last_synced_commit":"e45e03fe974477c4b055af7018f55b106363c3d1"},"previous_names":["trendmicro/tm-v1-fs-java-sdk"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/trendmicro/tm-v1-fs-java-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro%2Ftm-v1-fs-java-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro%2Ftm-v1-fs-java-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro%2Ftm-v1-fs-java-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro%2Ftm-v1-fs-java-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trendmicro","download_url":"https://codeload.github.com/trendmicro/tm-v1-fs-java-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro%2Ftm-v1-fs-java-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265080006,"owners_count":23708098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antimalware","antivirus","api","cloud","cnapp","developer-tools","devsecops","security","threat-detection","trend","trendvisionone"],"created_at":"2024-11-22T05:27:51.526Z","updated_at":"2025-07-13T01:31:10.980Z","avatar_url":"https://github.com/trendmicro.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trend Vision One™ File Security Java SDK User Guide\n\nTrend Vision One™ - File Security is a scanner app for files and cloud storage. This scanner can detect all types of malicious software (malware) including trojans, ransomware, spyware, and more. Based on fragments of previously seen malware, File Security detects obfuscated or polymorphic variants of malware.\nFile Security can assess any file type or size for malware and display real-time results. With the latest file reputation and variant protection technologies backed by leading threat research, File Security automates malware scanning.\nFile Security can also scan objects across your environment in any application, whether on-premises or in the cloud.\n\nThe Java software development kit (SDK) for Trend Vision One™ File Security empowers you to craft applications which seamlessly integrate with File Security. With this SDK you can perform a thorough scan of data and artifacts within your applications to identify potential malicious elements.\nFollow the steps below to set up your development environment and configure your project, laying the foundation to effectively use File Security.\n\n## Checking prerequisites\n\n- Have Java 8 and above installed in your dev/build environment.\n- Trend Vision One account with a chosen region - for more information, see the [Trend Vision One document](https://docs.trendmicro.com/en-us/documentation/article/trend-vision-one-trend-micro-xdr-abou_001).\n- A Trend Vision One API key with proper role - for more information, see the [Trend Vision One API key documentation](https://docs.trendmicro.com/en-us/documentation/article/trend-vision-one-api-keys).\n\n## Download\n\nDownload the jar from [Maven Central Repository](https://mvnrepository.com/repos/central). Or for Maven, add this dependency to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.trend\u003c/groupId\u003e\n  \u003cartifactId\u003efile-security-java-sdk\u003c/artifactId\u003e\n  \u003cversion\u003e[1.1,)\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Obtain an API Key\n\nThe File Security SDK requires a valid API Key provided as parameter to the SDK client object. It can accept Trend Vision One API keys.\n\nWhen obtaining the API Key, ensure that the API Key is associated with the region that you plan to use. It is important to note that Trend Vision One API Keys are associated with different regions, please refer to the region flag below to obtain a better understanding of the valid regions associated with the respective API Key.\n\nIf you plan on using a Trend Vision One region, be sure to pass in region parameter when running custom program with File Security SDK to specify the region of that API key and to ensure you have proper authorization. The list of supported Trend Vision One regions can be found at API Reference section below.\n\n1. Login to the Trend Vision One.\n2. Create a new Trend Vision One API key:\n\n- Navigate to the Trend Vision One User Roles page.\n- Verify that there is a role with the \"Run file scan via SDK\" permissions enabled. If not, create a role by clicking on \"Add Role\" and \"Save\" once finished.\n- Directly configure a new key on the Trend Vision One API Keys page, using the role which contains the \"Run file scan via SDK\" permission. It is advised to set an expiry time for the API key and make a record of it for future reference.\n\nYou can manage these keys from the Trend Vision One API Keys Page.\n\n## Using File Security Java SDK\n\nUsing File Security Java SDK to scan for malware involves the following basic steps:\n\n1. Creating an AMaaS Client object by specifying preferred Vision One region where scanning should be done and a valid API key.\n2. Configuring scan options using the `AMaasScanOptions` class with the builder pattern.\n3. Invoking file scan or buffer scan method to scan the target data.\n4. Parsing the JSON response returned by the scan APIs to determine whether the scanned data contains malware or not.\n\n### Sample Code\n\n```java\nimport com.trend.cloudone.amaas.AMaasClient;\nimport com.trend.cloudone.amaas.AMaasScanOptions;\nimport com.trend.cloudone.amaas.AMaasException;\n\npublic static void main(String[] args) {\n    try {\n        // 1. Create an AMaaS Client object and configure it to carry out the scans in Vision One \"us-east-1\" region.\n        AMaasClient client = new AMaasClient(\"us-east-1\", \"your-api-key\");\n        try {\n            // 2. Configure scan options using the builder pattern\n            AMaasScanOptions options = AMaasScanOptions.builder()\n                .pml(true)                    // Enable predictive machine learning\n                .feedback(true)               // Enable Smart Feedback\n                .verbose(false)               // Disable verbose logging\n                .activeContent(false)         // Disable active content scanning\n                .tagList(new String[]{\"tag1\", \"tag2\"})  // Optional tags\n                .build();\n\n            // 3. Call scanFile() to scan the content of a file\n            String scanResult = client.scanFile(\"path-of-file-to-scan\", true, options);\n\n            if (scanResult != null) {\n                // 4. Print out the JSON response from scanFile()\n                System.out.println(\"scan result \" + scanResult);\n            }\n        } finally {\n            // 5. Always close the client to release resources\n            client.close();\n        }\n    } catch (AMaasException err) {\n        info(\"Exception {0}\", err.getMessage());\n    }\n}\n```\n\n### Sample JSON Response\n\n#### Concise Format\n\n```json\n{\n  \"version\": \"1.0\",\n  \"scanId\": \"25072030425f4f4d68953177d0628d0b\",\n  \"scanResult\": 1,\n  \"scanTimestamp\": \"2022-11-02T00:55:31Z\",\n  \"fileName\": \"EICAR_TEST_FILE-1.exe\",\n  \"filePath\": \"AmspBvtTestSamples/BVT_RightClickScan_DS/unclean/EICAR_TEST_FILE-1.exe\",\n  \"foundMalwares\": [\n    {     \n      \"fileName\": \"Eicar.exe\",\n      \"malwareName\": \"Eicar_test_file\"\n    }\n  ]\n}\n```\n\nWhen malicious content is detected in the scanned object, `scanResult` will show a non-zero value. Otherwise, the value will be `null`. Moreover, when malware is detected, `foundMalwares` will be non-empty containing one or more name/value pairs of `fileName` and `malwareName`. `fileName` will be filename of malware detected while `malwareName` will be the name of the virus/malware found.\n\n### Enable Active Content Detection\n\nEnables active content detection for scanning operations. This feature allows the scanner to detect potentially malicious active content within files, specifically:\n\n- **PDF scripts**: Detects embedded JavaScript and other scripting content in PDF files\n- **Office macros**: Detects VBA macros and other executable content in Microsoft Office documents\n\nWhen active content is detected, the scan result will include a type field with values of either `macro` or `script` to indicate the type of active content found.\n\n#### Verbose Format\n\n```json\n{\n  \"scanType\": \"sdk\",\n  \"objectType\": \"file\",\n  \"timestamp\": {\n    \"start\": \"2024-07-05T20:01:21.064Z\",\n    \"end\": \"2024-07-05T20:01:21.069Z\"\n  },\n  \"schemaVersion\": \"1.0.0\",\n  \"scannerVersion\": \"1.0.0-59\",\n  \"fileName\": \"eicar.com\",\n  \"rsSize\": 68,\n  \"scanId\": \"40d7a38e-a1d3-400b-a09c-7aa9cd62658f\",\n  \"accountId\": \"\",\n  \"result\": {\n    \"atse\": {\n      \"elapsedTime\": 4693,\n      \"fileType\": 5,\n      \"fileSubType\": 0,\n      \"version\": {\n        \"engine\": \"23.57.0-1002\",\n        \"lptvpn\": 385,\n        \"ssaptn\": 731,\n        \"tmblack\": 253,\n        \"tmwhite\": 239,\n        \"macvpn\": 914\n      },\n      \"malwareCount\": 1,\n      \"malware\": [\n        {\n          \"name\": \"Eicar_test_file\",\n          \"fileName\": \"eicar.com\",\n          \"type\": \"\",\n          \"fileType\": 5,\n          \"fileSubType\": 0,\n          \"fileTypeName\": \"COM\",\n          \"fileSubTypeName\": \"VSDT_COM_DOS\"\n        }\n      ],\n      \"error\": null,\n      \"fileTypeName\": \"COM\",\n      \"fileSubTypeName\": \"VSDT_COM_DOS\"\n    }\n  },\n  \"fileSHA1\": \"3395856ce81f2b7382dee72602f798b642f14140\",\n  \"fileSHA256\": \"275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f\",\n  \"appName\": \"V1FS\"\n}\n```\n\n## Java SDK API Reference\n\n### ```AmaasClient```\n\nThe AmaasClient class is the main class of the SDK and provides methods to use the AMaaS scanning services.\n\n#### ```public AMaasClient(final String region, final String host, final String apiKey, final long timeoutInSecs, final boolean enabledTLS, final string caCert) throws AMaasException```\n\nCreates a new instance of the `AmaasClient` class, and provisions essential settings, including authentication/authorization credentials (API key), preferred service region, etc.\n\n**_Parameters_**\n\n| Parameter     | Description                                                                              |\n| ------------- | ---------------------------------------------------------------------------------------- |\n| region        | The region you obtained your api key. Value provided must be one of the Vision One regions, e.g. `us-east-1`, `eu-central-1`, `ap-northeast-1`, `ap-southeast-2`, `ap-southeast-1`, `ap-south-1`, `me-central-1`, etc. If host is given, region will be ignored. |\n| host          | The host ip address of self hosted AMaaS scanner. Ignore if to use Trend AMaaS service    |\n| apikey        | Your own Vision One API Key.                                                              |\n| timeoutInSecs | Timeout to cancel the connection to server in seconds. Valid value is 0, 1, 2, ... ; default to 300 seconds.         |\n| enabledTLS    | Enable or disable TLS. TLS should always be enabled when connecting to the AMaaS server. For more information, see the 'Ensuring Secure Communication with TLS' |\n| caCert        | File path of the CA certificate for hosted AMaaS Scanner server. null if using Trend AMaaS service.                  |\n\n**_Return_**\nAn AmaasClient instance\n\n#### ```public AMaasClient(final String region, final String apiKey, final long timeoutInSecs) throws AMaasException```\n\nCreates a new instance of the `AmaasClient` class, and provisions essential settings, including authentication/authorization credentials (API key), preferred service region, etc. The enabledTLS is default to true.\n\n**_Parameters_**\n\n| Parameter     | Description                                                                              |\n| ------------- | ---------------------------------------------------------------------------------------- |\n| region        | The region you obtained your api key. Value provided must be one of the Vision One regions, e.g. `us-east-1`, `eu-central-1`, `ap-northeast-1`, `ap-southeast-2`, `ap-southeast-1`, `ap-south-1`, `me-central-1`, etc. |\n| apikey        | Your own Vision One API Key.                                                              |\n| timeoutInSecs | Timeout to cancel the connection to server in seconds. Valid value is 0, 1, 2, ... ; default to 300 seconds.         |\n\n**_Return_**\nAn AmaasClient instance\n\n#### ```public String scanRun(final AMaasReader reader, final AMaasScanOptions options) throws AMaasException```\n\nScan an AMaasReader for malware and retrieves response data from the API. This is the core scanning method that provides the most flexibility by accepting an AMaasReader interface, allowing for different types of data sources.\n\n**_Parameters_**\n\n| Parameter     | Description                                                                              |\n| ------------- | ---------------------------------------------------------------------------------------- |\n| reader        | `AMaasReader` to be scanned. This can be an `AMaasFileReader` or any custom implementation you develop to support your specific data sources. |\n| options       | Scan options containing configuration for the scan operation (PML, feedback, verbose, activeContent, tags). |\n\n**_Return_**\nString the scanned result in JSON format.\n\n**_Note_**: For an example of implementing a custom AMaasReader, please refer to the `examples/s3stream/S3Stream.java` code which demonstrates a streaming implementation of the AMaasReader interface.\n\n#### ```public String scanFile(final String fileName, final boolean digest, final AMaasScanOptions options) throws AMaasException```\n\nScan a file for malware and retrieves response data from the API.\n\n**_Parameters_**\n\n| Parameter     | Description                                                                              |\n| ------------- | ---------------------------------------------------------------------------------------- |\n| fileName      | The name of the file with path of directory containing the file to scan.                 |\n| digest        | A flag to enable/disable calculation of digests for cache search and result lookup.      |\n| options       | Scan options containing configuration for the scan operation (PML, feedback, verbose, activeContent, tags). |\n\n**_Return_**\nString the scanned result in JSON format.\n\n#### ```public String scanBuffer(final byte[] buffer, final String identifier, final boolean digest, final AMaasScanOptions options) throws AMaasException```\n\nScan a buffer for malware and retrieves response data from the API.\n\n**_Parameters_**\n\n| Parameter     | Description                                                                               |\n| ------------- | ----------------------------------------------------------------------------------------- |\n| buffer        | The byte buffer to scan.                                                                  |\n| identifier    | A unique name to identify the buffer.                                                     |\n| digest        | A flag to enable/disable calculation of digests for cache search and result lookup.       |\n| options       | Scan options containing configuration for the scan operation (PML, feedback, verbose, activeContent, tags). |\n\n**_Return_**\nString the scanned result in JSON format.\n\n---\n\n### ```AMaasScanOptions```\n\nThe AMaasScanOptions class provides a convenient way to configure scan parameters using the builder pattern. This class encapsulates all scan-related configuration options.\n\n#### Creating Scan Options\n\n```java\n// Create scan options with default values (all flags disabled, no tags)\nAMaasScanOptions defaultOptions = AMaasScanOptions.builder().build();\n\n// Create scan options with specific configuration\nAMaasScanOptions customOptions = AMaasScanOptions.builder()\n    .pml(true)                              // Enable predictive machine learning\n    .feedback(true)                         // Enable Smart Feedback\n    .verbose(false)                         // Disable verbose logging\n    .activeContent(true)                    // Enable active content scanning\n    .tagList(new String[]{\"tag1\", \"tag2\"})  // Add custom tags\n    .build();\n```\n\n**_Builder Methods_**\n\n| Method        | Parameter | Description                                                                              |\n| ------------- | --------- | ---------------------------------------------------------------------------------------- |\n| `pml(boolean)` | pml      | Enable or disable predictive machine learning detection. Default: false.                |\n| `feedback(boolean)` | feedback | Enable or disable Trend Micro Smart Protection Network's Smart Feedback. Default: false. |\n| `verbose(boolean)` | verbose  | Enable or disable verbose logging mode. Default: false.                                 |\n| `activeContent(boolean)` | activeContent | Enable or disable active content scanning. Default: false.            |\n| `tagList(String[])` | tagList | Set the list of tags for the scan. At most 8 tags with maximum length of 63 characters. Default: null. |\n| `build()`     | -         | Build and return the AMaasScanOptions instance.                                         |\n\n**_Getter Methods_**\n\n| Method                | Return Type | Description                                                     |\n| --------------------- | ----------- | --------------------------------------------------------------- |\n| `isPml()`             | boolean     | Returns true if PML detection is enabled.                      |\n| `isFeedback()`        | boolean     | Returns true if Smart Feedback is enabled.                     |\n| `isVerbose()`         | boolean     | Returns true if verbose mode is enabled.                       |\n| `isActiveContent()`   | boolean     | Returns true if active content scanning is enabled.            |\n| `getTagList()`        | String[]    | Returns the array of tags, or null if no tags are set.         |\n\n---\n\n### ```AmaasScanResult```\n\nThe AmaasScanResult has the data elements of the response data that is retrieved from our API.\nThe class has the following private members. There are getter and setter methods for each of the members.\n\n```java\npublic class AmaasScanResult {\n  private String version;               // API version\n  private int scanResult;               // Number of malwares found. A value of 0 means no malware was found\n  private String scanId;                // ID of the scan\n  private String scanTimestamp;         // Timestamp of the scan in ISO 8601 format\n  private String fileName:              // Name of the file scanned\n  private MalwareItem[] foundMalwares;  // A list of malware names and the filenames found by AMaaS\n\n  // getter and setter methods for the above private variables.\n}\n```\n\n---\n\n### ```MalwareItem```\n\nThe MalwareItem contains a detected malware information in the response data that is retrieved from our API.\nThe class has the following private members. There are getter and setter methods for each of the members.\n\n```java\npublic class MalwareItem {\n  private String malwareName;           // A detected Malware name\n  private String fileName:              // File name that the malware is detected.\n\n  // getter and setter methods for the above private variables.\n}\n```\n\n### ```AMaasScanResultVerbose```\n\nThe AMaasScanResultVerbose has the data elements of the response data in verbose mode that is retrieved from our API. The class has the following private members. There are getter and setter methods for each of the members. See javaDoc for the class of each data element.\n\n```java\npublic class AMaasScanResultVerbose {\n    private String scanType;          // Type of scan\n    private String objectType;        // Type of the object being scanned. e.g, file\n    private StartEnd timestamp;       // begin and end time strings in ISO 8601 format\n    private String schemaVersion;     // Version of the data schema\n    private String scannerVersion;    // Scanner version\n    private String fileName;          // Name of the file\n    private long rsSize;              // Size of the scanned file\n    private String scanId;            // ID of the scan\n    private String accountId;         // ID of the customer\n    private ScanResult result;        // Result for the current scan\n    private String[] tags;            // Tags used for this scan\n    private String fileSha1;          // Sha1 of the scanned file\n    private String fileSha256;        // Sha256 of the scanned file\n    private String appName;           // Name of the application\n\n    // getter and setter methods for the above private variables.\n}\n```\n\n---\n\n### ```AMaasException```\n\nThe AMaasException class is the AMaaS SDK exception class.\n\n```java\npublic final class AMaasException extends Exception {\n  private AMaasErrorCode erroCode;\n\n  public AMaasException(final AMaasErrorCode erroCode, final Object... params) {\n    ...\n  }\n}\n```\n\n---\n\n### ```AMaasErrorCode```\n\nAMaasErrorCode is a enum type containing all the error conditions thrown by the `AMaasException` class. The error conditions are as follows:\n\n| Enum Type                       | Error Message Templates                                | Description |\n| --------------------------------|------------------------------------------------------- | ----------- |\n| MSG_ID_ERR_INVALID_REGION       | %s is not a supported region.                          | The region code provided to the AMaasClient constructor is not a valid region. |\n| MSG_ID_ERR_MISSING_AUTH         | Must provide an API key to use the client.             | The API Key provided to the AMaasClient constructor cannot be empty or `null`. |\n| MSG_ID_ERR_KEY_AUTH_FAILED      | You are not authenticated. Invalid C1 token or Api Key | The API key is invalid. Please make sure a correct Vision One Api key is used. |\n| MSG_ID_ERR_FILE_NOT_FOUND       | Failed to open file. No such file or directory %s.     | The given file cannot be found. Please make sure the file exists. |\n| MSG_ID_ERR_FILE_NO_PERMISSION   | Failed to open file. Permission denied to open %s.     | There is a file access permission issue. Please make sure the SDK has read permission to the file. |\n| MSG_ID_GRPC_ERROR               | Received gRPC status code: %d, msg: %s.                | gRpc error was reported with the status code. For details, please refer to published [gRPC Status Codes](https://grpc.github.io/grpc/core/md_doc_statuscodes.html) |\n| MSG_ID_ERR_UNEXPECTED_INTERRUPT | Unexpected interrupt encountered.                      | An unexpected interrupt signal was received at the client. |\n\n## Thread Safety\n\n- scanFile() or scanBuffer() are designed to be thread-safe. It should be able to invoke scanFile() concurrently from multiple threads without protecting scanFile() with mutex or other synchronization mechanisms.\n\n## Ensuring Secure Communication with TLS\n\nThe communication channel between the client program or SDK and the Trend Vision One™ File Security service is fortified with robust server-side TLS encryption. This ensures that all data transmitted between the client and Trend service remains thoroughly encrypted and safeguarded.\nThe certificate employed by server-side TLS is a publicly-signed certificate from Trend Micro Inc, issued by a trusted Certificate Authority (CA), further bolstering security measures.\n\nThe File Security SDK consistently adopts TLS as the default communication channel, prioritizing security at all times. It is strongly advised not to disable TLS in a production environment while utilizing the File Security SDK, as doing so could compromise the integrity and confidentiality of transmitted data.\n\n## Disabling certificate verification\n\nFor customers who need to enable TLS channel encryption without verifying the provided CA certificate, the `TM_AM_DISABLE_CERT_VERIFY` environment variable can be set. However, this option is only recommended for use in testing environments.\n\nWhen `TM_AM_DISABLE_CERT_VERIFY` is set to `1`, certificate verification is disabled. By default, the certificate will be verified.\n\n## Proxy Configuration\n\nThe File Security Java SDK supports HTTP and SOCKS5 proxy configurations through environment variables. This allows the SDK to work in enterprise environments that require proxy servers for internet access.\n\n### Supported Environment Variables\n\n| Environment Variable | Required/Optional | Description                                                                                                                                                     |\n| -------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `HTTP_PROXY`         | Optional          | HTTP proxy URL for HTTP connections (e.g., `http://proxy.example.com:8080`)                                                                                    |\n| `HTTPS_PROXY`        | Optional          | Proxy URL for HTTPS connections (e.g., `https://proxy.example.com:8443` or `socks5://socks.example.com:1080`)                                                 |\n| `NO_PROXY`           | Optional          | Comma-separated list of host names to bypass proxy (e.g., `localhost,127.0.0.1,*.local`). Use `*` to bypass proxy for all hosts                              |\n| `PROXY_USER`         | Optional          | Username for proxy authentication (used with `Proxy-Authorization` header)                                                                                     |\n| `PROXY_PASS`         | Optional          | Password for proxy authentication (used only when `PROXY_USER` is configured)                                                                                  |\n\n### Proxy Configuration Examples\n\n#### Basic HTTP Proxy\n```bash\nexport HTTP_PROXY=http://proxy.company.com:8080\nexport HTTPS_PROXY=http://proxy.company.com:8080\n```\n\n#### SOCKS5 Proxy\n```bash\nexport HTTPS_PROXY=socks5://socks-proxy.company.com:1080\n```\n\n**Important:** When using SOCKS5 proxy, ensure you call `client.close()` to properly release network resources. The SDK creates background threads for SOCKS5 connections that must be explicitly closed.\n\n```java\nAMaasClient client = new AMaasClient(\"us-east-1\", \"your-api-key\");\ntry {\n    // Perform scanning operations\n    String result = client.scanFile(\"file.txt\");\n} finally {\n    // Always close the client when using SOCKS5 proxy\n    client.close();\n}\n```\n\n#### Proxy with Authentication\n```bash\nexport HTTP_PROXY=http://proxy.company.com:8080\nexport HTTPS_PROXY=https://secure-proxy.company.com:8443\nexport PROXY_USER=username\nexport PROXY_PASS=password\n```\n\n#### Bypassing Proxy for Specific Hosts\n```bash\nexport HTTP_PROXY=http://proxy.company.com:8080\nexport NO_PROXY=localhost,127.0.0.1,*.internal.company.com\n```\n\n#### Disabling Proxy for All Connections\n```bash\nexport NO_PROXY=*\n```\n\n### Notes\n\n- The SDK automatically detects and uses proxy settings from environment variables\n- For HTTPS connections, `HTTPS_PROXY` takes precedence over `HTTP_PROXY`\n- SOCKS5 proxies are supported by specifying `socks5://` in the proxy URL\n- Proxy authentication requires both `PROXY_USER` and `PROXY_PASS` to be set\n- The `NO_PROXY` variable supports wildcards (e.g., `*.local`) and exact matches\n- No code changes are required - simply set the appropriate environment variables before running your application\n- **Resource Management:** Always call `client.close()` when finished, especially when using SOCKS5 proxies, to ensure proper cleanup of network resources and prevent applications from hanging\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro%2Ftm-v1-fs-java-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrendmicro%2Ftm-v1-fs-java-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro%2Ftm-v1-fs-java-sdk/lists"}