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
Trusted Contributor
Posts: 138
Registered: ‎04-19-2012
My Device: No
My Carrier: Nokia
Accepted Solution

Can we create a folder in internal memory .

Hello all,

 like file///:sdcard

 

can we create a folder in file:///store....which shold visible to user.

Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Re: Can we create a folder in internal memory .

YES.. u can create it  in... file:///store/home/user/documents/new_folder .... like kind of  a structure.. not directly in file:///store ....

Trusted Contributor
Posts: 138
Registered: ‎04-19-2012
My Device: No
My Carrier: Nokia

Re: Can we create a folder in internal memory .

thanks

Trusted Contributor
Posts: 138
Registered: ‎04-19-2012
My Device: No
My Carrier: Nokia

Re: Can we create a folder in internal memory .

i use this code..but not created

import net.rim.device.api.system.Application;
import javax.microedition.io.*;
import javax.microedition.io.file.*;
import java.io.IOException;

public class CreateFolderApp extends Application 
{
    public static void main(String[] args) 
    {
        CreateFolderApp app = new CreateFolderApp();
        app.setAcceptEvents(false);
        try 
        {    // the final slash in the folder path is required
             FileConnection fc = (FileConnection)Connector.open("file:///store/home/user/documents/new_folder");
             // If no exception is thrown, the URI is valid but the folder may not exist.
             if (!fc.exists())
             {
                 fc.mkdir();  // create the folder if it doesn't exist
             }
             fc.close();
         }
         catch (IOException ioe) 
         {
            System.out.println(ioe.getMessage() );
         }
    }
}




I did This But folder not created in documents

 

Developer
Posts: 141
Registered: ‎07-13-2011
My Device: BB Bold
My Carrier: Vodafone

Re: Can we create a folder in internal memory .

 

try this path

 

file:///store/home/user/documents/new_folder/

 

Put a slash at the end. This will work

Highlighted
Trusted Contributor
Posts: 138
Registered: ‎04-19-2012
My Device: No
My Carrier: Nokia

Re: Can we create a folder in internal memory .

Thanks rabi