Diff zipped files in Intellij using “Archive” file type

Some file types are really just zipped (or maybe gzipped) folders containing xml and/or other plaintext based files.

For example

  • *.epub e-books
  • OpenDocument files
  • Java source jar files
  • JEE web application archives (*.war)
  • Pentaho report files (*.prpt)

If you happen to have such files in a software project, and don’t want to treat them like opaque binary blobs, you need a tool that helps you to transparently unzip, act on and rezip them. Also you probably want to be able to diff them without resorting to commercial tools like BeyondCompare.

IntelliJ CE (Community Edition) supports archive diffs as part of its regular Comparing Files functionality. All you need to do is make sure the file extension of the file types you want to be treated as archives are accordingly registered in Settings – Editor – File Types.

The screenshot below shows *.war and *.jar registered as Archive file name patterns (by default) and *.prpt (Pentaho report files) as an example of a manually added pattern:

intellij_register-pentaho-prpt-as-archive-file-type

Which process is locking a file on Windows ?

List processes locking a file by file path sub-string:

Command line

  1. Install the handle tool from the Sysinternals suite
  2. Run handle -u [file path sub-string] in a cmd.exe window

The -u option includes the user owning the process.

Example:

handle -u "some.pdf"
AcroRd32.exe   pid: 11208  type: File  localnet\oliver 
244: C:\Users\Public\Documents\some-folder\some.pdf

GUI

  1. Download Sysinternals Process Explorer
  2. Menu : Find – “Find Handle or DLL …”

process-explorer_find-handle-or-dll

process-explorer_search-handle-or-dll_dialog