-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement MS Graph SDK #8103
Implement MS Graph SDK #8103
Conversation
filesystem/src/main/java/org/frankframework/filesystem/exchange/MailFolderResponse.java
Dismissed
Show resolved
Hide resolved
filesystem/src/main/java/org/frankframework/filesystem/exchange/MailMessageResponse.java
Dismissed
Show resolved
Hide resolved
# Conflicts: # filesystem/src/test/java/org/frankframework/filesystem/FileSystemActorTest.java
public static final FileSystemAction[] ACTIONS_BASIC= {FileSystemAction.CREATE, FileSystemAction.LIST, FileSystemAction.INFO, FileSystemAction.READ, FileSystemAction.DOWNLOAD, FileSystemAction.READDELETE, FileSystemAction.MOVE, FileSystemAction.COPY, FileSystemAction.DELETE, FileSystemAction.MKDIR, FileSystemAction.RMDIR}; | ||
public static final FileSystemAction[] ACTIONS_WRITABLE_FS= {FileSystemAction.WRITE, FileSystemAction.UPLOAD, FileSystemAction.APPEND, FileSystemAction.RENAME}; | ||
public static final FileSystemAction[] ACTIONS_BASIC= {FileSystemAction.LIST, FileSystemAction.INFO, FileSystemAction.READ, FileSystemAction.DOWNLOAD, FileSystemAction.READDELETE, FileSystemAction.MOVE, FileSystemAction.COPY, FileSystemAction.DELETE, FileSystemAction.MKDIR, FileSystemAction.RMDIR}; | ||
public static final FileSystemAction[] ACTIONS_WRITABLE_FS= {FileSystemAction.CREATE, FileSystemAction.WRITE, FileSystemAction.UPLOAD, FileSystemAction.APPEND, FileSystemAction.RENAME}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create was part of the basic filesystem?
@@ -77,7 +71,7 @@ public void configure() throws ConfigurationException { | |||
attachmentXml.addAttribute("contentType", withAttachments.getAttachmentContentType(attachment)); | |||
attachmentXml.addAttribute("size", withAttachments.getAttachmentSize(attachment)); | |||
attachmentXml.addAttribute("filename", withAttachments.getAttachmentFileName(attachment)); | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan dit eruit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nee nog liever niet.
} | ||
|
||
/** Silly wrapper to create a clean SDK */ | ||
public class GraphClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan static zijn
filesystem/src/main/java/org/frankframework/filesystem/exchange/MailFolder.java
Outdated
Show resolved
Hide resolved
filesystem/src/main/java/org/frankframework/filesystem/exchange/MailMessage.java
Show resolved
Hide resolved
} | ||
} | ||
|
||
private static URI validateNextLink(String nextLink) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate van org.frankframework.filesystem.exchange.MailFolderResponse#validateNextLink
- kan dit evt in ExchangeFileSystem
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sonar is boos; behalve de lage coverage heeft Sonar ook nog heel wat opmerkingen over kleine dingen die op zich wel terecht lijken.
Zou je daar misschien nog wat aan kunnen doen?
filesystem/src/main/java/org/frankframework/filesystem/MsalClientAdapter.java
Outdated
Show resolved
Hide resolved
filesystem/src/main/java/org/frankframework/receivers/ExchangeMailListener.java
Show resolved
Hide resolved
filesystem/src/test/java/org/frankframework/xml/StaxParserTest.java
Outdated
Show resolved
Hide resolved
folders.addAll(response.folders); | ||
|
||
if (StringUtils.isNotBlank(response.nextLink) && limit > 0) { | ||
getRecursive(client, validateNextLink(response.nextLink), folders, limit - MAX_ENTRIES_PER_CALL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je had het vorige week over tail-recursion, maar dit is niet echte tail-recursion... 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dat is toch het doel? Niet genest recursie hebben?
List<MailFolder> folders = client.getMailFolders(mailAddress); | ||
MailFolder foundMailFolder = folders.stream() | ||
.filter(t -> rootFolder.equalsIgnoreCase(t.getName())) | ||
.findFirst() | ||
.orElseThrow(() -> { | ||
throw new LifecycleException("unable to find folder [%s] in mailbox [%s]".formatted(rootFolder, mailAddress)); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je haalt hiermee max 20 folders op. Als een mailbox meer dan 20 folders heeft, en de folder die je zoekt zit niet in de eerste 20, dan vind je die dus nooit en kan je nooit het FS openen -- ondanks dat de folder eigenlijk wel bestaat.
Wil je aan dit probleem nog iets doen in dit PR? Of in een volgend PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 per request, en 20 requests :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In de orElseThrow
hoor je trouwens niet zelf te throwen, alleen de new Exception
terug te geven.
Quality Gate failedFailed conditions |
No description provided.