Java Reference
In-Depth Information
The storage space for locally saved files is based on the domain from where the file was
downloaded from (or the path where the app is executed for non-downloaded app). The
following table shows the default location where a file will be stored, based on domain path.
Download-Path
Local-Storage-Path
http://www.myapp.com/
/
http://www.myapp.com/apps/
/apps
http://www.myapp.com/apps/version1
/apps/version1/
Application executed locally from ile: /Users/
vivien/JavaFX-Cookbook/ch006/
/
When the application stores a resource using the Storage API, it will be saved locally at the
storage space assigned to the application. Applications from the same domain and subpaths
can share stored data. As a measure of security, however, applications from different domains
(or same domain, different paths) cannot share data.
Local storage configuration
Clients can configure and control how the Storage API behaves using the storage.
properties file. As of version 1.2 of the SDK, the file is located in:
F %USER_HOME%\Sun\JavaFX\Deployment\storage.properties (Windows)
F $USER_HOME/.javafx/deployment/storage.properties (*nix, MacOS)
By default, the content of this file is empty. The following can be used to control storage:
F storage.enabled = [true | false] —this configuration entry enables or
disables the storage of a local file. When set to false , any attempt to write to local
storage will result in an exception.
F storage.limit.domain —this configuration entry allows you to configure the number
of bytes that can be saved manually per application domain (the default is 1MB).
For further information on the Java IO API see:
F Java IO Tutorial— http://java.sun.com/docs/books/tutorial/essential/
io/
Accessing remote data with HttpRequest
All modern rich client platforms provide ways to communicate with external servers. The Web
and its associated protocols have become de facto technologies for building client-server
applications. This recipe shows how to use JavaFX to communicate with web servers over
HTTP using the HttpRequest object from JavaFX's IO API. You will learn how to submit a
request to a remote web server and use HttpRequest's event-driven callback functions to
handle responses from the server.
Search WWH ::




Custom Search