Skip to content

put overloads accepting WriteLogic#194

Closed
hakanai wants to merge 2 commits intolookfirst:masterfrom
hakanai:put-write-logic
Closed

put overloads accepting WriteLogic#194
hakanai wants to merge 2 commits intolookfirst:masterfrom
hakanai:put-write-logic

Conversation

@hakanai
Copy link
Copy Markdown
Contributor

@hakanai hakanai commented Feb 8, 2015

Instead of using Consumer which is Java 8 only and also forbids throwing an exception, I introduced an interface which can be used with lambdas in Java 8 anyway, but which will still work in earlier versions.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny formatting issue.

@lookfirst
Copy link
Copy Markdown
Owner

Formatting should be tabs, not spaces. Other than that, it looks good.

@hakanai
Copy link
Copy Markdown
Contributor Author

hakanai commented Feb 12, 2015

Rats. I'll fix that. Pretty much every project I work on is the opposite. :)

@lookfirst
Copy link
Copy Markdown
Owner

Shoot.. wrong issue for that last comment that I deleted... please ignore. =)

@hakanai
Copy link
Copy Markdown
Contributor Author

hakanai commented Feb 16, 2015

I will note that I saw some other 4-space indents in SardineImpl. I fixed one of them which made the layout look particularly bad, but there are some other innocuous ones which might be worth doing in a separate commit.

@dkocher
Copy link
Copy Markdown
Collaborator

dkocher commented Dec 14, 2018

This should be handled outside of this library. See for example DAVWriteFeature.

@dkocher dkocher closed this Dec 14, 2018
@hakanai
Copy link
Copy Markdown
Contributor Author

hakanai commented Dec 16, 2018

I took a look, but it isn't clear how I would solve this using their code as an example. They have the luxury of their data already being in a file, and I'm already using a temporary file to work around it today anyway, so it seems like there is nothing I can do to improve things.

@timmc
Copy link
Copy Markdown

timmc commented Sep 20, 2025

I ran into this as well -- I have an encryption function that reads an input stream and writes to an output stream, and I wanted to open a WebDAV connection for that output stream. But I can't, because it only accepts an input stream. So I either have to do it in memory or write to a temp file, neither of which is great for large objects. Or, I have to spin up a thread to pump bytes from one place to another, also not great.

My other pluggable uploaders provide output streams -- file, S3, HTTP, etc. It seems to be the standard way of handling this sort of task in the wider JVM world. Would the maintainers be open to revisiting this?

@lookfirst
Copy link
Copy Markdown
Owner

I agree that a stream based solution would be nicer. @dkocher?

@dkocher
Copy link
Copy Markdown
Collaborator

dkocher commented Sep 21, 2025

I agree that a stream based solution would be nicer. @dkocher?

If I understand the requirement and I agree that would be nice is that the Sardine API should be extended to have an API for PUT that returns an OutputStream to write to.

We have an awkward implementation of org.apache.http.entity.HttpEntity for this purpose to allow protocol implementations to provide an output stream lazily 1.

Maybe after upgrading the dependency 2.

Footnotes

  1. core/src/main/java/ch/cyberduck/core/http/DelayedHttpEntity.java

  2. Update Apache HttpComponents Client dependency adding support for HTTP2. #515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants