Skip to content
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

[feature-request] add possibility to work with inputstreams instead of files #7

Open
bilak opened this issue Jun 25, 2020 · 4 comments

Comments

@bilak
Copy link

bilak commented Jun 25, 2020

Hi,
would you be able to provide functionality for parsing *.csv files from input streams instead of files? We are working with dsfinv-k data but just in memory extracting them right from the provided archive files. That probably would be also a requirement for gdpdu-parser.

just note: we are using ByteArrayInputStream to read files multiple times.

Thanks

@lfrancke
Copy link
Member

Thanks for the suggestion. I think that makes sense.

I'll have to think about how that'd fit in.
If you have any suggestions or further use cases please reach out.

@lfrancke
Copy link
Member

What would be a useful method to have?

I assume we're talking about the DsfinvkParser?

This one for example?

public static <T> List<T> parseTable(File indexXml, String tableName, Class<T> clazz, InputStream table) throws ParsingException

There are so many options to chose from. If you let me know what you need I'm sure we can make it work.

@bilak
Copy link
Author

bilak commented Jun 29, 2020

Hi,
I think we should start with conversion of File indexXml to InputStream indexXml. So basically everywhere where file is used currently, just use inputStream instead. Then If you'd like to still have File at method input, it should then load content of file to ByteArrayInputStream and pass data to modified methods.

@lfrancke
Copy link
Member

lfrancke commented Jul 2, 2020

I have added the required functionality in gdpdu-java: https://github.com/opencore/gdpdu-java/blob/3d25ffca7ae1a84a2f913185dbf9c83616d75b6b/gdpdu-data-parser/src/main/java/com/opencore/gdpdu/data/GdpduDataParser.java

It isn't exposed in dsfinvk-java yet but I'll get to that.

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

No branches or pull requests

2 participants