Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bayernId-proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
bayernId-proxy
Commits
64d66f3b
Commit
64d66f3b
authored
11 months ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-5636 refactor buildAttachment method
parent
c0f8fdf5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bayernid-proxy-impl/src/main/java/de/ozgcloud/nachrichten/postfach/bayernid/proxy/UploadStreamObserver.java
+7
-7
7 additions, 7 deletions
...richten/postfach/bayernid/proxy/UploadStreamObserver.java
with
7 additions
and
7 deletions
bayernid-proxy-impl/src/main/java/de/ozgcloud/nachrichten/postfach/bayernid/proxy/UploadStreamObserver.java
+
7
−
7
View file @
64d66f3b
...
...
@@ -47,8 +47,6 @@ import lombok.extern.log4j.Log4j2;
@RequiredArgsConstructor
public
class
UploadStreamObserver
implements
StreamObserver
<
GrpcSendBayernIdMessageRequest
>
{
static
final
String
ATTACHMENT_FILE_SUFFIX
=
".ozg-cloud.tmp"
;
private
final
StreamObserver
<
GrpcSendBayernIdMessageResponse
>
responseObserver
;
private
final
BayernIdProxyService
proxyService
;
private
final
BayernIdMessageMapper
messageMapper
;
...
...
@@ -82,15 +80,17 @@ public class UploadStreamObserver implements StreamObserver<GrpcSendBayernIdMess
}
Attachment
buildAttachment
(
GrpcAttachmentMetadata
attachmentMetadata
)
{
InputStream
temporallyFile
;
try
{
temporallyFile
=
createTemporallyFile
();
}
catch
(
IOException
e
)
{
throw
new
TechnicalException
(
"Can not create temporary file for attachment "
+
attachmentMetadata
.
getFileName
(),
e
);
}
return
Attachment
.
builder
()
.
name
(
attachmentMetadata
.
getFileName
())
.
type
(
attachmentMetadata
.
getFileType
())
.
content
(
createT
emporallyFile
()
)
.
content
(
t
emporallyFile
)
.
build
();
}
catch
(
IOException
e
)
{
throw
new
TechnicalException
(
"Can not create temporary file for attachment "
+
attachmentMetadata
.
getFileName
(),
e
);
}
}
InputStream
createTemporallyFile
()
throws
IOException
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment