Changeset 1181


Ignore:
Timestamp:
Oct 22, 2009, 11:35:39 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #241: Add MeV Analysis file as a file type for bioassay sets

The "Launch MeV" dialog failed with a PermissionDeniedException? if one of the files attached to the bioassay set was not readable by the current user.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.mev/trunk/resources/launch_mev.jsp

    r1156 r1181  
    5454%>
    5555<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
     56<%!
     57// Get an attached file or null in case there is some kind of error
     58private File safeGetFile(DbControl dc, BioAssaySet bas, String fileType)
     59{
     60  File file = null;
     61  try
     62  {
     63    file = FileStoreUtil.getDataFile(dc, bas, fileType);
     64  }
     65  catch (Throwable t)
     66  {}
     67  return file;
     68}
     69%>
    5670<%
    5771final SessionControl sc = Base.getExistingSessionControl(request, true);
     
    7387
    7488  // Get the current files
    75   File tdmsFile = FileStoreUtil.getDataFile(dc, bas, "mev.tdms");
    76   File cghFile = FileStoreUtil.getDataFile(dc, bas, "mev.cgh");
    77   File anlFile = FileStoreUtil.getDataFile(dc, bas, "mev.anl");
     89  File tdmsFile = safeGetFile(dc, bas, "mev.tdms");
     90  File cghFile = safeGetFile(dc, bas, "mev.cgh");
     91  File anlFile = safeGetFile(dc, bas, "mev.anl");
    7892  boolean allowCreateFile = bas.hasPermission(Permission.WRITE)
    7993    && sc.hasPermission(Permission.CREATE, Item.FILE);
Note: See TracChangeset for help on using the changeset viewer.