×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    31

    Question list the files in a folder

    hi, i'm developing an applicatiob for a s40 3rd edition phone, and i'm trying to make a list of the files in a specific folder,but it doesn't work, the app ask me to allow edit and add data i the memory card, but after this appears an error of null pointer exception. thats the code i'm using

    Code:
    public void run(){
            Enumeration listEnum=null;
            folder = new Vector();
            directorio = null;
            try {
    			iFconn = ( FileConnection )Connector.open("file:///E:/Libros/");
    			
    //			 obtener contenido directorio
    	        if (iFconn.canRead())
    	        {
    	          if (listEnum.hasMoreElements() == false) {
    	            // carpeta vacia
    	            folder.addElement("<carpeta vacia>.");
    	            
    	          }
    	          else {
    	            for (int i = 0; listEnum.hasMoreElements(); ) {
    	              folder.addElement(listEnum.nextElement());
    	              
    //	              directorio.append("->"+listEnum.nextElement().toString(), null);
    	            }
    	          }
    	        }
    	        iFconn.close();
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			BraillesMIDlet.pantalla.setCurrent(alerta);
    //			e.printStackTrace();
    		}
            
        }
    i want to know if what i'm doing is right
    thanks

  2. #2
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: list the files in a folder

    from ur code i can see is, ur Enumeration variable is null, ur not creating ur Enumeration. its containing NULL as asign at start.

Similar Threads

  1. list .exe files
    By Alezzz in forum Symbian
    Replies: 5
    Last Post: 2007-09-14, 13:40
  2. open files list
    By irongate in forum Symbian
    Replies: 1
    Last Post: 2004-12-13, 14:37
  3. Bluetooth Virtual Serial Port
    By mealos in forum Bluetooth Technology
    Replies: 2
    Last Post: 2004-12-03, 03:46
  4. Replies: 0
    Last Post: 2003-10-14, 04:37
  5. access to list of .arm files
    By sguillem in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-04-30, 10:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×