Fetch all the sub folder name in the given path in java component

I have root folder(called X) inside I have sub folder A,B,C…,. Each subfolder contain many folder(suppose A contains i,j,k and B contains l, m,n) inside. Need to fetch these folder name(ex : i,j,k if I selected A ) in the array using java.
Can any one help.