Skip to content

Commit deddb4d

Browse files
authored
Merge pull request #681 from microsoftgraph/feature/large-rename
feature/large rename
2 parents 854c10d + c8efc99 commit deddb4d

File tree

4 files changed

+43
-11
lines changed

4 files changed

+43
-11
lines changed

docs/upgrade-to-v3.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,36 @@ This new version improves the Java API provided to developers. To upgrade your a
224224
225225
> Note: the `DeltaCollectionPage` also offers a `getNextPage` method which simplifies iterating through results and removes the need for consumers to directly handle the next link themselves.
226226
227+
### ChunkedUploadProvider renamed to LargeFileUploadTask
228+
229+
The chunked upload provider has been renamed to larg file upload task and moved from the concurrency package to the tasks package in order to align with SDK design specifications and to clarify the intent of the class. To upgrade your application do the following.
230+
231+
- Replace any of the following
232+
233+
```Java
234+
import com.microsoft.graph.concurrency.ChunkedUploadProvider;
235+
```
236+
237+
By
238+
239+
```Java
240+
import com.microsoft.graph.tasks.LargeFileUploadTask;
241+
```
242+
243+
- Replace any of the following
244+
245+
```Java
246+
final DriveItem result = chunkedUploadProvider.upload();
247+
```
248+
249+
By
250+
251+
```Java
252+
final LargeFileUploadResult<DriveItem> result = largeFileUploadTask.upload();
253+
```
254+
255+
> Note: The **LargeFileUploadTask** now also provides an **uploadAsync** method to perform uploads in the background.
256+
227257
## Upgrade guide for non-breaking improvments
228258
229259
This section lists out other improvements which are not considered as breaking changes. SDK users are strongly encouraged to take advantage of those new improvements to simplify their code.

src/main/java/com/microsoft/graph/models/UploadSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/**
2323
* The class for the Upload Session.
2424
*/
25-
public class UploadSession implements IJsonBackedObject, com.microsoft.graph.concurrency.IUploadSession {
25+
public class UploadSession implements IJsonBackedObject, com.microsoft.graph.tasks.IUploadSession {
2626

2727
/** the OData type of the object as returned by the service */
2828
@SerializedName("@odata.type")

src/test/java/com/microsoft/graph/functional/OneDriveTests.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
import org.junit.jupiter.api.Test;
1515

1616
import com.google.gson.JsonPrimitive;
17-
import com.microsoft.graph.concurrency.ChunkedUploadProvider;
18-
import com.microsoft.graph.concurrency.IProgressCallback;
17+
import com.microsoft.graph.tasks.LargeFileUploadTask;
18+
import com.microsoft.graph.tasks.LargeFileUploadResult;
19+
import com.microsoft.graph.tasks.IProgressCallback;
1920
import com.microsoft.graph.core.ClientException;
2021
import com.microsoft.graph.http.CoreHttpProvider;
2122
import com.microsoft.graph.models.DriveItem;
@@ -60,14 +61,14 @@ public void testLargeFileUpload() throws IOException, InterruptedException {
6061
.createUploadSession(DriveItemCreateUploadSessionParameterSet.newBuilder().withItem(new DriveItemUploadableProperties()).build())
6162
.buildRequest()
6263
.post();
63-
ChunkedUploadProvider<DriveItem> chunkedUploadProvider = new ChunkedUploadProvider<DriveItem>(
64+
LargeFileUploadTask<DriveItem> chunkedUploadProvider = new LargeFileUploadTask<DriveItem>(
6465
uploadSession,
6566
testBase.graphClient,
6667
uploadFile,
6768
fileSize,
6869
DriveItem.class);
6970

70-
final DriveItem result = chunkedUploadProvider.upload(0, null, callback);
71+
final LargeFileUploadResult<DriveItem> result = chunkedUploadProvider.upload(0, null, callback);
7172
assertNotNull(result);
7273
}
7374
@Test
@@ -95,14 +96,14 @@ public void downloadJsonFileFromOneDrive() throws Exception {
9596
.buildRequest()
9697
.post();
9798

98-
ChunkedUploadProvider<DriveItem> chunkedUploadProvider = new ChunkedUploadProvider<DriveItem>(
99+
LargeFileUploadTask<DriveItem> chunkedUploadProvider = new LargeFileUploadTask<DriveItem>(
99100
session,
100101
testBase.graphClient,
101102
uploadFile,
102103
fileSize,
103104
DriveItem.class);
104105

105-
final DriveItem result = chunkedUploadProvider.upload(0, null, callback);
106+
final LargeFileUploadResult<DriveItem> result = chunkedUploadProvider.upload(0, null, callback);
106107
assertNotNull(result);
107108

108109
final InputStream stream = testBase.graphClient.me()

src/test/java/com/microsoft/graph/functional/OutlookTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727

2828
import com.google.gson.JsonObject;
2929

30-
import com.microsoft.graph.concurrency.ChunkedUploadProvider;
31-
import com.microsoft.graph.concurrency.IProgressCallback;
30+
import com.microsoft.graph.tasks.LargeFileUploadTask;
31+
import com.microsoft.graph.tasks.LargeFileUploadResult;
32+
import com.microsoft.graph.tasks.IProgressCallback;
3233
import com.microsoft.graph.core.ClientException;
3334
import com.microsoft.graph.http.BaseCollectionPage;
3435
import com.microsoft.graph.models.Attachment;
@@ -320,11 +321,11 @@ public void testSendDraftWithLargeAttachements() throws FileNotFoundException, I
320321
.buildRequest()
321322
.post();
322323

323-
ChunkedUploadProvider<AttachmentItem> chunkedUploadProvider = new ChunkedUploadProvider<>(uploadSession, testBase.graphClient, fileStream,
324+
LargeFileUploadTask<AttachmentItem> chunkedUploadProvider = new LargeFileUploadTask<>(uploadSession, testBase.graphClient, fileStream,
324325
streamSize, AttachmentItem.class);
325326

326327
// Do the upload
327-
final AttachmentItem result = chunkedUploadProvider.upload(0, null, callback);
328+
final LargeFileUploadResult<AttachmentItem> result = chunkedUploadProvider.upload(0, null, callback);
328329
assertNotNull(result);
329330

330331
//Send the drafted message

0 commit comments

Comments
 (0)