| | |
| | | import de.uhilger.mediaz.store.StorageFile; |
| | | import de.uhilger.mediaz.store.Track; |
| | | import java.io.File; |
| | | import java.io.FileFilter; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.util.ArrayList; |
| | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | |
| | | logger.fine(fName); |
| | | File dir = new File(fileBase, fName); |
| | | logger.fine(dir.getAbsolutePath()); |
| | | File[] files = dir.listFiles(); |
| | | File[] files = dir.listFiles(new FileFilter() { |
| | | @Override |
| | | public boolean accept(File pathname) { |
| | | Set keys = extMap.keySet(); |
| | | String fname = pathname.getName(); |
| | | int pos = fname.lastIndexOf("."); |
| | | String ext = fname.substring(pos+1); |
| | | return keys.contains(ext) || pathname.isDirectory(); |
| | | } |
| | | }); |
| | | Arrays.sort(files); |
| | | ArrayList list = new ArrayList(); |
| | | if(files != null) { |