| View previous topic :: View next topic |
| Author |
Message |
kuzhie General User

Joined: 08 Feb 2004 Posts: 26
|
Posted: Tue Mar 23, 2004 3:08 pm Post subject: instantiate SimpleFileAccess in java |
|
|
Helloo!
Being a newbie, OO API seems to look very complex. This is what I dont understand. How can I know the right way to instantiate an object in java.
I have a sample code in Basic such as
| Code: |
oSimpleFileAccess = createUnoService( "com.sun.star.ucb.SimpleFileAccess" )
|
In my java, I've try
| Code: |
String storeFileUrl = "file:////home/kusumas/Java/Receipt/MyFile.pdf"
xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess)UnoRuntime.queryInterface(
com.sun.star.ucb.XSimpleFileAccess.class, desktop);
xSimpleFileAccess.openFileRead(storeFileUrl);
|
But on the line 'openFileRead' I got null (java.lang.NullPointerException) error.
I have other object such as XInputStream and XOutputStream that I'd like to try on my applicaiton. But I'm not sure how can I use such object.
TIA for any input,
Kusuma |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
|