1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.desktop;
import java.io.*;
import java.net.*;
/**
* The <tt>DesktopService</tt> manages the .
*
* @author Yana Stamcheva
*/
public interface DesktopService
{
/**
* Launches the associated application to open the file.
*
* @param file the file to be opened
*
* @throws NullPointerException if file is null
* @throws IllegalArgumentException if the specified file dosen't exist
* @throws UnsupportedOperationException if the current platform does not
* support the Desktop.Action.OPEN action
* @throws IOException if the specified file has no associated application
* or the associated application fails to be launched
* @throws SecurityException if a security manager exists and its
* SecurityManager.checkRead(java.lang.String) method denies read access to
* the file, or it denies the AWTPermission("showWindowWithoutWarningBanner")
* permission, or the calling thread is not allowed to create a subprocess
*/
public void open(File file)
throws NullPointerException,
IllegalArgumentException,
UnsupportedOperationException,
IOException,
SecurityException;
/**
* Prints a file with the native desktop printing facility, using the
* associated application's print command.
*
* @param file the file to be opened
*
* @throws NullPointerException if file is null
* @throws IllegalArgumentException if the specified file dosen't exist
* @throws UnsupportedOperationException if the current platform does not
* support the Desktop.Action.OPEN action
* @throws IOException if the specified file has no associated application
* or the associated application fails to be launched
* @throws SecurityException if a security manager exists and its
* SecurityManager.checkRead(java.lang.String) method denies read access to
* the file, or it denies the AWTPermission("showWindowWithoutWarningBanner")
* permission, or the calling thread is not allowed to create a subprocess
*/
public void print(File file)
throws NullPointerException,
IllegalArgumentException,
UnsupportedOperationException,
IOException,
SecurityException;
/**
* Launches the associated editor application and opens a file for editing.
*
* @param file the file to open for editing
*
* @throws NullPointerException if file is null
* @throws IllegalArgumentException if the specified file dosen't exist
* @throws UnsupportedOperationException if the current platform does not
* support the Desktop.Action.OPEN action
* @throws IOException if the specified file has no associated application
* or the associated application fails to be launched
* @throws SecurityException if a security manager exists and its
* SecurityManager.checkRead(java.lang.String) method denies read access to
* the file, or it denies the AWTPermission("showWindowWithoutWarningBanner")
* permission, or the calling thread is not allowed to create a subprocess
*/
public void edit(File file)
throws NullPointerException,
IllegalArgumentException,
UnsupportedOperationException,
IOException,
SecurityException;
/**
* Launches the default browser to display a URI.
*
* @param uri the URI to be displayed in the user default browser
*
* @throws NullPointerException if file is null
* @throws IllegalArgumentException if the specified file dosen't exist
* @throws UnsupportedOperationException if the current platform does not
* support the Desktop.Action.OPEN action
* @throws IOException if the specified file has no associated application
* or the associated application fails to be launched
* @throws SecurityException if a security manager exists and its
* SecurityManager.checkRead(java.lang.String) method denies read access to
* the file, or it denies the AWTPermission("showWindowWithoutWarningBanner")
* permission, or the calling thread is not allowed to create a subprocess
*/
public void browse(URI uri)
throws NullPointerException,
IllegalArgumentException,
UnsupportedOperationException,
IOException,
SecurityException;
}
|