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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
Himanshu_berry
Posts: 131
Registered: ‎04-19-2012
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.

Please use plain text.
Developer
Kiran_Snist
Posts: 174
Registered: ‎01-25-2011

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 ....

Please use plain text.
Trusted Contributor
Himanshu_berry
Posts: 131
Registered: ‎04-19-2012
My Carrier: Nokia

Re: Can we create a folder in internal memory .

thanks

Please use plain text.
Trusted Contributor
Himanshu_berry
Posts: 131
Registered: ‎04-19-2012
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

 

Please use plain text.
Developer
rabiray
Posts: 141
Registered: ‎07-13-2011
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

Please use plain text.
Trusted Contributor
Himanshu_berry
Posts: 131
Registered: ‎04-19-2012
My Carrier: Nokia

Re: Can we create a folder in internal memory .

Thanks rabi :Clap:

Please use plain text.