Package org.jdesktop.wonderland.client.content.spi

Examples of org.jdesktop.wonderland.client.content.spi.ContentImporterSPI


            for (String extension : extensions) {
                if (extension == null) {
                    continue;
                }

                ContentImporterSPI curImporter = contentImportMap.get(extension.toLowerCase());

                // XXX the use of .equals() here is problematic -- it
                // means we can easily overwrite valid values with null
                // if unregister is called after register XXX
                if (curImporter != null && curImporter.equals(importer)) {
                    contentImportMap.remove(extension.toLowerCase());
                }
            }
        }
    }
View Full Code Here


    public ContentImporterSPI getContentImporter(String extension, boolean useDefault) {
        if (extension == null) {
            return null;
        }

        ContentImporterSPI importer = contentImportMap.get(extension.toLowerCase());
        if (importer == null && useDefault == true) {
            return defaultContentImporter;
        }
        return importer;
    }
View Full Code Here

        }

        // Otherwise, ask the content manager for whom handles this kind of
        // file and dispatch there.
        ContentImportManager cim = ContentImportManager.getContentImportManager();
        final ContentImporterSPI importer = cim.getContentImporter(extension, true);
        if (importer == null) {
            logger.warning("No importer found for " + file.getAbsolutePath());
            return;
        }

        // Kick off a thread to upload the content. We put this in its own
        // thread to let this method complete (since we are running on the
        // AWT event queue.
        new Thread() {
            @Override
            public void run() {
                try {
                    String uri = importer.importFile(file, extension, createCell);
                    if (listener != null) {
                        listener.importSuccess(uri);
            }
                } catch (Throwable t) {
                    if (listener != null) {
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.content.spi.ContentImporterSPI

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.