diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ff45cbf1..75df01a2 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 0359d4fe-2923-46fc-aaca-cf70b48dcfa1 management: - docChecksum: 59c6e14049dbd73093349e44990e95cc + docChecksum: 6cb4c4786bf30fecfc20b38750d745eb docVersion: 0.9.0 - speakeasyVersion: 1.558.0 - generationVersion: 2.623.2 - releaseVersion: 0.5.5 - configChecksum: fa9891571ae879a5a9c20e2619cde1e9 + speakeasyVersion: 1.563.2 + generationVersion: 2.629.2 + releaseVersion: 0.5.6 + configChecksum: a3fcc2f551abcd371f1891c11a1cf24a repoURL: https://github.com/gleanwork/api-client-java.git published: true features: @@ -14,7 +14,7 @@ features: additionalDependencies: 0.1.0 additionalProperties: 0.0.1 constsAndDefaults: 0.1.1 - core: 3.37.4 + core: 3.39.0 deprecations: 2.81.1 examples: 2.81.5 flattening: 2.81.1 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 9d66834f..ece1e152 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -17,7 +17,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true java: - version: 0.5.5 + version: 0.5.6 additionalDependencies: [] additionalPlugins: [] artifactID: glean-api-client @@ -27,6 +27,7 @@ java: companyName: Glean companyURL: https://www.glean.com defaultErrorName: APIException + enableCustomCodeRegions: false envVarPrefix: GLEAN flattenGlobalSecurity: true githubURL: github.com/gleanwork/api-client-java diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 51c84e23..04a2a3cc 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -351,7 +351,12 @@ paths: tags: - Authentication summary: Create authentication token - description: Creates an authentication token for the authenticated user. + description: | + Creates an authentication token for the authenticated user. These are + specifically intended to be used with the [Web SDK](https://developers.glean.com/web). + + Note: The tokens generated from this endpoint are **not** valid tokens + for use with the Client API (e.g. `/rest/api/v1/*`). operationId: createauthtoken x-visibility: Public parameters: [] @@ -841,7 +846,7 @@ paths: tags: - Agents summary: Search agents - description: "Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. " + description: Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. operationId: searchAgents x-visibility: Preview requestBody: @@ -7554,6 +7559,11 @@ components: $ref: "#/components/schemas/Message" title: Messages description: The messages to pass an input to the agent. + metadata: + type: object + title: Metadata + description: The metadata to pass to the agent. + additionalProperties: true AgentExecutionStatus: description: The status of the run. One of 'error', 'success'. type: string diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d115ebb4..b9e3c652 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,12 +1,12 @@ -speakeasyVersion: 1.558.0 +speakeasyVersion: 1.563.2 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:8a528d68d247ecb98ea1d9d49c135154477cbfbab078b6159359a09f64628fba - sourceBlobDigest: sha256:09d1624a9a347738790040f1fcdc5f2eff15461dd39941a1535efb55e2c8939f + sourceRevisionDigest: sha256:766f374184dd7d6b119aef718a826e26e7e690a65bd8edd8e326c75699c9c0f5 + sourceBlobDigest: sha256:b566588e295fa760c08dc3e5f61f4026e3b295999709bbec5a3f434f51316f89 tags: - latest - - speakeasy-sdk-regen-1749491204 + - speakeasy-sdk-regen-1749670145 Glean-OAS: sourceNamespace: glean-oas sourceRevisionDigest: sha256:8841834dd58ddd4e2dcf98fc90fbd06fbf3626a29df941503cce55b9548a5317 @@ -18,10 +18,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:8a528d68d247ecb98ea1d9d49c135154477cbfbab078b6159359a09f64628fba - sourceBlobDigest: sha256:09d1624a9a347738790040f1fcdc5f2eff15461dd39941a1535efb55e2c8939f + sourceRevisionDigest: sha256:766f374184dd7d6b119aef718a826e26e7e690a65bd8edd8e326c75699c9c0f5 + sourceBlobDigest: sha256:b566588e295fa760c08dc3e5f61f4026e3b295999709bbec5a3f434f51316f89 codeSamplesNamespace: glean-api-specs-java-code-samples - codeSamplesRevisionDigest: sha256:e5b2ea5208c1dc6e24e3a32186332fee5e6235cc612e785611add744c44901fa + codeSamplesRevisionDigest: sha256:d644e6736c249dfb5aab7f2f6899ae480a6fbebde39c8bb385cf233f3b5689d4 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 661a8cf1..407d1980 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.glean.api-client:glean-api-client:0.5.5' +implementation 'com.glean.api-client:glean-api-client:0.5.6' ``` Maven: @@ -70,7 +70,7 @@ Maven: com.glean.api-client glean-api-client - 0.5.5 + 0.5.6 ``` diff --git a/RELEASES.md b/RELEASES.md index c0bd46dc..6380fdf0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -148,4 +148,14 @@ Based on: ### Generated - [java v0.5.5] . ### Releases -- [Maven Central v0.5.5] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.5.5 - . \ No newline at end of file +- [Maven Central v0.5.5] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.5.5 - . + +## 2025-06-16 19:03:02 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.563.2 (2.629.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.5.6] . +### Releases +- [Maven Central v0.5.6] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.5.6 - . \ No newline at end of file diff --git a/build.gradle b/build.gradle index b444ce3a..0cc3fc94 100644 --- a/build.gradle +++ b/build.gradle @@ -104,7 +104,7 @@ publishing { // https://github.com/gradle/gradle/issues/18619 groupId = "com.glean.api-client" artifactId = "glean-api-client" - version = "0.5.5" + version = "0.5.6" from components.java diff --git a/docs/models/components/AgentRun.md b/docs/models/components/AgentRun.md index 77917bb9..9e9dc45f 100644 --- a/docs/models/components/AgentRun.md +++ b/docs/models/components/AgentRun.md @@ -10,4 +10,5 @@ Payload for creating a run. | `agentId` | *String* | :heavy_check_mark: | The ID of the agent to run. | | `input` | Map\ | :heavy_minus_sign: | The input to the agent. | | `messages` | List\<[Message](../../models/components/Message.md)> | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Map\ | :heavy_minus_sign: | The metadata to pass to the agent. | | `status` | [Optional\](../../models/components/AgentExecutionStatus.md) | :heavy_minus_sign: | The status of the run. One of 'error', 'success'. | \ No newline at end of file diff --git a/docs/models/components/AgentRunCreate.md b/docs/models/components/AgentRunCreate.md index e1a9e115..ffeced48 100644 --- a/docs/models/components/AgentRunCreate.md +++ b/docs/models/components/AgentRunCreate.md @@ -9,4 +9,5 @@ Payload for creating a run. | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | | `agentId` | *String* | :heavy_check_mark: | The ID of the agent to run. | | `input` | Map\ | :heavy_minus_sign: | The input to the agent. | -| `messages` | List\<[Message](../../models/components/Message.md)> | :heavy_minus_sign: | The messages to pass an input to the agent. | \ No newline at end of file +| `messages` | List\<[Message](../../models/components/Message.md)> | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Map\ | :heavy_minus_sign: | The metadata to pass to the agent. | \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index 1b0b4e4a..73c26f5a 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -111,7 +111,7 @@ public class Application { ## list -Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. +Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. ### Example Usage diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index 03746146..8c33ac62 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -335,8 +335,8 @@ import com.glean.api_client.glean_api_client.Glean; import com.glean.api_client.glean_api_client.models.components.File; import com.glean.api_client.glean_api_client.models.components.UploadChatFilesRequest; import com.glean.api_client.glean_api_client.models.operations.UploadchatfilesResponse; +import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; -import java.nio.charset.StandardCharsets; import java.util.List; public class Application { @@ -352,7 +352,7 @@ public class Application { .files(List.of( File.builder() .fileName("example.file") - .content("0x8b739cFCeF".getBytes(StandardCharsets.UTF_8)) + .content(Utils.readBytes("example.file")) .build())) .build()) .call(); diff --git a/docs/sdks/clientauthentication/README.md b/docs/sdks/clientauthentication/README.md index 2d2d0ed1..080ff535 100644 --- a/docs/sdks/clientauthentication/README.md +++ b/docs/sdks/clientauthentication/README.md @@ -9,7 +9,12 @@ ## createToken -Creates an authentication token for the authenticated user. +Creates an authentication token for the authenticated user. These are +specifically intended to be used with the [Web SDK](https://developers.glean.com/web). + +Note: The tokens generated from this endpoint are **not** valid tokens +for use with the Client API (e.g. `/rest/api/v1/*`). + ### Example Usage diff --git a/gradle.properties b/gradle.properties index 4d2c35f7..1ab086d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ groupId=com.glean.api-client artifactId=glean-api-client -version=0.5.5 \ No newline at end of file +version=0.5.6 \ No newline at end of file diff --git a/src/main/java/com/glean/api_client/glean_api_client/Activity.java b/src/main/java/com/glean/api_client/glean_api_client/Activity.java index 7b48f772..09dafcbb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Activity.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Activity.java @@ -39,7 +39,6 @@ public class Activity implements this.sdkConfiguration = sdkConfiguration; } - /** * Report document activity * @@ -178,7 +177,6 @@ public ActivityResponse report( } - /** * Report client activity * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Agents.java b/src/main/java/com/glean/api_client/glean_api_client/Agents.java index a7ced48b..3dae6c21 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Agents.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Agents.java @@ -54,7 +54,6 @@ public class Agents implements this.sdkConfiguration = sdkConfiguration; } - /** * Retrieve an agent * @@ -221,7 +220,6 @@ public GetAgentResponse retrieve( } - /** * List an agent's schemas * @@ -388,7 +386,6 @@ public GetAgentSchemasResponse retrieveSchemas( } - /** * Search agents * @@ -538,7 +535,6 @@ public SearchAgentsResponse list( } - /** * Create an agent run and stream the response * @@ -686,7 +682,6 @@ public CreateAndStreamRunResponse runStream( } - /** * Create an agent run and wait for the response * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Announcements.java b/src/main/java/com/glean/api_client/glean_api_client/Announcements.java index fc468226..9a486833 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Announcements.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Announcements.java @@ -44,7 +44,6 @@ public class Announcements implements this.sdkConfiguration = sdkConfiguration; } - /** * Create Announcement * @@ -194,7 +193,6 @@ public CreateannouncementResponse create( } - /** * Delete Announcement * @@ -333,7 +331,6 @@ public DeleteannouncementResponse delete( } - /** * Update Announcement * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Answers.java b/src/main/java/com/glean/api_client/glean_api_client/Answers.java index eafc3a7d..8fc69b1e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Answers.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Answers.java @@ -54,7 +54,6 @@ public class Answers implements this.sdkConfiguration = sdkConfiguration; } - /** * Create Answer * @@ -204,7 +203,6 @@ public CreateanswerResponse create( } - /** * Delete Answer * @@ -343,7 +341,6 @@ public DeleteanswerResponse delete( } - /** * Update Answer * @@ -493,7 +490,6 @@ public EditanswerResponse update( } - /** * Read Answer * @@ -643,7 +639,6 @@ public GetanswerResponse retrieve( } - /** * List Answers * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Chat.java b/src/main/java/com/glean/api_client/glean_api_client/Chat.java index 739cfcd9..1fbb95ad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Chat.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Chat.java @@ -83,7 +83,6 @@ public class Chat implements this.sdkConfiguration = sdkConfiguration; } - /** * Chat * @@ -261,7 +260,6 @@ public ChatResponse create( } - /** * Deletes all saved Chats owned by a user * @@ -410,7 +408,6 @@ public DeleteallchatsResponse deleteAll( } - /** * Deletes saved Chats * @@ -577,7 +574,6 @@ public DeletechatsResponse delete( } - /** * Retrieves a Chat * @@ -755,7 +751,6 @@ public GetchatResponse retrieve( } - /** * Retrieves all saved Chats * @@ -915,7 +910,6 @@ public ListchatsResponse list( } - /** * Gets the metadata for a custom Chat application * @@ -1093,7 +1087,6 @@ public GetchatapplicationResponse retrieveApplication( } - /** * Upload files for Chat. * @@ -1271,7 +1264,6 @@ public UploadchatfilesResponse uploadFiles( } - /** * Get files uploaded by a user for Chat. * @@ -1449,7 +1441,6 @@ public GetchatfilesResponse retrieveFiles( } - /** * Delete files uploaded by a user for chat. * @@ -1616,7 +1607,6 @@ public DeletechatfilesResponse deleteFiles( } - /** * Chat * diff --git a/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java b/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java index 58c04fb3..3fc3e054 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java +++ b/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java @@ -32,11 +32,14 @@ public class ClientAuthentication implements this.sdkConfiguration = sdkConfiguration; } - /** * Create authentication token * - *

