Ignore:
Timestamp:
06/05/08 15:58:33 (4 years ago)
Author:
sys
Message:

viewObject : getContent avec transformation : renvoit le mimetype.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Jav_BDP/com/scenari/m/bdp/service/viewobject/HSDialogViewObject.java

    r10914 r11149  
    508508                                                                                                        String vPath = vSrc.hGetUrlFileFormat(); 
    509509                                                                                                        byte[] vRes = vPath != null ? vPath.getBytes("utf8") : new byte[0]; 
    510                                                                                                         fResultatStream = new HResultatStream(new ByteArrayInputStream(vRes), vRes.length, vSrc.hGetLastModifWithChilds(), null); 
    511                                                                                                         ((HResultatStream) fResultatStream).hSetContentType("text/plain"); 
     510                                                                                                        fResultatStream = new HResultatStream(new ByteArrayInputStream(vRes), vRes.length, vSrc.hGetLastModifWithChilds(), null, "text/plain"); 
    512511                                                                                                } else { 
    513512                                                                                                        fResultatStream = new WResultatError(HWebdavCodes.SC_FORBIDDEN); 
     
    515514                                                                                        } else { 
    516515                                                                                                String vName = xGetFileNameForDownload(vCdAction); 
    517                                                                                                 fResultatStream = new HResultatStream(vSrc.hGetInputStream(), vSrc.hGetSize(), vSrc.hGetLastModif(), vName); 
    518                                                                                                 ((HResultatStream) fResultatStream).hSetContentType(vSrc.hGetContentType()); 
     516                                                                                                fResultatStream = new HResultatStream(vSrc.hGetInputStream(), vSrc.hGetSize(), vSrc.hGetLastModif(), vName, vSrc.hGetContentType()); 
    519517                                                                                        } 
    520518                                                                                } 
     
    530528                                                                                String vPath = fWorkspace.hGetRepository().hGetContentAccess().hGetUrlFileFormat(vItemDef.hGetId(), null, hGetUriRes(), vQs, null); 
    531529                                                                                byte[] vRes = vPath != null ? vPath.getBytes("utf8") : new byte[0]; 
    532                                                                                 fResultatStream = new HResultatStream(new ByteArrayInputStream(vRes), vRes.length, System.currentTimeMillis(), null); 
    533                                                                                 ((HResultatStream) fResultatStream).hSetContentType("text/plain"); 
     530                                                                                fResultatStream = new HResultatStream(new ByteArrayInputStream(vRes), vRes.length, System.currentTimeMillis(), null, "text/plain"); 
    534531                                                                        } else { 
    535532                                                                                fResultatStream = new WResultatError(HWebdavCodes.SC_FORBIDDEN); 
     
    539536                                                                        if (vRes != null) { 
    540537                                                                                String vName = xGetFileNameForDownload(vCdAction); 
    541                                                                                 fResultatStream = new HResultatStream(vRes.hGetInputStream(), vRes.hGetLength(), vRes.hGetLastModif().getTime(), vName); 
     538                                                                                fResultatStream = new HResultatStream(vRes.hGetInputStream(), vRes.hGetLength(), vRes.hGetLastModif().getTime(), vName, vRes.hGetContentType()); 
    542539                                                                        } else { 
    543540                                                                                fResultatStream = new WResultatError(HWebdavCodes.SC_NOT_FOUND); 
Note: See TracChangeset for help on using the changeset viewer.