KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jnlp > FileOpenService


1 /*
2  * @(#)FileOpenService.java 1.15 04/03/12
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.jnlp;
9 import java.io.IOException;
10 import java.io.InputStream;
11
12 /**
13  * <code>FileOpenService</code> service allows the user to choose a file
14  * from the local file system, even for applications that
15  * are running in the untrusted execution environment. The JNLP Client is the mediator
16  * and is therefore responsible for providing the specific implementation
17  * of this, if any.
18  * <p>
19  * This service provides a similar function as the file input field for HTML-based
20  * forms.
21  *
22  * @since 1.0
23  *
24  * @see FileSaveService
25  * @see FileContents
26  */

27 public interface FileOpenService {
28     
29     /** Asks the user to choose a single file. The contents of a potential
30      * selected file is returned as a <code>{@link FileContents}</code> object.
31      * The returned <code>FileContents</code> object contains the contents
32      * along with the name of the file. The full path is not returned.
33      *
34      * @param pathHint A hint from the application to the initial directory for
35      * the file chooser. This might be ignored by the JNLP
36      * Client.
37      *
38      * @param extensions A list of default extensions to show in the file chooser.
39      * For example, <code>String[] { "txt", "java" }</code>.
40      * This might be ignored by the JNLP Client.
41      *
42      * @return A <code>FileContent</code> object with information about the
43      * chosen file, or <code>null</code> if the user did not choose a file.
44      *
45      * @exception <code>IOException</code> if the request failed in any way other than the user did not
46      * choose to select a file.
47      */

48     public FileContents openFileDialog(String pathHint, String[] extensions) throws IOException;
49
50     /**
51      * Asks the user to choose one or more files. Otherwise similar to
52      * <code>{@link #openFileDialog}</code>
53      */

54     public FileContents [] openMultiFileDialog(String pathHint, String[] extensions) throws IOException;
55 }
56
57
Popular Tags