hi,
i want to do one thing that if u have any number of subdirectory the mp3 files within these subdirectories should be access in a single click.(i.e file:///E:/1/2/....n level)
here is my code it gives you the particular file within subdirectories (.mp3 or etc) upto 5 level(subdirectories i.e E:/>song->song1>song2>song3>song4).

all files within these folders can be got.

my queries>
1.how can i make this best that it works for n number of subdirectories?
2.is there any other way that i can achieve this?
Code:
	public void getFileList(String path) {
		addDirectory=new Vector();
		addtoScreen=new Vector();
		try
		{
			FileConnection fileConn=(FileConnection)Connector.open(path,Connector.READ);
			Enumeration directoryList=fileConn.list("*",true);
			while (directoryList.hasMoreElements()) {
				addDirectory.addElement(directoryList.nextElement());
			}
			for(int i=0;i<addDirectory.size();i++)
			{
				FileConnection level1=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString(),Connector.READ);
				if(level1.getURL().endsWith(".mp3")||level1.getURL().endsWith("MP3"))
				{
					addtoScreen.addElement(addDirectory.elementAt(i).toString());
					pathUrl.addElement(path+addDirectory.elementAt(i));
				}
				else
				{
					FileConnection level2=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString(),Connector.READ);
					Enumeration subdirectoryList=level2.list("*",true);
					while(subdirectoryList.hasMoreElements())
					{
						String currentDir=(String)subdirectoryList.nextElement();
						FileConnection level3=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir,Connector.READ);
						if(level3.getURL().endsWith(".mp3")||level3.getURL().endsWith("MP3"))
						{
							addtoScreen.addElement(currentDir);
							pathUrl.addElement(path+addDirectory.elementAt(i).toString()+currentDir);
						}
						else
						{
							FileConnection level4=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir,Connector.READ);
							Enumeration subdirectoryList1=level4.list("*",true);
							while(subdirectoryList1.hasMoreElements())
							{
								String currentDir1=(String)subdirectoryList1.nextElement();
								FileConnection level5=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1,Connector.READ);
								if(level5.getURL().endsWith(".mp3")||level5.getURL().endsWith("MP3"))
								{
									addtoScreen.addElement(currentDir1);
									pathUrl.addElement(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1);
								}
								else
								{
									FileConnection level6=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1,Connector.READ);
									Enumeration subdirectoryList2=level6.list("*",true);
									while(subdirectoryList2.hasMoreElements())
									{
										String currentDir2=(String)subdirectoryList2.nextElement();
										FileConnection level7=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2,Connector.READ);
										if(level7.getURL().endsWith(".mp3")||level7.getURL().endsWith("MP3"))
										{
											addtoScreen.addElement(currentDir2);
											pathUrl.addElement(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2);
										}
										else
										{
											FileConnection level8=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2,Connector.READ);
											Enumeration subdirectoryList3=level8.list("*",true);
											while (subdirectoryList3.hasMoreElements()) {
												String currentDir3=(String)subdirectoryList3.nextElement();
												FileConnection level9=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2+currentDir3,Connector.READ);
												if(level9.getURL().endsWith(".mp3") || level9.getURL().endsWith("MP3"))
												{
													addtoScreen.addElement(currentDir3);
													pathUrl.addElement(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2+currentDir3);
												}
												else
												{
													FileConnection level10=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2+currentDir3,Connector.READ);
													Enumeration subdirectoryList4=level10.list("*",true);
													while (subdirectoryList4.hasMoreElements()) {
														String currentDir4=(String)subdirectoryList4.nextElement();
														FileConnection level11=(FileConnection)Connector.open(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2+currentDir3+currentDir4,Connector.READ);
														if(level11.getURL().endsWith(".mp3")||level11.getURL().endsWith("MP3"))
														{
															addtoScreen.addElement(currentDir4);
															pathUrl.addElement(path+addDirectory.elementAt(i).toString()+currentDir+currentDir1+currentDir2+currentDir3+currentDir4);
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
			     }
			}
		}
		catch (Exception e) {
			System.out.println("Exception"+e);
		}
    }