public void resolveBundle (String path, final ResultListener<FileResourceBundle> listener)
    {
        File bfile = getResourceFile(path);
        if (bfile == null) {
            String errmsg = "ResourceManager not configured with resource directory.";
            listener.requestFailed(new IOException(errmsg));
            return;
        }

        final FileResourceBundle bundle = new FileResourceBundle(bfile, true, _unpack);
        if (bundle.isUnpacked()) {
            if (bundle.sourceIsReady()) {
                listener.requestCompleted(bundle);
            } else {
                String errmsg = "Bundle initialization failed.";
                listener.requestFailed(new IOException(errmsg));
            }
            return;
        }

        // start a thread to unpack our bundles
        ArrayList<ResourceBundle> list = Lists.newArrayList();
        list.add(bundle);
        Unpacker unpack = new Unpacker(list, new InitObserver() {
            public void progress (int percent, long remaining) {
                if (percent == 100) {
                    listener.requestCompleted(bundle);
                }
            }
            public void initializationFailed (Exception e) {
                listener.requestFailed(e);
            }
        });
        unpack.start();
    }
public void resolveBundle ( String path , final ResultListener < FileResourceBundle > listener ) { File bfile = getResourceFile ( path ) ; if ( bfile == null ) { String errmsg = "ResourceManager not configured with resource directory." ; listener . requestFailed ( new IOException ( errmsg ) ) ; return ; } final FileResourceBundle bundle = new FileResourceBundle ( bfile , true , _unpack ) ; if ( bundle . isUnpacked ( ) ) { if ( bundle . sourceIsReady ( ) ) { listener . requestCompleted ( bundle ) ; } else { String errmsg = "Bundle initialization failed." ; listener . requestFailed ( new IOException ( errmsg ) ) ; } return ; } ArrayList < ResourceBundle > list = Lists . newArrayList ( ) ; list . add ( bundle ) ; Unpacker unpack = new Unpacker ( list , new InitObserver ( ) { public void progress ( int percent , long remaining ) { if ( percent == 100 ) { listener . requestCompleted ( bundle ) ; } } public void initializationFailed ( Exception e ) { listener . requestFailed ( e ) ; } } ) ; unpack . start ( ) ; }
Resolve the specified bundle (the bundle file must already exist in the appropriate place on
the file system) and return it on the specified result listener. Note that the result
listener may be notified before this method returns on the caller's thread if the bundle is
already resolved, or it may be notified on a brand new thread if the bundle requires
unpacking.