public interface FileSaveService
FileSaveService
service allows the user to save a file
to the local file system, even for applications that
are running in the untrusted execution environment. The JNLP Client is the mediator
and is therefore responsible for providing the specific implementation
of this, if any.
This service provides similar functionatlity as the Save as... functionality provided by most browsers.
FileOpenService
,
FileContents
Modifier and Type | Method and Description |
---|---|
FileContents |
saveAsFileDialog(java.lang.String pathHint,
java.lang.String[] extensions,
FileContents contents)
Asks the users to save a file.
|
FileContents |
saveFileDialog(java.lang.String pathHint,
java.lang.String[] extensions,
java.io.InputStream stream,
java.lang.String name)
Asks the users to save a file.
|
FileContents saveFileDialog(java.lang.String pathHint, java.lang.String[] extensions, java.io.InputStream stream, java.lang.String name) throws java.io.IOException
pathHint
- A hint from the application to the default directory to be
used. This might be ignored by the JNLP Client.extensions
- A list of default extensions to show in the file chooser.
For example, String[] { "txt", "java" }
.
These might be ignored by the JNLP Client.stream
- The content of the file to save along represented as an
InputStream
name
- The suggested filename, which might be ignored by the JNLP clientFileContents
object for the saved file if the save was successfully, or
null
if the user canceled the request.IOException
- if the requested failed in any way other than the user chose
not to save the filejava.io.IOException
FileContents saveAsFileDialog(java.lang.String pathHint, java.lang.String[] extensions, FileContents contents) throws java.io.IOException
pathHint
- A hint from the application to the default directory to be
used. This might be ignored by the JNLP Client.extensions
- A list of default extensions to show in the file chooser.
For example, String[] { "txt", "java" }
.
These might be ignored by the JNLP Client.contents
- The content of the file to save along with the suggested filename.
The suggested filename might be ignored by the JNLP Client.FileContents
object for the saved file if the save was successfully, or
null
if the user canceled the request.IOException
- if the requested failed in any way other than the user chose
not to save the filejava.io.IOException
Copyright © 1998, 2017, Oracle and/or its affiliates. All rights reserved.