|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vodafone360.people.utils.ThumbnailUtils
public final class ThumbnailUtils
Set of static utility functions for handling of thumb-nails within the People client. Thumb-nails are stored in a specific sub-directory ('app_np_thumbs') of the People application directory. Thumb-nail names are based on a supplied ID (local Contact ID).
| Field Summary | |
|---|---|
private static java.lang.String |
JPG_EXTENSION
JPEG file extension. |
private static int |
PHOTO_QUALITY
Thumbnail file compression quality. |
static java.lang.String |
PNG_EXTENSION
PNG file extension. |
static java.lang.String |
REQUEST_THUMBNAIL_URI
Thumbnail request URI. |
static java.lang.String |
THUMBNAIL_FILE_LOCATION
Full path for the thumbnails. |
private static int |
THUMBNAIL_HEIGHT
Height of thumb-nails stored by People client. |
private static int |
THUMBNAIL_WIDTH
Width of thumb-nails stored by People client. |
| Constructor Summary | |
|---|---|
private |
ThumbnailUtils()
Private constructor to prevent the utility class from being instantiated. |
| Method Summary | |
|---|---|
static boolean |
copyAndCompressBitmap(java.lang.String destinationPath,
Bitmap inputPhoto)
Copies and compresses the given bitmap image. |
private static void |
ensureThumbnailFolderExists()
Checks if the thumbnail folder exists and creates it if not. |
private static java.io.File |
makeFile(long localContactId)
Creates a new File for the given Local Contact ID. |
static void |
saveExternalResponseObjectToFile(long localContactId,
ExternalResponseObject ext,
int quality)
Saves an image in an ExternalResponseObject to the file system. |
static java.lang.String |
thumbnailFileToWrite(java.lang.Long thumbnailId)
Generate filename for thumb-nail. |
static Bitmap |
thumbnailFromFile(java.lang.Long thumbnailId)
Return Bitmap containing thumb-nail matching the supplied ID. |
static java.lang.String |
thumbnailPath(java.lang.Long thumbnailId)
Return path to file containing specified thumb-nail. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String THUMBNAIL_FILE_LOCATION
private static final java.lang.String JPG_EXTENSION
public static final java.lang.String PNG_EXTENSION
public static final java.lang.String REQUEST_THUMBNAIL_URI
private static final int PHOTO_QUALITY
private static final int THUMBNAIL_HEIGHT
private static final int THUMBNAIL_WIDTH
| Constructor Detail |
|---|
private ThumbnailUtils()
| Method Detail |
|---|
public static java.lang.String thumbnailPath(java.lang.Long thumbnailId)
thumbnailId - ID of thumb-nail.
public static java.lang.String thumbnailFileToWrite(java.lang.Long thumbnailId)
thumbnailId - ID of thumb-nail (e.g. local Contact ID).
public static Bitmap thumbnailFromFile(java.lang.Long thumbnailId)
thumbnailId - ID of thumb-nail to retrieve.
private static void ensureThumbnailFolderExists()
public static boolean copyAndCompressBitmap(java.lang.String destinationPath,
Bitmap inputPhoto)
throws java.io.IOException
destinationPath - Path to save new image.inputPhoto - Input Bitmap to save.
java.io.IOException - Issue with photoPath in the file system.
java.io.FileNotFoundException - Issue with photoPath in the file system.
java.security.InvalidParameterException - destinationPath is empty.
java.security.InvalidParameterException - inputPhoto is NULL.
public static void saveExternalResponseObjectToFile(long localContactId,
ExternalResponseObject ext,
int quality)
throws java.io.IOException
localContactId - Local contact ID if the new Thumbnail files.ext - Given ExternalResponseObject to convert.quality - Compression quality of saved image.
java.io.IOException - File system issues.
private static java.io.File makeFile(long localContactId)
throws java.io.IOException
localContactId - Local contact ID if the new Thumbnail files.
java.io.IOException - File system issue.
java.security.InvalidParameterException - localContactId must be above 0.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
JavaDoc