com.nokia.mid.ui
Class FileSelect

java.lang.Object
  extended by com.nokia.mid.ui.FileSelect

public final class FileSelect
extends java.lang.Object

A class which gives the client the ability to use the device's File Select to list and select files.

The launch will block and wait until the File Select exits. If this is not the desired behavior, the client should start a new thread for the launch. Note: don't use it in the event handling thread, e.g. command action.

Functionalities provided by the File Select are:

Code Snippet 1:

// This is a sample code to launch the File Select from the root of
// all user file systems to browse for single selection. And only files which media type is MEDIA_TYPE_PICTURE will be displayed.
try
{
    // Instantiate the FileSelect with types
    FileSelectDetail [] arrSelectedFiles = FileSelect.launch(FileSelect.FILE_SYSTEM_ALL, FileSelect.MEDIA_TYPE_PICTURE, false);

    // If files were selected and returned
    if (arrSelectedFiles != null)
    {
        System.out.println("number of selected files " + arrSelectedFiles.length);
        for (int i = 0; i < arrSelectedFiles.length; i++)
        {
            System.out.println("mime_type " + arrSelectedFiles[i].mimeType);
            System.out.println("display_name " + arrSelectedFiles[i].displayName);
            System.out.println("url " + arrSelectedFiles[i].url);
            System.out.println("size" + arrSelectedFiles[i].size);
        }
    }
}
catch (Exception ex)
{
    log("Exception: " + ex.toString());
}
 

Code Snippet 2:

// This is a sample code to launch the File Select specifying the photos folder to browser for multiple selection and no file type filtering
try
{
    FileSelectDetail [] arrSelectedFiles = FileSelect.launch(System.getProperty("fileconn.dir.photos"), FileSelect.MEDIA_TYPE_ALL, true);

    // If files were selected and returned
    if (arrSelectedFiles != null)
    {
        System.out.println("number of selected files " + arrSelectedFiles.length);
        for (int i = 0; i < arrSelectedFiles.length; i++)
        {
            System.out.println("mime_type " + arrSelectedFiles[i].mimeType);
            System.out.println("display_name " + arrSelectedFiles[i].displayName);
            System.out.println("url " + arrSelectedFiles[i].url);
            System.out.println("size" + arrSelectedFiles[i].size);
        }
    }
}
catch (Exception ex)
{
    log("Exception: " + ex.toString());
}
 


Field Summary
static java.lang.String FILE_SYSTEM_ALL
          All user file systems.
static java.lang.String FILE_SYSTEM_EXTERNAL
          External user file system.
static java.lang.String FILE_SYSTEM_INTERNAL
          Internal user file system.
static int MEDIA_TYPE_ALL
          All media types.
static int MEDIA_TYPE_APPLICATION
          Application media types.
static int MEDIA_TYPE_AUDIO
          Video media types.
static int MEDIA_TYPE_PICTURE
          Picture media types.
static int MEDIA_TYPE_VIDEO
          Video media types.
 
Method Summary
static FileSelectDetail[] launch(java.lang.String startURL, int mediaType, boolean multipleSelection)
          Launch the File Select component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEDIA_TYPE_ALL

public static final int MEDIA_TYPE_ALL
All media types. Value 0 is assigned to MEDIA_TYPE_ALL. See Also:Constant Field Values

See Also:
Constant Field Values

MEDIA_TYPE_PICTURE

public static final int MEDIA_TYPE_PICTURE
Picture media types. Value 1 is assigned to MEDIA_TYPE_PICTURE. See Also:Constant Field Values

See Also:
Constant Field Values

MEDIA_TYPE_AUDIO

public static final int MEDIA_TYPE_AUDIO
Video media types. Value 2 is assigned to MEDIA_TYPE_AUDIO. See Also:Constant Field Values

See Also:
Constant Field Values

MEDIA_TYPE_VIDEO

public static final int MEDIA_TYPE_VIDEO
Video media types. Value 4 is assigned to MEDIA_TYPE_VIDEO. See Also:Constant Field Values

See Also:
Constant Field Values

MEDIA_TYPE_APPLICATION

public static final int MEDIA_TYPE_APPLICATION
Application media types. Value 8 is assigned to MEDIA_TYPE_APPLICATION. See Also:Constant Field Values

See Also:
Constant Field Values

FILE_SYSTEM_ALL

public static final java.lang.String FILE_SYSTEM_ALL
All user file systems. Value "ALL" is assigned to FILE_SYSTEM_ALL. See Also:Constant Field Values

See Also:
Constant Field Values

FILE_SYSTEM_EXTERNAL

public static final java.lang.String FILE_SYSTEM_EXTERNAL
External user file system. Value "EXTERNAL" is assigned to FILE_SYSTEM_EXTERNAL. See Also:Constant Field Values

See Also:
Constant Field Values

FILE_SYSTEM_INTERNAL

public static final java.lang.String FILE_SYSTEM_INTERNAL
Internal user file system. Value "INTERNAL" is assigned to FILE_SYSTEM_INTERNAL. See Also:Constant Field Values

See Also:
Constant Field Values
Method Detail

launch

public static FileSelectDetail[] launch(java.lang.String startURL,
                                        int mediaType,
                                        boolean multipleSelection)
                                 throws java.io.IOException,
                                        java.lang.IllegalArgumentException
Launch the File Select component. The launch will block and wait until the File Select exits. Only one launch call will be processed at a time.

Parameters:
startURL - the begin file path. It can be FILE_SYSTEM_ALL, FILE_SYSTEM_INTERNAL, FILE_SYSTEM_EXTERNAL and other valid file path.
mediaType - the filter media types. It can be one or combination of the media type constant defined in this API.
multipleSelection - whether enabling or disabling multiple selection.
Returns:
null if no file is selected; otherwise the array of FileSelectDetail
Throws:
java.io.IOException - if either the FileSelect is busy or file system is not ready.
java.lang.IllegalArgumentException - if either the startURL or mediaType is invalid.


Copyright © 2012 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. Other product and company names mentioned herein may be trademarks or trade names of their respective owners. This document is confidential information of Nokia Corporation.

Disclaimer
The information in this document is provided "as is," with no warranties whatsoever, including any warranty of merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal, specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed substantially prior to final release.

Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to this document and implementation of any information presented in this document.

Nokia Corporation retains the right to make changes to this document at any time, without notice.

License
Subject to above disclaimer, a license is hereby granted to use this documentation solely under existing Limited License Agreement and non-disclosure agreement between the companies for the agreed application development for Series 40 Nokia phones. No other licenses e.g. to any intellectual property rights are granted herein. Any use of the screen shots of this documentation, including any icons thereof, is subject to Nokia's prior written approval.