I'm using Java move a file into a dropbox folder, which if a new file or photo that gets added, will trigger an IFTTT.com recipe that will post it to twitter. I am using Apache Commons IO for the movefile method on File Utils to create a File, and then move it.
But first, I have it find a path to a Content Path folder with a contentFileArray, which creates a File that gives us the image that I want to use. Then it takes the image, and creates a File destination that is in the local Dropbox folder. I set the file name and add the file extension.
Then I move it into the dropbox folder... which then triggers an IFTTT recipe that lets you post a Tweet when a file enters the Dropbox folder... or if a photo image enters the Dropbox folder. The problem is that a .png triggers as a file and as a photo, so I double post. It activates the File recipe and the Photo recipe.
IFTTT doesn't have any documentation for how Dropbox's Triggers work on the website, but maybe I'm missing something with FileUtils.moveFile(). Maybe it creates a file at that location, then has us change the file name. This could cause it to be read twice.
File src = new File(messageObject.getContentpath()+"\\"+contentFileArray[0]);
String ext = "."+FilenameUtils.getExtension(contentFileArray[0]);
File dest = new File(messageObject.getDropboxpath()+"\\"+messageObject.getMessage()+ext);
FileUtils.moveFile(src, dest);
successfulContentPosts++;
Does calling this line, cause this file to be made at this actual file path?
File dest = new File(messageObject.getDropboxpath()+"\\"+messageObject.getMessage()+ext);