Taking current directory as input for javaservice and displaying output as files in current dire ...

hai experts,
can anybody tell me how to write a java service so that when we give input a current directory ,the files in directory should be displayed as output in the order of date.please help me as soon as possible.