org.littleshoot.util
Class ResourceTypeTranslatorImpl
java.lang.Object
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.
|
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 |
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
ResourceTypeTranslatorImpl
public ResourceTypeTranslatorImpl()
- Creates a new translator for media types.
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.