microsoftgraph / microsoftgraph/msgraph-sdk-java
Issue: Unable to Process Multiple Emails Simultaneously When Downloading Attachments and Uploading to SharePoint
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 444
- Fork
- 154
- Merge trung bình
- 18 giờ 28 phút
- Pull request đã merge (30 ngày)
- 4
Mô tả
Describe the bug
When trying to download attachments from Outlook while simultaneously uploading files to SharePoint, it is not allowing multiple emails; it only processes one email at a time.
Note: Downloading attachments from a single email to local storage and uploading them to SharePoint is working fine using java graphapi.
Expected behavior
We need a process where, within a single connection, we can download attachments and upload them to SharePoint or directly download attachments to SharePoint using Java Graph API with a client secret and application ID.
How to reproduce
To download file from Outlook.
File file1 = new File(localFolder + "/" + sFileName);
System.out.printin("Path::"+LocalFolder +"/" + sFileName);
File folderTouploaded - new File(tempDownload);
for (File fileTemp : folderTouploaded.listriles()) [
if (fileTemp.isFile()) t
fileTemp.setwritable(true);
Logger-info("Name is :::" + fileTemp.getName());
Logger-info("Path is :::"+ fileTemp.getAbsolutePath());
sharerointconnection.upLoadFiLeToSharepoint(graphclient,sharePointsiterd(),sharePointdriveId(), tempDownload,
uploadPath, fileremp.getName(),file1);
deleterile(tempDownload +"/" +fileTemp.getName().tostring());
//To upload file-
Path srcFilePath = Paths.get(srcFolderName + "I" + fileName);
Logger.info("Checking::"+srcFolderName + "I" + fileName);
byte[] srcFileBytes = Files.readAtlBytes(srcfilePath);
DriveItem uploadedItem = drivertemRequestBuilden.content().buildRequest().put(srcFileBytes);
SDK Version
No response
Latest version known to work for scenario above?
No response
Known Workarounds
No response
DEBUG]
LINFO
[INFO
4043-03-40 02120.04 s8u (MailLocal.java:680) - Path is :::D:\myfolder\sharePoint_TestingFiles\Emai
2025-03-20 09:26:04.380 (SharePointConnection.java:268) - Process started::
2025-03-20 09:26:04.380 (SharePointConnection.java:270) - Dest folder name::myfolder\Data\save
2025-03-20 09:26:04.380 (SharePointConnection.iava:271) - SharePointId:test.sharepoint.com,e76d765-86fe-
2025-03-20 09:26:04.3 (SharePointConnection.java:272) - Dest file name::myfolder\Data\save
2025-03-20 09:26:04.381 (SharePointConnection.java:297) - Process completed::
at EmailLocal.lambda$1(EmailLocal.iava:681
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown_Source)
at java.util.stream.Referenceipeline$2$1.accept(Unknown Source)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.util.stream.ForEachOps$ForEachOpfOfRef.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown
</details>
### Configuration
_No response_
### Other information
_No response_
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với lệnh gọi xử lý tệp đính kèm tại MailLocal.java:680 và luồng tải lên được ghi log từ SharePointConnection.java:268-297. Tái hiện việc tải xuống tệp đính kèm từ Outlook và tải lên SharePoint bằng Java Graph API, sau đó xác minh rằng một kết nối xử lý các tệp đính kèm từ nhiều email và tải chúng lên thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api, cloud
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100