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

pom.xml:107-109: Get rid of commons-io dependency,... #16

Closed
dmarkov opened this issue Mar 13, 2014 · 7 comments
Closed

pom.xml:107-109: Get rid of commons-io dependency,... #16

dmarkov opened this issue Mar 13, 2014 · 7 comments

Comments

@dmarkov
Copy link

dmarkov commented Mar 13, 2014

Puzzle 2-b54ace9f in pom.xml:107-109 has to be resolved: Get rid of commons-io dependency, or move it to "test" scope. It's not efficient for such a small and lightweight library to have a big dependency of this kind.

@carlosmiranda
Copy link
Contributor

I know we hate util classes, so what would be the best way of replicating the various IOUtils.toString and FileUtils.toString methods?

I'm thinking of introducing a new package-private class TextResource, which would have four public constructors (reflecting what we use in jcabi-xml):
*TextResource(InputStream stream)
*TextResource(File file)
*TextResource(URL url)
*TextResource(URI uri)

So that, the following uses of commons-io would be:
*IOUtils.toString(stream) -> new TextResource(stream).toString()
*IOUtils.toString(url) -> new TextResource(url).toString()
*IOUtils.toString(uri) -> new TextResource(uri).toString()
*FileUtils.toString(file) -> new TextResource(file).toString()

What do you think?

@yegor256
Copy link
Member

The idea is perfect, and the name TextResource is correct, let's do it.

carlosmiranda added a commit to carlosmiranda/jcabi-xml that referenced this issue Mar 14, 2014
carlosmiranda added a commit to carlosmiranda/jcabi-xml that referenced this issue Mar 14, 2014
@carlosmiranda
Copy link
Contributor

I created a pull request for it at #18, please review.

carlosmiranda added a commit to carlosmiranda/jcabi-xml that referenced this issue Mar 14, 2014
ghost pushed a commit that referenced this issue Mar 14, 2014
#18: pull request Issue #16 Moved commons-io to test scope and migrated to TextResource
@dmarkov
Copy link
Author

dmarkov commented Mar 14, 2014

@carlosmiranda the task is for you now, follow these guidelines. Don't hesitate to ask any technical questions right here

@dmarkov
Copy link
Author

dmarkov commented Mar 14, 2014

@carlosmiranda The budget here is 30 mins, which is exactly how much time will be paid for, when the task is completed

@dmarkov
Copy link
Author

dmarkov commented Mar 14, 2014

@carlosmiranda I added 30 mins to your account, many thanks for working with the project!

@dmarkov
Copy link
Author

dmarkov commented Mar 17, 2014

Finished, thanks, closing..

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

No branches or pull requests

3 participants