if ( currentFile != null && !currentFile.equals( "" ) )
{
String dir;
//TODO: maybe create a plexus component for this so that additional mimetypes can be easily added
MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap();
mimeTypesMap.addMimeTypes( "application/java-archive jar war ear" );
mimeTypesMap.addMimeTypes( "application/java-class class" );
mimeTypesMap.addMimeTypes( "image/png png" );
if ( FILE_SEPARATOR.equals( userDirectory ) )
{
dir = userDirectory;
}
else
{
dir = FILE_SEPARATOR + userDirectory + FILE_SEPARATOR;
}
downloadFile = new File( getContinuum().getWorkingDirectory( projectId ) + dir + currentFile );
mimeType = mimeTypesMap.getContentType( downloadFile );
if ( ( mimeType.indexOf( "image" ) >= 0 ) || ( mimeType.indexOf( "java-archive" ) >= 0 ) ||
( mimeType.indexOf( "java-class" ) >= 0 ) || ( downloadFile.length() > 100000 ) )
{
return "stream";