I have a java class for downloading voice recordings from SFTP server. I use Apache Commons API to do it. The steps should be:
- download the recording to byte array (byte[])
- validate if the downloaded recording is whole, correct and not corrupt in any way (I mean in comparison with the server one, if it is corrupted on a server then I don't care - I just need it to be the same)
- delete the recording from the server
How can I do step 2 to be as sure as possible (maybe 100% is not possible I don't know)? So far I am just checking whether the byte[] is not empty but that is pretty weak. I looked at some checksums but I don't have any other access to the server than via SFTP in java application so I can't make the checksum on the server... Thank you for any help!