/** * If running on OSX, iTunes integration is enabled and the downloaded file is a supported type, * send it to iTunes. */ public void addSong(File file) { // If not on OSX don't do anything. if (!CommonUtils.isMacOSX()) { return; } // Make sure we convert any uppercase to lowercase or vice versa. try { file = FileUtils.getCanonicalFile(file); } catch (IOException ignored) { } // Verify that we're adding a real file. if (!file.exists()) { if (LOG.isDebugEnabled()) LOG.debug("File: '" + file + "' does not exist"); return; } else if (!file.isFile()) { if (LOG.isDebugEnabled()) LOG.debug("File: '" + file + "' is a directory"); return; } String name = file.getName().toLowerCase(Locale.US); if (isSupported(name)) { if (LOG.isTraceEnabled()) LOG.trace("Will add '" + file + "' to Playlist"); QUEUE.add(new ExecOSAScriptCommand(file)); } }