Fork me on GitHub

Résultats CPD

Le document suivant contient les résultats de l'inspection CPD CPD 6.13.0.

Duplicatas

Fichier Ligne
fr/paris/lutece/plugins/appcenter/modules/support/web/DoAdminDownloadFile.java 114
fr/paris/lutece/plugins/appcenter/modules/support/web/DoDownloadFile.java 104
            return AdminMessageService.getMessageUrl( request, Messages.USER_ACCESS_DENIED, AdminMessage.TYPE_STOP );
        }

        File file = FileHome.findByPrimaryKey( nIdFile );
        PhysicalFile physicalFile = ( file != null )
            ? PhysicalFileHome.findByPrimaryKey( file.getPhysicalFile(  ).getIdPhysicalFile(  ) ) : null;

        if ( physicalFile != null )
        {
            try
            {
                byte[] byteFileOutPut = physicalFile.getValue(  );

                response.setHeader( "Content-Disposition", "attachment ;filename=\"" + file.getTitle(  ) + "\"" );
                response.setHeader( "Pragma", "public" );
                response.setHeader( "Expires", "0" );
                response.setHeader( "Cache-Control", "must-revalidate,post-check=0,pre-check=0" );

                String strMimeType = file.getMimeType(  );

                if ( strMimeType == null )
                {
                    strMimeType = FileSystemUtil.getMIMEType( file.getTitle(  ) );
                }

                response.setContentType( strMimeType );
                response.setContentLength( byteFileOutPut.length );

                OutputStream os = response.getOutputStream(  );
                os.write( byteFileOutPut );
                os.close(  );
            }
            catch ( IOException e )
            {
                AppLogService.error( e );
            }
        }