|
| 1 | +/* |
| 2 | + * Copyright (C) 2004 Felipe Gustavo de Almeida |
| 3 | + * Copyright (C) 2010-2014 The MPDroid Project |
| 4 | + * |
| 5 | + * All Rights Reserved. |
| 6 | + * |
| 7 | + * Redistribution and use in source and binary forms, with or without |
| 8 | + * modification, are permitted provided that the following conditions are met: |
| 9 | + * |
| 10 | + * 1. Redistributions of source code must retain the above copyright |
| 11 | + * notice,this list of conditions and the following disclaimer. |
| 12 | + * 2. Redistributions in binary form must reproduce the above copyright |
| 13 | + * notice, this list of conditions and the following disclaimer in the |
| 14 | + * documentation and/or other materials provided with the distribution. |
| 15 | + * |
| 16 | + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 17 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 18 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 | + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY |
| 20 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 21 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 22 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 23 | + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 25 | + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | + */ |
| 27 | + |
1 | 28 | package org.a0z.mpd;
|
2 | 29 |
|
3 | 30 | import org.a0z.mpd.connection.MPDConnection;
|
@@ -143,6 +170,22 @@ private static CommandQueue getMusicCommand(final Collection<String> response) {
|
143 | 170 | return commandQueue;
|
144 | 171 | }
|
145 | 172 |
|
| 173 | + /** |
| 174 | + * Sanity check for the sticker manager methods. |
| 175 | + * |
| 176 | + * @param entry The entry to process. |
| 177 | + */ |
| 178 | + private static void onlyMusicSupported(final FilesystemTreeEntry entry) { |
| 179 | + if (entry == null) { |
| 180 | + throw new IllegalArgumentException("Failed on a null argument."); |
| 181 | + } |
| 182 | + |
| 183 | + if (!(entry instanceof Music)) { |
| 184 | + throw new IllegalArgumentException("Stickers are only supported with Music objects: " + |
| 185 | + "Class: " + entry.getClass() + " Entry: " + entry.getFullPath()); |
| 186 | + } |
| 187 | + } |
| 188 | + |
146 | 189 | /**
|
147 | 190 | * Deletes a sticker.
|
148 | 191 | *
|
@@ -278,22 +321,6 @@ private Map<String, Music> getMusicPair(final Collection<String> response)
|
278 | 321 | return musicPair;
|
279 | 322 | }
|
280 | 323 |
|
281 |
| - /** |
282 |
| - * Sanity check for the sticker manager methods. |
283 |
| - * |
284 |
| - * @param entry The entry to process. |
285 |
| - */ |
286 |
| - private static void onlyMusicSupported(final FilesystemTreeEntry entry) { |
287 |
| - if (entry == null) { |
288 |
| - throw new IllegalArgumentException("Failed on a null argument."); |
289 |
| - } |
290 |
| - |
291 |
| - if (!(entry instanceof Music)) { |
292 |
| - throw new IllegalArgumentException("Stickers are only supported with Music objects: " + |
293 |
| - "Class: " + entry.getClass() + " Entry: " + entry.getFullPath()); |
294 |
| - } |
295 |
| - } |
296 |
| - |
297 | 324 | /**
|
298 | 325 | * Retrieves rating of a entry.
|
299 | 326 | *
|
|
0 commit comments