Re: Read every file in a directory at once

2016-02-25 Thread Stephan Ewen
Thanks for sharing this solution! On Thu, Feb 18, 2016 at 4:02 PM, Flavio Pompermaier wrote: > My current solution is: > > List paths = new ArrayList(); > File dir = new File(BASE_DIR); > for (File f : dir.listFiles()) { > paths.add(f.getName()); > } > DataSet mail = env.fromCollection(pa

Re: Read every file in a directory at once

2016-02-18 Thread Flavio Pompermaier
My current solution is: List paths = new ArrayList(); File dir = new File(BASE_DIR); for (File f : dir.listFiles()) { paths.add(f.getName()); } DataSet mail = env.fromCollection(paths).map(new FileToString(BASE_DIR)). The FileToString does basically a map that return FileUtils.toString(new

Read every file in a directory at once

2016-02-18 Thread Flavio Pompermaier
Hi to all, I want to apply a map function to every file in a folder. Is there an easy way (or an already existing InputFormat) to do that? Best, Flavio