Examples of listResources()


Examples of org.jboss.forge.addon.parser.java.resources.JavaResource.listResources()

         @Override
         public Iterable<JavaFieldResource> call()
         {
            JavaResource javaResource = targetClass.getValue();
            if (javaResource != null)
               return ResourceUtil.filterByType(JavaFieldResource.class, javaResource.listResources());
            return Collections.emptyList();
         }
      });

      onMethod.setValueChoices(new Callable<Iterable<JavaMethodResource>>()
View Full Code Here

Examples of org.jboss.forge.addon.parser.java.resources.JavaResource.listResources()

         @Override
         public Iterable<JavaMethodResource> call()
         {
            JavaResource javaResource = targetClass.getValue();
            if (javaResource != null)
               return ResourceUtil.filterByType(JavaMethodResource.class, javaResource.listResources());
            return Collections.emptyList();
         }
      });

      onProperty.setItemLabelConverter(new Converter<JavaFieldResource, String>()
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource.listResources()

   @Override
   public void validate(UIValidationContext validator)
   {
      DirectoryResource folder = targetDirectory.getValue();
      if (folder.exists() && (!folder.isDirectory() || !folder.listResources().isEmpty()))
      {
         validator.addValidationError(targetDirectory, "The specified target directory should not exist or should be empty directory");
      }
   }
View Full Code Here

Examples of org.jboss.forge.resources.DirectoryResource.listResources()

                     shortName = "a",
                     description = "Show extra information about each installed plugin",
                     defaultValue = "false") boolean showAll)
   {
      DirectoryResource pluginDir = environment.getPluginDirectory();
      List<Resource<?>> list = pluginDir.listResources();
      List<Resource<?>> untracked = new ArrayList<Resource<?>>();
      List<PluginJar> installed = new ArrayList<PluginJar>();

      if (!list.isEmpty())
      {
View Full Code Here

Examples of org.jboss.forge.resources.DirectoryResource.listResources()

   private FileResource<?> createIncrementedPluginJarFile(Dependency dep)
   {
      int version = 0;
      PluginJar pluginJar = new PluginJar(dep);
      DirectoryResource pluginDir = environment.getPluginDirectory();
      List<Resource<?>> list = pluginDir.listResources(new StartsWith(pluginJar.getName()));

      if (list.size() > 0 && !prompt.promptBoolean(
                        "An existing version of this plugin was found. Replace it?", true))
      {
         throw new RuntimeException("Aborted.");
View Full Code Here

Examples of org.jboss.forge.resources.PropertiesFileResource.listResources()

         for (Resource<?> path : paths)
         {
            if (path instanceof PropertiesFileResource)
            {
               PropertiesFileResource propResource = (PropertiesFileResource) path;
               for (Resource<?> resource : propResource.listResources())
               {
                  EntryResource<String, String> entryResource = (EntryResource<String, String>) resource;
                  out.print(ShellColor.BOLD, entryResource.getKey() + ": ");
                  out.println(entryResource.getValue());
               }
View Full Code Here

Examples of org.jboss.forge.resources.java.JavaResource.listResources()

               }
               else if (javaSource instanceof JavaEnum)
               {
                  JavaResource enumTypeResource = (JavaResource) resource;

                  List<Resource<?>> members = enumTypeResource.listResources();
                  for (Resource<?> member : members)
                  {
                     String entry = member.getName();
                     output.add(entry);
                  }
View Full Code Here

Examples of org.osgi.framework.wiring.BundleWiring.listResources()

    private void loadImplementationsInBundle(final Test test, final String packageName) {
        //Do not remove the cast on the next line as removing it will cause a compile error on Java 7.
        final BundleWiring wiring = (BundleWiring) FrameworkUtil.getBundle(
                ResolverUtil.class).adapt(BundleWiring.class);
        final Collection<String> list = wiring.listResources(packageName, "*.class",
            BundleWiring.LISTRESOURCES_RECURSE);
        for (final String name : list) {
            addIfMatching(test, name);
        }
    }
View Full Code Here

Examples of org.osgi.framework.wiring.BundleWiring.listResources()

                    "cannot be adapted to BundleWiring, state: " + bundle.getState());
            return;
        }

        // Only lookup for local classes, parent classes will be analyzed on demand.
        Collection<String> resources = wiring.listResources("/", "*.class",
                BundleWiring.FINDENTRIES_RECURSE + BundleWiring.LISTRESOURCES_LOCAL);
        if (resources == null) {
            m_logger.log(Log.ERROR, "The bundle " + bundle.getBundleId() + " (" + bundle.getSymbolicName() + ") " +
                    " does not have any classes to be analyzed");
            return;
View Full Code Here

Examples of org.osgi.framework.wiring.BundleWiring.listResources()

        Bundle[] bundles = getBundleContext().getBundles();
        String filter = "*" + className + "*";
        for (Bundle bundle:bundles){
            BundleWiring wiring = bundle.adapt(BundleWiring.class);
            if (wiring != null){
                Collection<String> resources = wiring.listResources("/", filter, BundleWiring.LISTRESOURCES_RECURSE);
                if (resources.size() > 0){
                    String title = ShellUtil.getBundleName(bundle);
                    System.out.println("\n" + title);
                }
                for (String resource:resources){
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.