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 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  String[] ALLOWED_FILE_ENDINGS
           
private  String audioPlayer
           
private  String PLAYLIST_TMP_FILENAME
           
 
Constructor Summary
MIMETypes()
           
 
Method Summary
 void call(String app, String params)
          sends a system call to the given app using the given parameters
 void doSysCalls(Object o)
          do the appropriate syscalls for a single selection
 void doSysCalls(Object[] playList)
          does the syscalls for multiple selections
private  String getFileType(Object fullPathName)
           
 String getFileType(Object[] playList)
          get the filetype for a given selection (e.g.
 boolean hasSingleFileType(Object[] playList)
          check if the selection consists of only one or more different filetypes
 boolean isExportable(Object[] playList)
           
 void setAudioPlayer(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 String audioPlayer

ALLOWED_FILE_ENDINGS

private String[] ALLOWED_FILE_ENDINGS

PLAYLIST_TMP_FILENAME

private String PLAYLIST_TMP_FILENAME
Constructor Detail

MIMETypes

public MIMETypes()
Method Detail

setAudioPlayer

public void setAudioPlayer(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(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(Object[] playList)
Returns:
true if the play list can be exported, false otherwise.

getFileType

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


doSysCalls

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

Parameters:
o - - the selected element

doSysCalls

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

Parameters:
playList - - selected playlist

getFileType

private String getFileType(Object fullPathName)

call

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

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