1

I am trying to compress a folder to zip and extract the same folder using java. When i zipped or unzipped the folder the files which are in the folder compressed and extracted successfully. But a Thumbs.db file is creating with in the folder.

I want to delete/avoid the Thumbs.db files before/after compressing to zip or extracting from zip programmatically. Is it possible in java ?

Srikanth E
  • 55
  • 2
  • 10
  • Could you show how you zip/unzip your folder? – C.Champagne Aug 30 '16 at 11:58
  • Furthermore, are you **really** sure that your thumbs.db file wasn't already present before you compress your folder? It is a system file and is generally hidden by the file explorer. – C.Champagne Aug 30 '16 at 12:01
  • Did you check if your file explorer display system files? – C.Champagne Aug 30 '16 at 12:34
  • Using java if my folder contains 4 pdf files when i compressed that an additional file Thumbs.db is adding to that zip. and the same file i have extracted then the Thumbs.db file is visible in the extracted folder. Using WinRar when compressed the same folder i am able to see Thumbs.db files inside WinRar application only but not in extracted folder. – Srikanth E Aug 30 '16 at 12:41

1 Answers1

1

Thumbs.db is usually a file with the system and hidden attributes (see attrib.exe ) and therefore invisible in the Explorer (unless you set the Explorer to show all files including system files).

When you extract the file you should set it's attributes accordingly.

How to set a file attribute using Java is already described here: https://stackoverflow.com/a/36465283/150978

Community
  • 1
  • 1
Robert
  • 39,162
  • 17
  • 99
  • 152