swing - Is it possible to know whether the copied content in clipboard is mp3 file using awt.Toolkit and Clipboard in java -
i trying write code runs @ background , monitors copy actions copying .mp3 file or folder containing .mp3 file { clipboard cb = toolkit.getdefaulttoolkit().getsystemclipboard(); if (cb.isdataflavoravailable(dataflavor.javafilelistflavor)) { try { string name = ""+cb.getdata(dataflavor.javafilelistflavor); boolean found = false; if (name.tolowercase().endswith(".mp3]")) { system.out.println("is mp3"); found = true; } if (!found) { system.out.println("is not mp3"); } } catch(unsupportedflavorexception ex) { ex.printstacktrace(); } catch(ioexception ex) { ...