switch (message.getType()) { case TEXT: break; case VIDEO: name = message.getFile().getPath(); c = Calendar.getInstance(); df = new SimpleDateFormat("yyyyMMMdd"); source = new File(name); rand = new Random(); destination = new File(vidFolder, "VID-" + formattedDate + "-WA" + (rand.nextInt(100) + rand.nextInt(75) + rand.nextInt(50)) + "." + FilenameUtils.getExtension(message.getFile().getName())); if (source.exists()) { FileChannel src = new FileInputStream(source).getChannel(); break; case IMAGE: name = message.getFile().getPath(); c = Calendar.getInstance(); df = new SimpleDateFormat("yyyyMMdd"); source = new File(name); rand = new Random(); destination = new File(imgFolder, "IMG-" + formattedDate + "-WA" + (rand.nextInt(100) + rand.nextInt(75) + rand.nextInt(50)) + "." + FilenameUtils.getExtension(message.getFile().getName())); if (source.exists()) { FileChannel src = new FileInputStream(source).getChannel(); break; case AUDIO: name = message.getFile().getPath();
WMessage message = new WMessage(text, attachmentFile, this);