Hi Sven,
First of all to make the "user.home" dir system property available on the
server you will have to customize the JNLP launcher by extending it from
DefaultJnlpLauncher as follows:
public class MyJnlpLauncher extends DefaultJnlpLauncher {
public static void main(String[] args) {
Properties p =
ClientEnvironmentAdapter.getClientInfo().getSystemProperties();
p.put("user.home", System.getProperty("user.home"));
ClientEnvironmentAdapter.setFileService(new
AllPermissionsFileService());
DefaultJnlpLauncher.main(args);
}
After this wou will be able to access "user.home" dir on the server as
follows:
final String filename =
ClientContext.getSystemProperty("user.home") + "\\test.txt";
Once you have the file name, use the following method to load the file:
ClientContext.loadFile(fileLoadHandler, filename);
Make sure that you sign all the jars and specify security permission in
jnlp file as follows:
<security>
<all-permissions/>
</security>
Note: For a guaranteed response time please subscribe to ULC Premium
Support.
Thanks and regards,
Janak
-----------------------------------------
Janak Mulani
email: [EMAIL PROTECTED]
url: http://www.canoo.com <http://www.canoo.com/>
Beyond AJAX - Java Rich Internet Applications
http://www.canoo.com/ulc
-----------------------------------------
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sven
Vanderhoeven
Sent: Thursday, October 16, 2008 1:59 PM
To: [email protected]
Subject: [ULC-developer] ClientContext.loadFile() Problem
I am trying to load a File we have stored in the clients
user.home-directory. The path to the file seams to be correct and the file
itself is existent on the client system. When I load the file with
ClientContext.loadFile(IFileLoadHandler handler, String filePath) every
time the FileChooseDialog pops up. A thing I dont want to happen. The
directory used in the dialog is the same directory as in which the file is
placed. I just want to load this file without bugging the user.
We are using ULC 6.2.3. The Application is started by jnlp and is
signed. The FileService is set to AllPermissionsFileService.
Thank you very much. Greetings,
Sven Vanderhoeven
Bewotec GmbH
Karl-Schiller-Str. 3
D-51503 Rösrath
Telefon: +49 2205 8964-0
Fax: +49 2205 8964-370
Geschäftsführer: Michael Becher, Bernhard Koller
Registergericht und -nummer: Amtsgericht Köln, HRB 46929
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer