When writing a data indexing batch process in Java, since it is necessary to move all the files under an entire folder, I casually wrote a function and am sharing it here. The code below is commented, so it should be easy to understand.