views:

68

answers:

1

I have a set of mp3 files on my computer which i want to be the server. Now i have a web service(Songs_Collection). This web service returns the list of all songs present on the server to the user.The user can download the desired file directly from the server.

I have a small problem :

How does my web service get the list of audio files kept on the server in the folder c:\Audio Files.

Someone suggested that i need to keep the names in a "Web Content" folder, but can anyone suggest how should i approach it?

I worked out on this part . But now how do I send it to the client on device ?

Can i send it directly as an array? (I guess then some seriliazation-deserialization needs to be done. please suggest)
Or If send it as an XML file then how should I proceed? (This is more important)

A: 

This is working perfectly fine :
for-

public static void main(String[] args) {
    File directory=new File("C:/copyimages");
    String filename[] = directory.list();

    for (int i = 0; i < filename.length; i++) {
        System.out.println("\n");
        String listFilenames = filename[i];
        System.out.print(listFilenames);
    }
}
AceAbhi