Package javax.microedition.io.file

Examples of javax.microedition.io.file.FileConnection.list()


        return i < 10 ? "0" + i : "" + i;
    }

    public static String[] listDir(String dirUrl) throws IOException {
        FileConnection fileConn = (FileConnection) Connector.open(dirUrl, Connector.READ);
        Enumeration list = fileConn.list();
        Vector files = new Vector();

        while (list.hasMoreElements()) {
            files.addElement(list.nextElement());
        }
View Full Code Here


     */
    public void directoryWalk(String path) {
        files.removeAllElements();
        try {
            FileConnection fc = (FileConnection) Connector.open(path, Connector.READ);
            Enumeration fl = fc.list("*.jpg", true);
            while(fl.hasMoreElements()) {
                files.addElement((String) fl.nextElement());
            }
            fc.close();
        }
View Full Code Here

          return;
        }
        String path = fileList.path + filename;
        FileConnection fc = (FileConnection) Connector.open("file:///" + path, Connector.READ);
        if (fc.isDirectory()) {
          newList = new FileList(filename, path, fileList, fc.list());
          fileList.sublists[index] = newList;
          displayFileList(newList);
          return;
        }
        InputStream is = fc.openInputStream();
View Full Code Here

            if (MEGA_ROOT.equals(currDirName)) {
                e = FileSystemRegistry.listRoots();
            } else {
                currDir = (FileConnection) Connector.open("file://localhost/"
                        + currDirName);
                e = currDir.list();
                // not root - draw UP_DIRECTORY
                browser.append(UP_DIRECTORY, dirIcon);
            }

            while (e.hasMoreElements()) {
View Full Code Here

    private void checkDeleteFolder(String folderName) {
        try {
            FileConnection fcdir = (FileConnection) Connector
                    .open("file://localhost/" + currDirName + folderName);
            Enumeration content = fcdir.list("*", true);
            // only empty directory can be deleted
            if (!content.hasMoreElements()) {
                fcdir.delete();
                showCurrDir();
            } else {
View Full Code Here

            if (MEGA_ROOT.equals(currDirName)) {
                e = FileSystemRegistry.listRoots();
            } else {
                currDir = (FileConnection) Connector.open("file://localhost/"
                        + currDirName);
                e = currDir.list();
                // not root - draw UP_DIRECTORY
                browser.append(UP_DIRECTORY, dirIcon);
            }

            while (e.hasMoreElements()) {
View Full Code Here

    private void checkDeleteFolder(String folderName) {
        try {
            FileConnection fcdir = (FileConnection) Connector
                    .open("file://localhost/" + currDirName + folderName);
            Enumeration content = fcdir.list("*", true);
            // only empty directory can be deleted
            if (!content.hasMoreElements()) {
                fcdir.delete();
                showCurrDir();
            } else {
View Full Code Here

            if (MEGA_ROOT.equals(currDirName)) {
                e = FileSystemRegistry.listRoots();
            } else {
                currDir = (FileConnection) Connector.open("file://localhost/"
                        + currDirName);
                e = currDir.list();
                // not root - draw UP_DIRECTORY
                browser.append(UP_DIRECTORY, dirIcon);
            }

            while (e.hasMoreElements()) {
View Full Code Here

    private void checkDeleteFolder(String folderName) {
        try {
            FileConnection fcdir = (FileConnection) Connector
                    .open("file://localhost/" + currDirName + folderName);
            Enumeration content = fcdir.list("*", true);
            // only empty directory can be deleted
            if (!content.hasMoreElements()) {
                fcdir.delete();
                showCurrDir();
            } else {
View Full Code Here

    }

    private Enumeration list() throws IOException
    {
        final FileConnection connection = (FileConnection)Connector.open( PREFIX + path_, Connector.READ );
        final Enumeration enumeration = connection.list();
        connection.close();
        return enumeration;
    }

    private boolean isDirectory( final String filename )
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.