Bug 732078

Summary: Consider removing (or basing on mime-type) the "View" functionality for binary files
Product: [Other] RHQ Project Reporter: Mike Foley <mfoley>
Component: driftAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.1CC: jsanda
Target Milestone: ---Keywords: FutureFeature, Improvement
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 19:28:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 707225    
Attachments:
Description Flags
drift view on binary file none

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