-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow use of java.nio.file.Path
for readValue()
, writeValue()
#2013
Comments
|
No, i'm not about serialization/deserialization, i'm about |
java.nio.file.Path
for readValue()
, writeValue()
@XakepSDK Ah! Yes that makes more sense. Since this is API addition, will need to go in 3.0. But makes sense, the only (?) concern is large number of potential overloads. But I can see whether it should be added to just |
I know nothing about the innards of Jackson, but you cannot deserialize |
@michael-o I think this would not be about deserializing |
@cowtowncoder Are you certain? The discussion is about serializers and not JSON readers. |
@michael-o cowtowcoder is correct |
You should improve your description to make this clear. |
Is this a big change? As Path and File are arbitrary interchangeable one method might simply be a delegate to the other method:
|
@sdoeringNew No, it is not a difficult thing to do at all -- the only possible concern is that the API size for |
Great. I'd be happy to add the PR. 👍 |
Ideally the new methods would not use I maintain an application that uses Jackson to interact with both of those types of file systems. If you added methods that accept I'd think it would be better if the public void writeValue(Path resultPath, Object value) throws IOException, JsonGenerationException, JsonMappingException {
try (OutputStream out = Files.newOutputStream(resultPath)) {
writeValue(out, value);
}
} |
Yeah, well, if I can't use If I want to do it right and neat like this:
The Of course I could delegate it:
But that seems rather ugly if there is a whole factory dedicated to this kind of operation. Ideas? |
I'm not following this part. What factory do you mean? The second My reading of |
Yes, So I guess it is possible to have different implementation for 2.13 vs 3.0 -- I would start with 2.13. |
I've started with 3.0 and added pull requests for jackson-core and jackson-databind. I'm unsure about adding it to 2.13, though. It would be a half-heartedly support for But if you say so I'll add it "workaround-ish" to 2.13. |
java.nio.file.Path
for readValue()
, writeValue()
java.nio.file.Path
for readValue()
, writeValue()
Merged to |
Version 2.9.5
There is no out of box method to read from
Path
and write toPath
, it will be usefull to make these methods.The text was updated successfully, but these errors were encountered: