It seems that fs.globStatus(p) will not return null. If p does not exist, it returns an empty array. So, we only have to check whether inputs.length > 0. If inputs.length > 0, add all paths to the list. If inputs.length == 0, add an IOException to rslt (we don't have to check !fs.exists(p) again).

Tsz Wo Nicholas Sze
added a comment - 17/Apr/09 20:43 It seems that fs.globStatus(p) will not return null. If p does not exist, it returns an empty array. So, we only have to check whether inputs.length > 0. If inputs.length > 0, add all paths to the list. If inputs.length == 0, add an IOException to rslt (we don't have to check !fs.exists(p) again).
Also, could you add a test?

Rodrigo Schmidt
added a comment - 21/May/09 21:29 An ArrayList might not be the best data structure to unglob the input sources, as the internal array will be re-sized for every new entry we add. A LinkedList would fit better.