private static Media[] parseResult(List result) {
if (result != null) {
//we have to filter items that user doesn't specify any file
for (Iterator it = result.iterator(); it.hasNext();) {
final Media media = (Media)it.next();
if (media != null && media.inMemory() && media.isBinary()) {
final String nm = media.getName();
if (nm == null || nm.length() == 0) {
final byte[] bs = media.getByteData();
if (bs == null || bs.length == 0)
it.remove(); //Upload is pressed without specifying a file
}
}
}