org.littleshoot.util
Class ResourceTypeTranslatorImpl

java.lang.Object
  extended by org.littleshoot.util.ResourceTypeTranslatorImpl
All Implemented Interfaces:
ResourceTypeTranslator

public class ResourceTypeTranslatorImpl
extends Object
implements ResourceTypeTranslator

Class for determining the type of resources. TODO: Compressed types like zip are weird because they could be anything. We should put them in documents, but have a separate category for type that are OS-specific, like .sit.


Field Summary
static String APPLICATION_TYPE
           
static String ARCHIVE_TYPE
           
static String AUDIO_TYPE
           
static String DOCUMENT_TYPE
           
static String IMAGE_TYPE
           
static String LINUX_APPLICATION_TYPE
           
static String MAC_APPLICATION_TYPE
           
static String VIDEO_TYPE
           
static String WINDOWS_APPLICATION_TYPE
           
 
Constructor Summary
ResourceTypeTranslatorImpl()
          Creates a new translator for media types.
 
Method Summary
 String getType(String fileName)
          Determines the resource type for a file name.
 boolean isAudioOrVideo(String type)
          Returns whether or not the specified type is an audio or video type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_TYPE

public static final String DOCUMENT_TYPE
See Also:
Constant Field Values

AUDIO_TYPE

public static final String AUDIO_TYPE
See Also:
Constant Field Values

VIDEO_TYPE

public static final String VIDEO_TYPE
See Also:
Constant Field Values

IMAGE_TYPE

public static final String IMAGE_TYPE
See Also:
Constant Field Values

ARCHIVE_TYPE

public static final String ARCHIVE_TYPE
See Also:
Constant Field Values

APPLICATION_TYPE

public static final String APPLICATION_TYPE
See Also:
Constant Field Values

MAC_APPLICATION_TYPE

public static final String MAC_APPLICATION_TYPE
See Also:
Constant Field Values

LINUX_APPLICATION_TYPE

public static final String LINUX_APPLICATION_TYPE
See Also:
Constant Field Values

WINDOWS_APPLICATION_TYPE

public static final String WINDOWS_APPLICATION_TYPE
See Also:
Constant Field Values
Constructor Detail

ResourceTypeTranslatorImpl

public ResourceTypeTranslatorImpl()
Creates a new translator for media types.

Method Detail

getType

public String getType(String fileName)
Description copied from interface: ResourceTypeTranslator
Determines the resource type for a file name. Possible types are video, audio, document, application, etc.

Specified by:
getType in interface ResourceTypeTranslator
Parameters:
fileName - The name of the file to determine the type for.
Returns:
The type of the file.

isAudioOrVideo

public boolean isAudioOrVideo(String type)
Description copied from interface: ResourceTypeTranslator
Returns whether or not the specified type is an audio or video type.

Specified by:
isAudioOrVideo in interface ResourceTypeTranslator
Parameters:
type - The type to analyze.
Returns:
true if it's an audio or video type, otherwise false.


Copyright © 2011-2013 LittleShoot. All Rights Reserved.