1 /* 2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.sound.sampled; 27 28 import java.security.BasicPermission; 29 30 /** 31 * The <code>AudioPermission</code> class represents access rights to the audio 32 * system resources. An <code>AudioPermission</code> contains a target name 33 * but no actions list; you either have the named permission or you don't. 34 * <p> 35 * The target name is the name of the audio permission (see the table below). 36 * The names follow the hierarchical property-naming convention. Also, an asterisk 37 * can be used to represent all the audio permissions. 38 * <p> 39 * The following table lists the possible <code>AudioPermission</code> target names. 40 * For each name, the table provides a description of exactly what that permission 41 * allows, as well as a discussion of the risks of granting code the permission. 42 * 43 * 44 * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks"> 45 * <tr> 46 * <th>Permission Target Name</th> 47 * <th>What the Permission Allows</th> 48 * <th>Risks of Allowing this Permission</th> 49 * </tr> 50 * 51 * <tr> 52 * <td>play</td> 53 * <td>Audio playback through the audio device or devices on the system. 54 * Allows the application to obtain and manipulate lines and mixers for 55 * audio playback (rendering).</td> 56 * <td>In some cases use of this permission may affect other 57 * applications because the audio from one line may be mixed with other audio 58 * being played on the system, or because manipulation of a mixer affects the 59 * audio for all lines using that mixer.</td> 60 *</tr> 61 * 62 * <tr> 63 * <td>record</td> 64 * <td>Audio recording through the audio device or devices on the system. 65 * Allows the application to obtain and manipulate lines and mixers for 66 * audio recording (capture).</td> 67 * <td>In some cases use of this permission may affect other 68 * applications because manipulation of a mixer affects the audio for all lines 69 * using that mixer. 70 * This permission can enable an applet or application to eavesdrop on a user.</td> 71 *</tr> 72 *</table> 73 *<p> 74 * 75 * @author Kara Kytle 76 * @since 1.3 77 */ 78 public class AudioPermission extends BasicPermission { 79 private static final long serialVersionUID = -5518053473477801126L; 80 81 /** 82 * Creates a new <code>AudioPermission</code> object that has the specified 83 * symbolic name, such as "play" or "record". An asterisk can be used to indicate 84 * all audio permissions. 85 * @param name the name of the new <code>AudioPermission</code> 86 * 87 * @throws NullPointerException if <code>name</code> is <code>null</code>. 88 * @throws IllegalArgumentException if <code>name</code> is empty. 89 */ 90 public AudioPermission(String name) { 91 92 super(name); 93 } 94 95 /** 96 * Creates a new <code>AudioPermission</code> object that has the specified 97 * symbolic name, such as "play" or "record". The <code>actions</code> 98 * parameter is currently unused and should be <code>null</code>. 99 * @param name the name of the new <code>AudioPermission</code> 100 * @param actions (unused; should be <code>null</code>) 101 * 102 * @throws NullPointerException if <code>name</code> is <code>null</code>. 103 * @throws IllegalArgumentException if <code>name</code> is empty. 104 */ 105 public AudioPermission(String name, String actions) { 106 107 super(name, actions); 108 } 109 }