JNLP API Reference 1.0: Interface FileSaveService

Package | Class | Tree | Index

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.

Version:
  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

    public 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

### saveAsFileDialog

    public 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.
    `filecontents` - 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

Package | Class | Tree | Index

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2001-2002 Sun Microsystems, Inc. All Rights Reserved