Skip to content

Commit 2029a27

Browse files
authored
Upgraded OkHttp dependency from 3.14.5 to 4.12.0 (#290)
# Changes - [x] Upgraded OkHttp dependency from 3.14.5 to 4.12.0 # License <!-- Your PR comment must contain the following line for us to merge the PR. --> I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.
1 parent 454bcb2 commit 2029a27

33 files changed

+609
-134
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Nylas Java SDK Changelog
22

3+
## [Unreleased]
4+
5+
### Changed
6+
* Upgraded OkHttp dependency from 3.14.5 to 4.12.0
7+
38
## [2.11.1] - Release 2025-07-11
49

510
### Added

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ dependencies {
2929
// ////////////////////////////////
3030
// Public dependencies
3131

32-
// OkHttp 3 - Http client (without Kotlin dependency of version 4)
33-
api("com.squareup.okhttp3:okhttp:3.14.5")
32+
// OkHttp 4 - Http client
33+
api("com.squareup.okhttp3:okhttp:4.12.0")
3434

3535
// Moshi JSON library
3636
implementation("com.squareup.moshi:moshi:1.15.0")

examples/.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ NYLAS_API_URI=https://api.us.nylas.com
1212

1313
# Grant ID - Required for message and event examples
1414
# You can get this from your Nylas Dashboard after connecting an account
15-
NYLAS_GRANT_ID=your_grant_id_here
15+
NYLAS_GRANT_ID=your_grant_id_here
16+
17+
# Test email
18+
NYLAS_TEST_EMAIL=your@email.com

examples/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ help:
1010
@echo " java-notetaker - Run the Java Notetaker example"
1111
@echo " java-events - Run the Java Events example"
1212
@echo " java-folders - Run the Java Folders example"
13+
@echo " java-large-attachments - Run the Java Large Attachments example"
1314
@echo " kotlin-notetaker - Run the Kotlin Notetaker example"
1415
@echo " kotlin-folders - Run the Kotlin Folders example"
1516

@@ -21,6 +22,12 @@ list:
2122
java-notetaker:
2223
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.NotetakerExample
2324

25+
java-messages:
26+
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.MessagesExample
27+
28+
java-large-attachments:
29+
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.LargeAttachmentsExample
30+
2431
java-events:
2532
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.EventsExample
2633

examples/README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ The `FoldersExample` and `KotlinFoldersExample` demonstrate how to use the Nylas
4040
- Demonstrate the builder pattern with various query parameters
4141
- Show folder details including parent relationships and unread counts
4242

43+
### Large Attachments Example
44+
45+
The `LargeAttachmentsExample` demonstrates how to send emails with large file attachments using the Nylas Java SDK:
46+
47+
- Create and send emails with 3MB and 10MB test files
48+
- Demonstrate the SDK's automatic handling of large attachments (switches to multipart form data for files ≥ 3MB)
49+
- Send multiple large attachments in a single email
50+
- Compare small vs large attachment handling mechanisms
51+
- Use the `FileUtils.attachFileRequestBuilder()` helper method for easy file attachment
52+
- Automatic cleanup of temporary test files
53+
4354
## Setup
4455

4556
### 1. Environment Setup
@@ -58,6 +69,9 @@ NYLAS_API_KEY=your_api_key_here
5869
# Your grant ID (required for message examples)
5970
NYLAS_GRANT_ID=your_grant_id_here
6071
72+
# Test email address (required for large attachments example)
73+
NYLAS_TEST_EMAIL=test@example.com
74+
6175
# Add your meeting link (Zoom, Google Meet, or Microsoft Teams) - for Notetaker example
6276
MEETING_LINK=your_meeting_link_here
6377
```
@@ -101,6 +115,11 @@ Run Kotlin Folders example:
101115
./gradlew :examples:run -PmainClass=com.nylas.examples.KotlinFoldersExampleKt
102116
```
103117

118+
Run Java Large Attachments example:
119+
```bash
120+
./gradlew :examples:run -PmainClass=com.nylas.examples.LargeAttachmentsExample
121+
```
122+
104123
#### Option 2: Using the Makefile
105124

106125
List available examples:
@@ -127,6 +146,7 @@ make kotlin-way
127146
- `KotlinMessagesExample.kt` (Kotlin - demonstrates new message features)
128147
- `EventsExample.java` (Java - demonstrates events)
129148
- `FoldersExample.java` (Java - demonstrates folders and single_level parameter)
149+
- `LargeAttachmentsExample.java` (Java - demonstrates large file attachments)
130150
- `NotetakerExample.java` (Java - demonstrates notetakers)
131151
- `KotlinNotetakerExample.kt` (Kotlin - demonstrates notetakers)
132152
- `KotlinFoldersExample.kt` (Kotlin - demonstrates folders and single_level parameter)
@@ -143,10 +163,11 @@ examples/
143163
└── main/
144164
├── java/ # Java examples
145165
│ └── com/nylas/examples/
146-
│ ├── MessagesExample.java # NEW: Message features demo
147-
│ ├── EventsExample.java # Events API demo
148-
│ ├── FoldersExample.java # NEW: Folders API demo with single_level parameter
149-
│ └── NotetakerExample.java # Notetaker API demo
166+
│ ├── MessagesExample.java # NEW: Message features demo
167+
│ ├── EventsExample.java # Events API demo
168+
│ ├── FoldersExample.java # NEW: Folders API demo with single_level parameter
169+
│ ├── LargeAttachmentsExample.java # NEW: Large file attachments demo
170+
│ └── NotetakerExample.java # Notetaker API demo
150171
└── kotlin/ # Kotlin examples
151172
└── com/nylas/examples/
152173
├── KotlinMessagesExample.kt # NEW: Message features demo

examples/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ tasks.register("listExamples") {
5555
println("- Java-Events: com.nylas.examples.EventsExample")
5656
println("- Java-Messages: com.nylas.examples.MessagesExample")
5757
println("- Java-Folders: com.nylas.examples.FoldersExample")
58+
println("- Java-Large-Attachments: com.nylas.examples.LargeAttachmentsExample")
5859
println("- Kotlin-Notetaker: com.nylas.examples.KotlinNotetakerExampleKt")
5960
println("- Kotlin-Messages: com.nylas.examples.KotlinMessagesExampleKt")
6061
println("- Kotlin-Folders: com.nylas.examples.KotlinFoldersExampleKt")

0 commit comments

Comments
 (0)