I\'m using JSch to get files from an SFTP server, but I\'m trying to figure out a way to only get the oldest file, and to make sure that it is not currently being written to
You can easily do this using edtFTPj/PRO, which supports SFTP.
Simply get a directory listing, and sort the listing by date. If the oldest date isn't in the last few minutes, you can download.