Package com.zopim.android.sdk.attachment
Enum FileExtension
- java.lang.Object
-
- java.lang.Enum<FileExtension>
-
- com.zopim.android.sdk.attachment.FileExtension
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<FileExtension>
public enum FileExtension extends java.lang.Enum<FileExtension>
Definition of a file extensions used in Zopim attachment upload and download events. Extensions as defined inandroid.webkit.MimeTypeMap
FileExtension.JPG
image typeFileExtension.JPEG
image typeFileExtension.PNG
image typeFileExtension.GIF
image typeFileExtension.PDF
document typeFileExtension.TXT
text typeFileExtension.UNKNOWN
unknown type
- See Also:
- Zopim attachments page
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static FileExtension
getExtension(java.io.File file)
Gets the file extension of the file passed as parameterjava.lang.String
getValue()
Gets the value of this raw extension enumstatic FileExtension
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FileExtension
valueOfExtension(java.lang.String extension)
Gets extension type that matched the criteriastatic FileExtension[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
JPG
public static final FileExtension JPG
-
JPEG
public static final FileExtension JPEG
-
PNG
public static final FileExtension PNG
-
GIF
public static final FileExtension GIF
-
PDF
public static final FileExtension PDF
-
TXT
public static final FileExtension TXT
-
UNKNOWN
public static final FileExtension UNKNOWN
-
-
Method Detail
-
values
public static FileExtension[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FileExtension c : FileExtension.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FileExtension valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getValue
public java.lang.String getValue()
Gets the value of this raw extension enum- Returns:
- extension value as defined in the enum
-
valueOfExtension
public static FileExtension valueOfExtension(java.lang.String extension)
Gets extension type that matched the criteriaAccepts extension values not containing the dot('.') as defined in
android.webkit.MimeTypeMap
. It's case insensitive so both JPG and jpg are valid extensions. See list of valid extensions inFileExtension
.- Parameters:
extension
- A file extension without the leading '.'- Returns:
- extension type or
FileExtension.UNKNOWN
if not found
-
getExtension
public static FileExtension getExtension(java.io.File file)
Gets the file extension of the file passed as parameter- Parameters:
file
- to interpret- Returns:
- file extension or
FileExtension.UNKNOWN
if not found
-
-