at.tuwien.ifs.somtoolbox.apps.viewer.fileutils
Class MIMETypes

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.viewer.fileutils.MIMETypes

public class MIMETypes
extends java.lang.Object

utility class to handle different filetypes
shall contain actions for all needed filetypes

Created on Dec 26, 2004

Author:
Robert Neumayer

Field Summary
private  java.lang.String[] ALLOWED_FILE_ENDINGS
           
private  java.lang.String audioPlayer
           
private  java.lang.String PLAYLIST_TMP_FILENAME
           
 
Constructor Summary
MIMETypes()
           
 
Method Summary
 void call(java.lang.String app, java.lang.String params)
          sends a system call to the given app using the given parameters
 void doSysCalls(java.lang.Object o)
          do the appropriate syscalls for a single selection
 void doSysCalls(java.lang.Object[] playList)
          does the syscalls for multiple selections
private  java.lang.String getFileType(java.lang.Object fullPathName)
           
 java.lang.String getFileType(java.lang.Object[] playList)
          get the filetype for a given selection (e.g.
 boolean hasSingleFileType(java.lang.Object[] playList)
          check if the selection consists of only one or more different filetypes
 boolean isExportable(java.lang.Object[] playList)
           
 void setAudioPlayer(java.lang.String audioPlayer)
          sets the preferred audio player for files of type audio
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

audioPlayer

private java.lang.String audioPlayer

ALLOWED_FILE_ENDINGS

private java.lang.String[] ALLOWED_FILE_ENDINGS

PLAYLIST_TMP_FILENAME

private java.lang.String PLAYLIST_TMP_FILENAME
Constructor Detail

MIMETypes

public MIMETypes()
Method Detail

setAudioPlayer

public void setAudioPlayer(java.lang.String audioPlayer)
sets the preferred audio player for files of type audio

Parameters:
audioPlayer - - a string containing the path to the audio player

hasSingleFileType

public boolean hasSingleFileType(java.lang.Object[] playList)
check if the selection consists of only one or more different filetypes

Parameters:
playList - - selected playlist
Returns:
- true if only one filetype, false if more

isExportable

public boolean isExportable(java.lang.Object[] playList)
Returns:
true if the play list can be exported, false otherwise.

getFileType

public java.lang.String getFileType(java.lang.Object[] playList)
get the filetype for a given selection (e.g. "mp3")


doSysCalls

public void doSysCalls(java.lang.Object o)
do the appropriate syscalls for a single selection

Parameters:
o - - the selected element

doSysCalls

public void doSysCalls(java.lang.Object[] playList)
does the syscalls for multiple selections

Parameters:
playList - - selected playlist

getFileType

private java.lang.String getFileType(java.lang.Object fullPathName)

call

public void call(java.lang.String app,
                 java.lang.String params)
sends a system call to the given app using the given parameters

Parameters:
app - - application to be executed
params - - parameters