-
public interface FileOpenServiceFileOpenServiceservice 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.
- Since:
- 1.4.2
- See Also:
FileSaveService,FileContents
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileContentsopenFileDialog(String pathHint, String[] extensions)Asks the user to choose a single file.FileContents[]openMultiFileDialog(String pathHint, String[] extensions)Asks the user to choose one or more file.
-
-
-
Method Detail
-
openFileDialog
FileContents openFileDialog(String pathHint, String[] extensions) throws IOException
Asks the user to choose a single file. The contents of a selected file is returned as aobject. The returnedFileContentsFileContentsobject 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
FileContentobject with information about the chosen file, ornullif 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
FileContents[] openMultiFileDialog(String pathHint, String[] extensions) throws IOException
Asks the user to choose one or more file. The contents of selected files is returned as an array ofobjects. The returnedFileContentsFileContentsobjects contain 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:
- An array of
FileContentobjects with information about the chosen files, ornullif 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.
-
-