Package | Class | Tree | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.jnlp
Interface FileOpenService

public interface FileOpenService

`FileOpenService` service allows the user to choose a file from 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 a similar function as the file input field for HTML-based forms.

Version:
  1.0
See Also:
  `FileSaveService`, `FileContents`

Method Summary
`FileContents` | `openFileDialog(java.lang.String pathHint, java.lang.String[] extensions)` Asks the user to choose a single file.
`FileContents[]` | `openMultiFileDialog(java.lang.String pathHint, java.lang.String[] extensions)` Asks the user to choose one or more files.

Method Detail

### openFileDialog

    public FileContents openFileDialog(java.lang.String pathHint,
                                       java.lang.String[] extensions)
                                throws java.io.IOException

  Asks the user to choose a single file. The contents of a potential selected file is returned as a ``FileContents`` object. The returned `FileContents` object contains the contents along with the name of the file. The full path is not returned.
  Parameters:
    `pathHint` - A hint from the application to the initial directory for the file chooser. 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" }`. This might be ignored by the JNLP Client.
  Returns:
    A `FileContent` object with information about the chosen file, or `null` if the user did not choose a file.
  Throws:
    `IOException` - if the request failed in any way other than the user did not choose to select a file.

### openMultiFileDialog

    public FileContents[] openMultiFileDialog(java.lang.String pathHint,
                                              java.lang.String[] extensions)
                                       throws java.io.IOException

  Asks the user to choose one or more files. Otherwise similar to ``openFileDialog(java.lang.String, java.lang.String[])``

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