6 Replies Latest reply on Dec 3, 2012 1:47 AM by bondchan921

    how to retrieve the metadata in nest jar by vfs interface

    bondchan921

      Hi

       

      I'm try retrieve xyz.xml, which locates at a.sar/b.jar/Meta-Info/xyz.xml,

       

       

      //vfs is point to a.jar

       

      SuffixMatchFilter suffixMatchFilter = new SuffixMatchFilter("xyz.xml");

      List<VirtualFile> list = vfs.getChildrenRecursively(suffixMatchFilter );

       

       

      turns out, I can't get this xyz.xml, only Meta-info level folder was retrieve by default

        • 1. Re: how to retrieve the metadata in nest jar by vfs interface
          bondchan921

          can anybody give a hint ?

          • 2. Re: how to retrieve the metadata in nest jar by vfs interface
            bondchan921

            I also try to get all the children by call vfs.getChildrenRecursively(), and then traverse the returnlist, if the item is end with jar/, I call newVFS.getChildrenRecursively(), but only the 1st level of children return

            • 3. Re: how to retrieve the metadata in nest jar by vfs interface
              alesj

              What's the root of your lookup?

              Can you paste some code you use to do this.

               

              //vfs is point to a.jar ---> where you actually have a.sar

              • 4. Re: how to retrieve the metadata in nest jar by vfs interface
                bondchan921

                our app need to support jboss 4.2.3 and  jboss 5.1.0, due to the Mbean MainDeployer.listDeployed() return null in jboss 5.1.2, so I call MainDeployer.getKernelMainDeployer().getTopLevel(), returns the Collection of Deployment instances(all the deployments including our app jars/sars/wars),

                 

                  for echo instances{

                 

                                                        Deployment de = (Deployment)object

                  moduleMetaDataRet.setDeployName(de.getName(), object, null));

                                                        URL deployURL = new URL(moduleMetaDataRet.getDeployName());

                 

                 

                                                        VFSContextFactoryLocator vfsCFL = new VFSContextFactoryLocator();

                                                        VFSContextFactory vfsCF = vfsCFL.getFactory(deployURL);

                                                        VFSContext vfsContext = vfsCF.getVFS(deployURL);

                                                        VFS vfs = new VFS(vfsContext);

                 

                  vfs.getChildrenRecursively("xyz.xm") can't get the a.sar/b.jar/Meta-Info/xyz.xml

                 

                 

                }

                • 5. Re: how to retrieve the metadata in nest jar by vfs interface
                  alesj

                  Uh, you're definitely using too much impl details with that code.

                  Try casting the deployment into VFSDeployment, that should have getRoot method on it, which you can then use.

                  • 6. Re: how to retrieve the metadata in nest jar by vfs interface
                    bondchan921

                    yeah, that's true, and my problem is can't retriving the metadata of the nest jar

                     

                    Suppose the root is zipfile:/a.sar/,  then how can I get the metadata: a.sar/b.jar/Meta-Info/xyz.xml ?