Package net.rim.device.api.io.file

Examples of net.rim.device.api.io.file.FileSystemJournalEntry


    public void fileJournalChanged() {
        // next sequence number file system will use
        long nextUSN = FileSystemJournal.getNextUSN();

        for( long currentUSN = _lastUSN; currentUSN < nextUSN; currentUSN++ ) {
            FileSystemJournalEntry entry = FileSystemJournal.getEntry( currentUSN );
            if( entry == null ) {
                continue; // Journal entry no longer available. Skip it.
            }

            String path = entry.getPath();

            if( path != null ) {
                boolean matches = pathMatches( path );
                if( matches ) {
                    switch( entry.getEvent() ) {
                        case FileSystemJournalEntry.FILE_ADDED: {
                            onFileAdded( path );
                            break;
                        }
                        case FileSystemJournalEntry.FILE_DELETED: {
                            onFileRemoved( path );
                            break;
                        }
                        case FileSystemJournalEntry.FILE_CHANGED: {
                            onFileChanged( path );
                            break;
                        }
                        case FileSystemJournalEntry.FILE_RENAMED: {
                            onFileRenamed( entry.getOldPath(), path );
                            break;
                        }
                    } // switch(entry.getEvent()
                } // if (matches)
            } // if (path != null)
View Full Code Here


            final long nextUSN = FileSystemJournal.getNextUSN();
            String cameraImagePath = null;

            for (long lookUSN = nextUSN - 1; lookUSN >= _lastUSN
                    && cameraImagePath == null; lookUSN--) {
                final FileSystemJournalEntry entry =
                        FileSystemJournal.getEntry(lookUSN);

                if (entry == null) {
                    // We didn't find an entry
                    break;
                }

                if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED) {
                    cameraImagePath = entry.getPath();
                    if (cameraImagePath != null
                            && (cameraImagePath.endsWith("png")
                                    || cameraImagePath.endsWith("jpg")
                                    || cameraImagePath.endsWith("bmp") || cameraImagePath
                                    .endsWith("gif"))) {
View Full Code Here

    public void fileJournalChanged() {
        final long nextUSN = FileSystemJournal.getNextUSN();
        String msg = null;

        for (long lookUSN = nextUSN - 1; lookUSN >= _lastUSN && msg == null; --lookUSN) {
            final FileSystemJournalEntry entry =
                    FileSystemJournal.getEntry(lookUSN);

            // We didn't find an entry
            if (entry == null) {
                break;
            }

            // Check if this entry was added or deleted
            final String path = entry.getPath();

            if (path != null) {
                switch (entry.getEvent()) {
                case FileSystemJournalEntry.FILE_ADDED:
                    msg = "File was added.";
                    break;

                case FileSystemJournalEntry.FILE_DELETED:
View Full Code Here

TOP

Related Classes of net.rim.device.api.io.file.FileSystemJournalEntry

Copyright © 2018 www.massapicom. 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.