Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Foster
committed
Jul 23, 2019
1 parent
7e2b180
commit 8b677a9
Showing
6 changed files
with
46 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Extension { #name : #ZnEasy } | ||
|
||
{ #category : #'*Graphics-Files' } | ||
ZnEasy class >> getImageOfType: mimeType fromUrl: urlObject [ | ||
| client | | ||
(client := self client) | ||
url: urlObject; | ||
accept: mimeType; | ||
enforceHttpSuccess: true; | ||
enforceAcceptContentType: true; | ||
get. | ||
"ImageReadWriter does automatic type detection" | ||
^ ImageReadWriter formFromStream: client entity readStream | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Extension { #name : #MIMEDocument } | ||
|
||
{ #category : #'*Network-Mail' } | ||
MIMEDocument >> parts [ | ||
"Return the parts of this message. There is a far more reliable implementation of parts in MailMessage, but for now we are continuing to use this implementation" | ||
| parseStream currLine separator msgStream messages | | ||
self isMultipart ifFalse: | ||
[ ^ #() ]. | ||
parseStream := self content readStream. | ||
currLine := ''. | ||
[ '--*' match: currLine ] whileFalse: [ currLine := parseStream nextLine ]. | ||
separator := currLine copy. | ||
msgStream := LimitingLineStreamWrapper | ||
on: parseStream | ||
delimiter: separator. | ||
messages := OrderedCollection new. | ||
[ parseStream atEnd ] whileFalse: | ||
[ messages add: msgStream upToEnd. | ||
msgStream skipThisLine ]. | ||
^ messages collect: [ :e | MailMessage from: e ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters