javax.jnlp
Interface FileSaveService


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.

Since:
1.0
See Also:
FileOpenService, FileContents

Method Summary
 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.
 

Method Detail

saveFileDialog

FileContents saveFileDialog(java.lang.String pathHint,
                            java.lang.String[] extensions,
                            java.io.InputStream stream,
                            java.lang.String name)
                            throws java.io.IOException
Asks the users to save a file.

Parameters:
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 client
Returns:
A FileContents object for the saved file if the save was successfully, or null if the user canceled the request.
Throws:
IOException - if the requested failed in any way other than the user chose not to save the file
java.io.IOException

saveAsFileDialog

FileContents saveAsFileDialog(java.lang.String pathHint,
                              java.lang.String[] extensions,
                              FileContents contents)
                              throws java.io.IOException
Asks the users to save a file.

Parameters:
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.
Returns:
A FileContents object for the saved file if the save was successfully, or null if the user canceled the request.
Throws:
IOException - if the requested failed in any way other than the user chose not to save the file
java.io.IOException


Copyright (c) 2004 Oracle and/or its affiliates. All Rights Reserved