Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 9
Registered: ‎07-08-2009
My Device: Not Specified

File System Error in delete operation

Hello All,

 

I am getting an exception of FileIOException: File System Error at fileConnection.delete() line.

FILE_PATH is obtained from fileJournalChanged() method when a file gets added.

I am unable to understand why is this happening. Because SOPs are revealing paths correctly.

 

here's the piece of code: -

 

FileConnection fileConnection = null;

System.out.println("FILE_PATH:"+FILE_PATH);
                if ( FILE_PATH != null )
                {
                    try
                    {
                        // Open file connection
                        fileConnection = ( FileConnection ) Connector.open( FILE_PATH );
                        System.out.println("getURL:"+fileConnection.getURL());
                        System.out.println("getpath:"+fileConnection.getPath());
                        System.out.println("getname:"+fileConnection.getName());
                        if ( fileConnection.exists() )
                        {
                            // Delete file at path
                            fileConnection.delete();
                            System.out.println("file connection deleted");                       
                            // Close connection
                            fileConnection.close();
                            fileConnection = null;  
                        }
                    }
                    catch (Exception ex)
                    {
                        System.out.println("exception in deleting file in parser:"+ex.toString());
                    }