I receive encrypted data files into a directory where they are unencrypted by a nightly process.
The unencrypted files are then loaded.
I need to write a Java method to return an array containing the filenames of all the unencrypted files in the directory.
The encrytion method is openSSL (aes128).
So far I have tried getType()
but it returns content/unknown
for both the unencrypted data files and the encrypted file too.
I am now looking into reading the first two lines of each file and checking the characters returned to see if the file is encrypted.
What I need to know is, is there a better way of doing this?
I could also live with testing whether the file contents are XML or plain text rather than testing whether the file is encrypted if that makes the solution easier?