Creates an authentication token for the authenticated user. + *

Creates an authentication token for the authenticated user. These are + * specifically intended to be used with the [Web SDK](https://developers.glean.com/web). + * + *

Note: The tokens generated from this endpoint are **not** valid tokens + * for use with the Client API (e.g. `/rest/api/v1/*`). * * @return The call builder */ @@ -47,7 +50,11 @@ public CreateauthtokenRequestBuilder createToken() { /** * Create authentication token * - *

Creates an authentication token for the authenticated user. + *

Creates an authentication token for the authenticated user. These are + * specifically intended to be used with the [Web SDK](https://developers.glean.com/web). + * + *

Note: The tokens generated from this endpoint are **not** valid tokens + * for use with the Client API (e.g. `/rest/api/v1/*`). * * @return The response from the API call * @throws Exception if the API call fails diff --git a/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java b/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java index d3802558..33a82d50 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java +++ b/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java @@ -50,7 +50,6 @@ public class ClientDocuments implements this.sdkConfiguration = sdkConfiguration; } - /** * Read document permissions * @@ -200,7 +199,6 @@ public GetdocpermissionsResponse retrievePermissions( } - /** * Read documents * @@ -359,7 +357,6 @@ public GetdocumentsResponse retrieve( } - /** * Read documents by facets * @@ -518,7 +515,6 @@ public GetdocumentsbyfacetsResponse retrieveByFacets( } - /** * Summarize documents * diff --git a/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java b/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java index 40b03b2a..fc23aebe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java +++ b/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java @@ -55,7 +55,6 @@ public class ClientShortcuts implements this.sdkConfiguration = sdkConfiguration; } - /** * Create shortcut * @@ -205,7 +204,6 @@ public CreateshortcutResponse create( } - /** * Delete shortcut * @@ -344,7 +342,6 @@ public DeleteshortcutResponse delete( } - /** * Read shortcut * @@ -494,7 +491,6 @@ public GetshortcutResponse retrieve( } - /** * List shortcuts * @@ -644,7 +640,6 @@ public ListshortcutsResponse list( } - /** * Update shortcut * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Collections.java b/src/main/java/com/glean/api_client/glean_api_client/Collections.java index c35a7ea7..45674e07 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Collections.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Collections.java @@ -71,7 +71,6 @@ public class Collections implements this.sdkConfiguration = sdkConfiguration; } - /** * Add Collection item * @@ -221,7 +220,6 @@ public AddcollectionitemsResponse addItems( } - /** * Create Collection * @@ -385,7 +383,6 @@ public CreatecollectionResponse create( } - /** * Delete Collection * @@ -538,7 +535,6 @@ public DeletecollectionResponse delete( } - /** * Delete Collection item * @@ -688,7 +684,6 @@ public DeletecollectionitemResponse deleteItem( } - /** * Update Collection * @@ -852,7 +847,6 @@ public EditcollectionResponse update( } - /** * Update Collection item * @@ -1002,7 +996,6 @@ public EditcollectionitemResponse updateItem( } - /** * Read Collection * @@ -1152,7 +1145,6 @@ public GetcollectionResponse retrieve( } - /** * List Collections * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Datasource.java b/src/main/java/com/glean/api_client/glean_api_client/Datasource.java index 435b263a..1b0ba89a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Datasource.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Datasource.java @@ -33,7 +33,6 @@ public class Datasource implements this.sdkConfiguration = sdkConfiguration; } - /** * Beta: Get datasource status * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Datasources.java b/src/main/java/com/glean/api_client/glean_api_client/Datasources.java index 689c8204..59ee1ea2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Datasources.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Datasources.java @@ -39,7 +39,6 @@ public class Datasources implements this.sdkConfiguration = sdkConfiguration; } - /** * Add or update datasource * @@ -178,7 +177,6 @@ public PostApiIndexV1AdddatasourceResponse add( } - /** * Get datasource config * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Entities.java b/src/main/java/com/glean/api_client/glean_api_client/Entities.java index c0626a55..0bf9b9fd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Entities.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Entities.java @@ -40,7 +40,6 @@ public class Entities implements this.sdkConfiguration = sdkConfiguration; } - /** * List entities * @@ -190,7 +189,6 @@ public ListentitiesResponse list( } - /** * Read people * diff --git a/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java b/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java index 120de331..74103237 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java +++ b/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java @@ -32,7 +32,6 @@ public class IndexingAuthentication implements this.sdkConfiguration = sdkConfiguration; } - /** * Rotate token * diff --git a/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java b/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java index dc53e876..6a0e2d6b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java +++ b/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java @@ -79,7 +79,6 @@ public class IndexingDocuments implements this.sdkConfiguration = sdkConfiguration; } - /** * Index document * @@ -218,7 +217,6 @@ public PostApiIndexV1IndexdocumentResponse addOrUpdate( } - /** * Index documents * @@ -357,7 +355,6 @@ public PostApiIndexV1IndexdocumentsResponse index( } - /** * Bulk index documents * @@ -496,7 +493,6 @@ public PostApiIndexV1BulkindexdocumentsResponse bulkIndex( } - /** * Schedules the processing of uploaded documents * @@ -674,7 +670,6 @@ public PostApiIndexV1ProcessalldocumentsResponse processAll( } - /** * Delete document * @@ -813,7 +808,6 @@ public PostApiIndexV1DeletedocumentResponse delete( } - /** * Beta: Get document information * @@ -978,7 +972,6 @@ public PostApiIndexV1DebugDatasourceDocumentResponse debug( } - /** * Beta: Get information of a batch of documents * @@ -1143,7 +1136,6 @@ public PostApiIndexV1DebugDatasourceDocumentsResponse debugMany( } - /** * Check document access * @@ -1297,7 +1289,6 @@ public PostApiIndexV1CheckdocumentaccessResponse checkAccess( } - /** * Get document upload and indexing status * @@ -1455,7 +1446,6 @@ public PostApiIndexV1GetdocumentstatusResponse status( } - /** * Get document count * diff --git a/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java b/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java index f8140205..8a803f4c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java +++ b/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java @@ -39,7 +39,6 @@ public class IndexingShortcuts implements this.sdkConfiguration = sdkConfiguration; } - /** * Bulk index external shortcuts * @@ -178,7 +177,6 @@ public PostApiIndexV1BulkindexshortcutsResponse bulkIndex( } - /** * Upload shortcuts * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Insights.java b/src/main/java/com/glean/api_client/glean_api_client/Insights.java index 5fa8922c..fac2b935 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Insights.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Insights.java @@ -35,7 +35,6 @@ public class Insights implements this.sdkConfiguration = sdkConfiguration; } - /** * Read insights * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Messages.java b/src/main/java/com/glean/api_client/glean_api_client/Messages.java index 9bd4f9d8..4d5bea29 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Messages.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Messages.java @@ -35,7 +35,6 @@ public class Messages implements this.sdkConfiguration = sdkConfiguration; } - /** * Read messages * diff --git a/src/main/java/com/glean/api_client/glean_api_client/People.java b/src/main/java/com/glean/api_client/glean_api_client/People.java index 791aad4f..1bde8144 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/People.java +++ b/src/main/java/com/glean/api_client/glean_api_client/People.java @@ -70,7 +70,6 @@ public class People implements this.sdkConfiguration = sdkConfiguration; } - /** * Beta: Get user information * @@ -235,7 +234,6 @@ public PostApiIndexV1DebugDatasourceUserResponse debug( } - /** * Get user count * @@ -393,7 +391,6 @@ public PostApiIndexV1GetusercountResponse count( } - /** * Index employee * @@ -532,7 +529,6 @@ public PostApiIndexV1IndexemployeeResponse index( } - /** * Bulk index employees * @@ -671,7 +667,6 @@ public PostApiIndexV1BulkindexemployeesResponse bulkIndex( } - /** * Schedules the processing of uploaded employees and teams * @@ -795,7 +790,6 @@ public PostApiIndexV1ProcessallemployeesandteamsResponse processAllEmployeesAndT } - /** * Delete employee * @@ -934,7 +928,6 @@ public PostApiIndexV1DeleteemployeeResponse delete( } - /** * Index team * @@ -1073,7 +1066,6 @@ public PostApiIndexV1IndexteamResponse indexTeam( } - /** * Delete team * @@ -1212,7 +1204,6 @@ public PostApiIndexV1DeleteteamResponse deleteTeam( } - /** * Bulk index teams * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Permissions.java b/src/main/java/com/glean/api_client/glean_api_client/Permissions.java index b563a44a..be4f4c6e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Permissions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Permissions.java @@ -79,7 +79,6 @@ public class Permissions implements this.sdkConfiguration = sdkConfiguration; } - /** * Update document permissions * @@ -218,7 +217,6 @@ public PostApiIndexV1UpdatepermissionsResponse updatePermissions( } - /** * Index user * @@ -357,7 +355,6 @@ public PostApiIndexV1IndexuserResponse indexUser( } - /** * Bulk index users * @@ -496,7 +493,6 @@ public PostApiIndexV1BulkindexusersResponse bulkIndexUsers( } - /** * Index group * @@ -635,7 +631,6 @@ public PostApiIndexV1IndexgroupResponse indexGroup( } - /** * Bulk index groups * @@ -774,7 +769,6 @@ public PostApiIndexV1BulkindexgroupsResponse bulkIndexGroups( } - /** * Index membership * @@ -913,7 +907,6 @@ public PostApiIndexV1IndexmembershipResponse indexMembership( } - /** * Bulk index memberships for a group * @@ -1052,7 +1045,6 @@ public PostApiIndexV1BulkindexmembershipsResponse bulkIndexMemberships( } - /** * Schedules the processing of group memberships * @@ -1200,7 +1192,6 @@ public PostApiIndexV1ProcessallmembershipsResponse processMemberships( } - /** * Delete user * @@ -1339,7 +1330,6 @@ public PostApiIndexV1DeleteuserResponse deleteUser( } - /** * Delete group * @@ -1478,7 +1468,6 @@ public PostApiIndexV1DeletegroupResponse deleteGroup( } - /** * Delete membership * @@ -1617,7 +1606,6 @@ public PostApiIndexV1DeletemembershipResponse deleteMembership( } - /** * Beta users * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Pins.java b/src/main/java/com/glean/api_client/glean_api_client/Pins.java index b052c6fe..1af44be8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Pins.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Pins.java @@ -54,7 +54,6 @@ public class Pins implements this.sdkConfiguration = sdkConfiguration; } - /** * Update pin * @@ -204,7 +203,6 @@ public EditpinResponse update( } - /** * Read pin * @@ -354,7 +352,6 @@ public GetpinResponse retrieve( } - /** * List pins * @@ -504,7 +501,6 @@ public ListpinsResponse list( } - /** * Create pin * @@ -654,7 +650,6 @@ public PinResponse create( } - /** * Delete pin * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Policies.java b/src/main/java/com/glean/api_client/glean_api_client/Policies.java index d546881f..469f8e09 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Policies.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Policies.java @@ -58,7 +58,6 @@ public class Policies implements this.sdkConfiguration = sdkConfiguration; } - /** * Gets specified policy * @@ -225,7 +224,6 @@ public GetpolicyResponse retrieve( } - /** * Updates an existing policy * @@ -386,7 +384,6 @@ public UpdatepolicyResponse update( } - /** * Lists policies * @@ -549,7 +546,6 @@ public ListpoliciesResponse list( } - /** * Creates new policy * @@ -699,7 +695,6 @@ public CreatepolicyResponse create( } - /** * Downloads violations CSV for policy * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Reports.java b/src/main/java/com/glean/api_client/glean_api_client/Reports.java index 7c1aeccd..359ed5df 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Reports.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Reports.java @@ -45,7 +45,6 @@ public class Reports implements this.sdkConfiguration = sdkConfiguration; } - /** * Creates new one-time report * @@ -195,7 +194,6 @@ public CreatereportResponse create( } - /** * Downloads violations CSV for report * @@ -338,7 +336,6 @@ public DownloadreportcsvResponse download( } - /** * Fetches report run status * diff --git a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java index fadc4433..d0b3feb8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java +++ b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java @@ -21,8 +21,8 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "0.9.0"; - public static final String SDK_VERSION = "0.5.5"; - public static final String GEN_VERSION = "2.623.2"; + public static final String SDK_VERSION = "0.5.6"; + public static final String GEN_VERSION = "2.629.2"; private static final String BASE_PACKAGE = "com.glean.api_client.glean_api_client"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/glean/api_client/glean_api_client/Search.java b/src/main/java/com/glean/api_client/glean_api_client/Search.java index 4782095a..53bf440d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Search.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Search.java @@ -52,7 +52,6 @@ public class Search implements this.sdkConfiguration = sdkConfiguration; } - /** * Search the index (admin) * @@ -216,7 +215,6 @@ public AdminsearchResponse queryAsAdmin( } - /** * Autocomplete * @@ -366,7 +364,6 @@ public AutocompleteResponse autocomplete( } - /** * Feed of documents and events * @@ -516,7 +513,6 @@ public FeedResponse retrieveFeed( } - /** * Recommend documents * @@ -670,7 +666,6 @@ public RecommendationsResponse recommendations( } - /** * Search * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Tools.java b/src/main/java/com/glean/api_client/glean_api_client/Tools.java index f844f0ce..eaf71901 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Tools.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Tools.java @@ -41,7 +41,6 @@ public class Tools implements this.sdkConfiguration = sdkConfiguration; } - /** * List available tools * @@ -201,7 +200,6 @@ public GetRestApiV1ToolsListResponse list( } - /** * Execute the specified tool * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Verification.java b/src/main/java/com/glean/api_client/glean_api_client/Verification.java index d98d4867..39221b17 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Verification.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Verification.java @@ -45,7 +45,6 @@ public class Verification implements this.sdkConfiguration = sdkConfiguration; } - /** * Create verification * @@ -195,7 +194,6 @@ public AddverificationreminderResponse addReminder( } - /** * List verifications * @@ -355,7 +353,6 @@ public ListverificationsResponse list( } - /** * Update verification * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java b/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java index 8efdfc20..91a369a5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java @@ -41,7 +41,6 @@ public class Visibilityoverrides implements this.sdkConfiguration = sdkConfiguration; } - /** * Fetches documents visibility * @@ -201,7 +200,6 @@ public GetdocvisibilityResponse list( } - /** * Hide or unhide docs * diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java index a8a6e76a..9ef3f698 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java @@ -45,6 +45,13 @@ public class AgentRun { @JsonProperty("messages") private Optional> messages; + /** + * The metadata to pass to the agent. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional> metadata; + /** * The status of the run. One of 'error', 'success'. */ @@ -57,20 +64,23 @@ public AgentRun( @JsonProperty("agent_id") String agentId, @JsonProperty("input") Optional> input, @JsonProperty("messages") Optional> messages, + @JsonProperty("metadata") Optional> metadata, @JsonProperty("status") Optional status) { Utils.checkNotNull(agentId, "agentId"); Utils.checkNotNull(input, "input"); Utils.checkNotNull(messages, "messages"); + Utils.checkNotNull(metadata, "metadata"); Utils.checkNotNull(status, "status"); this.agentId = agentId; this.input = input; this.messages = messages; + this.metadata = metadata; this.status = status; } public AgentRun( String agentId) { - this(agentId, Optional.empty(), Optional.empty(), Optional.empty()); + this(agentId, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -99,6 +109,15 @@ public Optional> messages() { return (Optional>) messages; } + /** + * The metadata to pass to the agent. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; + } + /** * The status of the run. One of 'error', 'success'. */ @@ -157,6 +176,24 @@ public AgentRun withMessages(Optional> messages) { return this; } + /** + * The metadata to pass to the agent. + */ + public AgentRun withMetadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + /** + * The metadata to pass to the agent. + */ + public AgentRun withMetadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + /** * The status of the run. One of 'error', 'success'. */ @@ -189,6 +226,7 @@ public boolean equals(java.lang.Object o) { Objects.deepEquals(this.agentId, other.agentId) && Objects.deepEquals(this.input, other.input) && Objects.deepEquals(this.messages, other.messages) && + Objects.deepEquals(this.metadata, other.metadata) && Objects.deepEquals(this.status, other.status); } @@ -198,6 +236,7 @@ public int hashCode() { agentId, input, messages, + metadata, status); } @@ -207,6 +246,7 @@ public String toString() { "agentId", agentId, "input", input, "messages", messages, + "metadata", metadata, "status", status); } @@ -218,6 +258,8 @@ public final static class Builder { private Optional> messages = Optional.empty(); + private Optional> metadata = Optional.empty(); + private Optional status = Optional.empty(); private Builder() { @@ -269,6 +311,24 @@ public Builder messages(Optional> messages) { return this; } + /** + * The metadata to pass to the agent. + */ + public Builder metadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + /** + * The metadata to pass to the agent. + */ + public Builder metadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + /** * The status of the run. One of 'error', 'success'. */ @@ -292,6 +352,7 @@ public AgentRun build() { agentId, input, messages, + metadata, status); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java index 2f966b89..584fb2e4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java @@ -45,22 +45,32 @@ public class AgentRunCreate { @JsonProperty("messages") private Optional> messages; + /** + * The metadata to pass to the agent. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional> metadata; + @JsonCreator public AgentRunCreate( @JsonProperty("agent_id") String agentId, @JsonProperty("input") Optional> input, - @JsonProperty("messages") Optional> messages) { + @JsonProperty("messages") Optional> messages, + @JsonProperty("metadata") Optional> metadata) { Utils.checkNotNull(agentId, "agentId"); Utils.checkNotNull(input, "input"); Utils.checkNotNull(messages, "messages"); + Utils.checkNotNull(metadata, "metadata"); this.agentId = agentId; this.input = input; this.messages = messages; + this.metadata = metadata; } public AgentRunCreate( String agentId) { - this(agentId, Optional.empty(), Optional.empty()); + this(agentId, Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -89,6 +99,15 @@ public Optional> messages() { return (Optional>) messages; } + /** + * The metadata to pass to the agent. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; + } + public final static Builder builder() { return new Builder(); } @@ -138,6 +157,24 @@ public AgentRunCreate withMessages(Optional> messages) { return this; } + /** + * The metadata to pass to the agent. + */ + public AgentRunCreate withMetadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + /** + * The metadata to pass to the agent. + */ + public AgentRunCreate withMetadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + @Override public boolean equals(java.lang.Object o) { @@ -151,7 +188,8 @@ public boolean equals(java.lang.Object o) { return Objects.deepEquals(this.agentId, other.agentId) && Objects.deepEquals(this.input, other.input) && - Objects.deepEquals(this.messages, other.messages); + Objects.deepEquals(this.messages, other.messages) && + Objects.deepEquals(this.metadata, other.metadata); } @Override @@ -159,7 +197,8 @@ public int hashCode() { return Objects.hash( agentId, input, - messages); + messages, + metadata); } @Override @@ -167,7 +206,8 @@ public String toString() { return Utils.toString(AgentRunCreate.class, "agentId", agentId, "input", input, - "messages", messages); + "messages", messages, + "metadata", metadata); } public final static class Builder { @@ -177,6 +217,8 @@ public final static class Builder { private Optional> input = Optional.empty(); private Optional> messages = Optional.empty(); + + private Optional> metadata = Optional.empty(); private Builder() { // force use of static builder() method @@ -226,12 +268,31 @@ public Builder messages(Optional> messages) { this.messages = messages; return this; } + + /** + * The metadata to pass to the agent. + */ + public Builder metadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + /** + * The metadata to pass to the agent. + */ + public Builder metadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } public AgentRunCreate build() { return new AgentRunCreate( agentId, input, - messages); + messages, + metadata); } } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java index 036ecf5f..c597c22e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java @@ -17,7 +17,7 @@ public class UploadChatFilesRequest { /** * Raw files to be uploaded for chat in binary format. */ - @SpeakeasyMetadata("multipartForm:name=files") + @SpeakeasyMetadata("multipartForm:file,name=files") private List files; @JsonCreator diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/Multipart.java b/src/main/java/com/glean/api_client/glean_api_client/utils/Multipart.java index d7a751d1..9313e469 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/Multipart.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/Multipart.java @@ -174,8 +174,8 @@ private byte[] computeNext() throws IOException { return null; Part nextPart = iter.next(); if (PartType.STRING.equals(nextPart.type)) { - String part = DASHES + boundary + "\r\n" + "Content-Disposition: form-data; name=" + nextPart.name - + "\r\n" + "Content-Type: text/plain; charset=UTF-8\r\n\r\n" + nextPart.value + "\r\n"; + String part = DASHES + boundary + "\r\n" + "Content-Disposition: form-data; name=\"" + nextPart.name + + "\"\r\n" + "Content-Type: text/plain; charset=UTF-8\r\n\r\n" + nextPart.value + "\r\n"; return part.getBytes(StandardCharsets.UTF_8); } else if (PartType.FINAL_BOUNDARY.equals(nextPart.type)) { return nextPart.value.getBytes(StandardCharsets.UTF_8); @@ -186,8 +186,8 @@ private byte[] computeNext() throws IOException { contentType = APPLICATION_OCTET_STREAM; } currentFileInput = nextPart.stream.get(); - String partHeader = DASHES + boundary + "\r\n" + "Content-Disposition: form-data; name=" - + nextPart.name + "; filename=" + filename + "\r\n" + "Content-Type: " + contentType + String partHeader = DASHES + boundary + "\r\n" + "Content-Disposition: form-data; name=\"" + + nextPart.name + "\"; filename=\"" + filename + "\"\r\n" + "Content-Type: " + contentType + "\r\n\r\n"; return partHeader.getBytes(StandardCharsets.UTF_8); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/RequestBody.java b/src/main/java/com/glean/api_client/glean_api_client/utils/RequestBody.java index 22e27125..c825b0a3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/RequestBody.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/RequestBody.java @@ -9,6 +9,8 @@ import java.lang.reflect.Modifier; import java.net.http.HttpRequest.BodyPublishers; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -128,7 +130,16 @@ private static SerializedBody serializeMultipart(Object value) } if (metadata.file) { - serializeMultipartFile(metadata.name, builder, val); + if (val instanceof List || val.getClass().isArray()) { + // Handle file arrays + List arr = Utils.toList(val); + for (Object item : arr) { + serializeMultipartFile(metadata.name + "[]", builder, item); + } + } else { + // Handle single file + serializeMultipartFile(metadata.name, builder, val); + } } else if (metadata.json) { ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(val); @@ -183,9 +194,21 @@ private static void serializeMultipartFile(String fieldName, Multipart.Builder b if (fileName.isBlank() || content == null) { throw new RuntimeException("Invalid multipart file"); } + + // Detect content type based on file extension + String contentType = "application/octet-stream"; // default fallback + try { + String detectedType = Files.probeContentType(Path.of(fileName)); + if (detectedType != null && !detectedType.isEmpty()) { + contentType = detectedType; + } + } catch (Exception e) { + // If detection fails, use the default fallback + } + byte[] cont = content; builder.addPart(fieldName, () -> new ByteArrayInputStream(cont), fileName, - Optional.of("application/octet-stream")); + Optional.of(contentType)); } public static SerializedBody serializeFormData(Object value) diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java b/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java index a1c1c121..73d862a6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java @@ -27,6 +27,8 @@ public class SpeakeasyHTTPClient implements HTTPClient { private static Consumer logger = System.out::println; + private final HttpClient client = HttpClient.newHttpClient(); + /** * Experimental, may be changed anytime. Sets debug logging on or off for * requests and responses including bodies for JSON content. WARNING: this @@ -65,7 +67,6 @@ public static void setLogger(Consumer logger) { @Override public HttpResponse send(HttpRequest request) throws IOException, InterruptedException, URISyntaxException { - HttpClient client = HttpClient.newHttpClient(); if (debugEnabled) { request = logRequest(request); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java b/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java index 7c021f22..d4d2e3a8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java @@ -1045,6 +1045,10 @@ public static byte[] readBytes(String filename) { return readBytes(new File(filename)); } + public static String readString(String filename) { + return readString(new File(filename)); + } + public static byte[] readBytes(File file) { try { return readBytesAndClose(new FileInputStream(file)); @@ -1053,6 +1057,11 @@ public static byte[] readBytes(File file) { } } + public static String readString(File file) { + byte[] bytes = readBytes(file); + return new String(bytes, StandardCharsets.UTF_8); + } + public static byte[] readBytesAndClose(InputStream in) { try { return readBytes(in);