BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 06-24-2009, 04:37 AM   #1 (permalink)
New Member
 
Join Date: Jun 2009
Model: 8310
PIN: N/A
Carrier: nothing
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Blackberry Application - File Operation

Please Login to Remove!

hi,

I am new to blackberry Apps development. I am using bundled eJDE 4.7.

How to create File Object in blackberry?

eg. in java we will create File object like, File file = new File(pathname);

in blackberry we have net.rim.device.api.io.File package in that give package we don't have the Constructor to create File Object.

Please Help me ..to solve this problem.
Offline  
Old 06-24-2009, 04:52 AM   #2 (permalink)
New Member
 
Join Date: Mar 2009
Model: 8900
PIN: N/A
Carrier: o2
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i believe its all done using fileconnections, e.g.

Code:
FileConnection fc = (FileConnection)Connector.open("file:///somefile.txt");
                                    if (!fc.exists())
                                    {
                                        fc.create();
                                    }
Offline  
Old 06-24-2009, 05:17 AM   #3 (permalink)
New Member
 
Join Date: Jun 2009
Model: 8310
PIN: N/A
Carrier: nothing
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

thanks for u r reply

i created the file connection with the given path, but i need to send File object as parameter for a method.

eg.

in java,

File choosenFile = new File(path);
new FilePart("file", choosenFile);
Offline  
Old 06-24-2009, 09:22 AM   #4 (permalink)
New Member
 
Join Date: Mar 2009
Model: 8900
PIN: N/A
Carrier: o2
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not a pro with blackberry java, but I don't think you can get a File object in the same fashion as with desktop java. You may need to modify your method, FilePart, to accept a FileConnection object, not a file object.
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

24VAC 4V320-08 5 Ways 2 Position Double Solenoid Pneumatic Air Valve 1/4"
$34.69
24VAC 4V320-08 5 Ways 2 Position Double Solenoid Pneumatic Air Valve 1/4TEQCOM SK-0-51277-1 24 VDC XLP NO-C-NC 40PSI SOLENOID VALVE NEW NOS $199
$199.0
TEQCOM SK-0-51277-1 24 VDC XLP NO-C-NC 40PSI SOLENOID VALVE NEW NOS $199 picture1x MVSC300 4E2 380V AC 5Port 2Pos 1 2 BSP Solenoid Air Valve Double Coil Led
$24.74
1x MVSC300 4E2 380V AC 5Port 2Pos 1 2 BSP Solenoid Air Valve Double Coil Led picture5 Way 2 Pos Electric Control Solenoid Valve Double Coil 4V120-06 24V
$16.84
5 Way 2 Pos Electric Control Solenoid Valve Double Coil 4V120-06 24V picture1x4M110 06DC24V 5Port 2Position 1 8 BSPT Single Solenoid Pneumatic Air Valve QC
$13.35
1x4M110 06DC24V 5Port 2Position 1 8 BSPT Single Solenoid Pneumatic Air Valve QC picture






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