Bug 732078 - Consider removing (or basing on mime-type) the "View" functionality for binary files
Consider removing (or basing on mime-type) the "View" functionality for binar...
Product: RHQ Project
Classification: Other
Component: drift (Show other bugs)
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: John Sanda
Mike Foley
: FutureFeature, Improvement
Depends On:
Blocks: 707225
  Show dependency treegraph
Reported: 2011-08-19 13:43 EDT by Mike Foley
Modified: 2012-02-07 14:28 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-02-07 14:28:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
drift view on binary file (34.47 KB, image/png)
2011-08-19 13:43 EDT, Mike Foley
no flags Details

  None (edit)
Description Mike Foley 2011-08-19 13:43:39 EDT
Created attachment 519080 [details]
drift view on binary file

Description of problem:  Consider removing (or basing on mime-type) the "View" functionality for binary files

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  drift on a binary file
2.  view
Actual results:
see attachment

Expected results:

Additional info:
Comment 1 John Sanda 2011-08-26 09:26:46 EDT
This is a non-trivial problem. An approach like looking at file extensions is not robust. What if a file does not have an extension. Or how do we handle files with extensions we do not recognize.
Comment 2 John Sanda 2011-08-29 09:45:05 EDT
Adding initial support for determining if a file is a binary type.

commit hash: 6abff4105f7a878cb0fb2b8b25a4814c880cc60b

The approach take with this commit is simple. DriftManagerBean keeps a set of known binary file extensions (ear, war, zip, etc.) to determine whether or not a file is viewable. Looking at file extensions is easy; however it is not very robust. Files might not have extensions, or the extension could be wrong. Furthermore, there may be extensions of which we are unaware.

I think/hope that this commit adequately addresses the issue. If it does not, then I want it to be clear that this could be a much more involved effort. At that point we might look to use something like ModeShape or Apache Tika.
Comment 3 Mike Foley 2011-08-31 15:08:30 EDT
marking verified.  this is a step forward from original state.  will wait to assess if more is needed here as time progresses.
Comment 4 Mike Foley 2012-02-07 14:28:50 EST
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE

Note You need to log in before you can comment on or make changes to this bug.