Bug 732078 - Consider removing (or basing on mime-type) the "View" functionality for binary files
Summary: Consider removing (or basing on mime-type) the "View" functionality for binar...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: drift
Version: 4.1
Hardware: Unspecified
OS: Unspecified
medium
medium vote
Target Milestone: ---
: ---
Assignee: John Sanda
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 707225
TreeView+ depends on / blocked
 
Reported: 2011-08-19 17:43 UTC by Mike Foley
Modified: 2012-02-07 19:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-07 19:28:50 UTC


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

Description Mike Foley 2011-08-19 17:43:39 UTC
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:
100%


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

Expected results:


Additional info:

Comment 1 John Sanda 2011-08-26 13:26:46 UTC
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 13:45:05 UTC
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 19:08:30 UTC
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 19:28:50 UTC
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.