Sardine.put on a locked resource #380
Replies: 4 comments
-
This is possible as of 73ccb7e which allows to pass any additional headers. |
Beta Was this translation helpful? Give feedback.
-
Yes but it is not very easy for a user to use. They would need to manually add the lock metadata there. |
Beta Was this translation helpful? Give feedback.
-
Hi @lasselindqvist, as David says, Sardine allows this pretty easily by allowing you to pass in whatever headers you need. If you'd like an easier interface, you're welcome to wrap yours around the core library. Adding more methods and overloads for this one feature doesn't seem applicable, but I'm open to further discussion on reasoning. |
Beta Was this translation helpful? Give feedback.
-
If the vision is to stay quite low level I think that is fine, and maybe then what could be is to add lock usage to the examples. Somewhat related to this, I did think about AutoCloseable and Sardine. Sardine uses Apache HttpClient which is thread-safe and Sardine object should be mostly too then I guess. Although it has HttpClientContext field which is not totally thread safe. If it was AutoCloseable, or had AutoCloseable locks, something like
or
would be possible. AutoCloseable and/or some kind of context keeping would make things like these possible. But then again, maybe it is not intended for this library, but for some higher-level one. |
Beta Was this translation helpful? Give feedback.
-
It would be useful if Sardine could do a put call on a locked resource.
Now there is no way to pass the lockToken to the put call and this the user flow of
is not possible.
Sardine.put has many overloads and many methods that take Strings as input.
Might be worth considering turning the Sardine.lock method into a method that returns a Lock-object. (new interface). It could have a now just a one method, getToken(), but could also support getExpiration etc. methods in future. (There is of course the XML class Lockinfo which we might not want to directly expose for the client)
Then we could add Sardine.put(String url, Lock lock) method for calling put with a lock.
Beta Was this translation helpful? Give feedback.
All reactions