BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-16-2009, 10:59 AM   #1 (permalink)
New Member
 
Join Date: Sep 2008
Model: 8800
PIN: N/A
Carrier: Vodafone
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot create subfolders

Please Login to Remove!

Hi there,
I have the following code:

Code:
    public static void createDirectoryIfNotExist(String path) {

        path = "file://"+path;

        try {
            System.out.println("MAKE: "+path);
            FileConnection fconn = (FileConnection)Connector.open(path);
            if (!fconn.exists()) {
                System.out.println("DOES NOT EXIST, CREATE: "+path);
                fconn.mkdir();
            } else {
                System.out.println("EXISTS, IGNORE: "+path);
            }
            
            fconn.close();
            
        } catch (IOException ioe) {
            System.out.println("IOEXPECTION: "+path);
            ioe.printStackTrace();
        
        }
        
    }
I use this code on startup of my app, to create a directory structure. The only problem is, although it works for the first directory i.e.

file:///store/home/user/Butterfly

It does not work for folders within this like:

file:///store/home/user/Butterfly/Temp

Instead, the Exception happens, but printing the stack trace simply says "no stack trace".

I can't quite see what's going wrong here... Anyone have any guesses?

Cheers

Garry
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

HP/Agilent 938A Frequency Doubler Signal Generator
$75.0
HP/Agilent 938A Frequency Doubler Signal Generator pictureQty 2 Pcs HP Agilent 10515A Frequency Doublers Input 0.5 to 500 MHz 180 MW max
$55.0
Qty 2 Pcs HP Agilent 10515A Frequency Doublers Input 0.5 to 500 MHz 180 MW max pictureGreenray P-453-30 100 MHz +15 VDC Frequency Source
$36.0
Greenray P-453-30 100 MHz +15 VDC Frequency Source picture EATON HVXF15A1 HV 9000 1.5 HP Adjustable A9 Frequency Drive CVA1
$175.0
 EATON HVXF15A1   HV 9000 1.5 HP  Adjustable A9 Frequency Drive CVA1 pictureABB ACH550-UH-023A-4/21314231 15HP HVAC MOTOR VARIABLE FREQUENCY DRIVE 380-480V
$750.0
ABB ACH550-UH-023A-4/21314231 15HP HVAC MOTOR VARIABLE FREQUENCY DRIVE 380-480V picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.