google-code-export / uimafit

Automatically exported from code.google.com/p/uimafit
2 stars 1 forks source link

consider removing Files.java #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Philip:
looks like apache commons io project has all the iterators for files we
could hope for.  I'm not sure why Files.java was put in this project in the
first place (actually, I know why....)  Regardless, it doesn't belong here
and if the same functionality is availabl in apache commons, then we should
use that instead.

See
http://commons.apache.org/io/api-release/index.html?org/apache/commons/io/IOUtil
s.html

in particular the iterateFiles methods.

Richard:
So far there is no dependency on commons-io. Are you sure you want to
introduce this dependency?

Philip:
Generally speaking, I think it is best to replace homegrown code with
(presumably)
widely used, high quality, apache-supported code whenever possible.  I am more
concerned with minimizing the amount of code we support than with how many
dependencies we have (thought I recognize the drawback of being too
careless in this
regards.)  Especially when maven makes it so easy to manage dependencies.

That said, Files.java is used by one test class LicenseTest - so it does
seem wrong
to introduce a new dependency just for that.  Files.java is widely used by
ClearTK. 
I think it probably makes more sense to paste whatever code LicenseTest
needs into
that class file and then remove Files.java from uutuc.  ClearTK can then
introduce a
dependency on commons-io or reintroduce Files.java as it sees fit.  

Richard:
I am changing my mind a bit here. Recently I have looked a bit more into
the functionality provided by different 
Apache Commons jars, and I think they are sufficiently common and stable as
to not worry too much about 
depending on them.

Philip:
yeah - I have on many occasions found stuff in there that I have already
written -
except that it is better than what I did.  I'm starting to get in the habit of
looking in there first before writing some bit of utility code.  

Original issue reported on code.google.com by pvogren@gmail.com on 1 May 2010 at 3:09

GoogleCodeExporter commented 9 years ago

Original comment by pvogren@gmail.com on 1 May 2010 at 5:39

GoogleCodeExporter commented 9 years ago
  I removed Files.java and updated LicenseTest to use the apache commons io FileUtils.iterateFiles and it works fine.  I manually tested that LicenseTest is working correctly.  

Original comment by pvogren@gmail.com on 11 Jun 2010 at 6:05