[INCOMPATIBLE CHANGE] Refactor file upload related APIs
Remove deps for commons-collections4.