At work I'm implementing a new webservice that works with files. The specifications say that we should not accept .zip files if they are compressed.
Is there such a thing as a not compressed .zip file? If yes, what do you think would be the best way to detect one using Java (1.8)?
Yes, a zip can be uncompressed. In fact, early
.jarfiles were just uncompressed.zipfiles.The
ZipEntryclass hasgetMethodto get the compression method of an entry. One of the options isSTORED(e.g., not compressed).