Examples of DirectoryResource


Examples of com.noelios.restlet.local.DirectoryResource

     * @return A new directory resource.
     * @throws IOException
     */
    public Resource createDirectoryResource(Directory handler, Request request,
            Response response) throws IOException {
        return new DirectoryResource(handler, request, response);
    }
View Full Code Here

Examples of org.apache.avalon.excalibur.monitor.DirectoryResource

    public void testDirectoryDelete()
        throws Exception
    {
        final File dir = createDir();
        final DirectoryResource resource =
            new DirectoryResource( dir.getCanonicalPath() );
        deleteDir( dir );
        try
        {
            resource.testModifiedAfter( System.currentTimeMillis() );
        }
        catch( final Exception e )
        {
            fail( "Received exception when dir deleted: " + e );
        }
View Full Code Here

Examples of org.impalaframework.spring.resource.DirectoryResource

        Class<?> cls1 = Class.forName("org.impalaframework.interactive.command.CommandStateConstants", false, pcl);
        assertSame(cls1.getClassLoader(), pcl);
    }
   
    public void testLoadClassURL() throws Exception {
        ModuleClassLoader pcl = new ModuleClassLoader(new URL[] { new DirectoryResource(getCompileFile("impala-interactive")).getURL() });

        // check that this class loader loads the named class
        Class<?> cls1 = Class.forName("org.impalaframework.interactive.command.CommandStateConstants", false, pcl);
        assertSame(cls1.getClassLoader(), pcl);
    }
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource

      {
         filter = acceptsAllProjects;
      }

      Project result = null;
      DirectoryResource r = (target instanceof DirectoryResource) ? (DirectoryResource) target : target
               .getParent();
      while (r != null && result == null)
      {
         Iterator<ProjectCache> cacheIterator = caches.iterator();
         while (cacheIterator.hasNext() && result == null)
         {
            ProjectCache cache = cacheIterator.next();
            try
            {
               result = cache.get(r);
               if (result != null && !filter.accept(result))
                  result = null;
               if (result != null)
                  break;
            }
            finally
            {
               caches.release(cache);
            }
         }

         if (result == null && buildSystem.containsProject(r))
         {
            result = buildSystem.createProject(r);
            if (result != null && !filter.accept(result))
               result = null;

            if (result != null)
            {
               registerAvailableFacets(result);
               cacheProject(result);
            }
         }

         r = r.getParent();
      }

      return result;
   }
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource

                           + getMissingBuildSystemFacets(buildSystem, getRequiredBuildSystemFacets(facetTypes)));

      Project result = buildSystem.createProject(target);
      if (result != null)
      {
         DirectoryResource parentDir = result.getProjectRoot().getParent().reify(DirectoryResource.class);
         if (parentDir != null)
         {
            Imported<ProjectAssociationProvider> buildSystemInstances = registry
                     .getServices(ProjectAssociationProvider.class);
            for (ProjectAssociationProvider provider : buildSystemInstances)
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource

   @Override
   public Project createTempProject(BuildSystem buildSystem, Iterable<Class<? extends ProjectFacet>> facetTypes)
   {
      File rootDirectory = OperatingSystemUtils.createTempDir();
      DirectoryResource addonDir = resourceFactory.create(DirectoryResource.class, rootDirectory);
      DirectoryResource projectDir = addonDir.createTempResource();
      projectDir.deleteOnExit();
      Project project = createProject(projectDir, buildSystem, facetTypes);
      return project;
   }
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource

   @Override
   public boolean containsProject(DirectoryResource bound, FileResource<?> target, BuildSystem buildSystem)
   {
      Assert.notNull(bound, "Boundary should not be null");
      Assert.isTrue(isParent(bound, target), "Target should be a child of bound");
      DirectoryResource dir = (target instanceof DirectoryResource) ? (DirectoryResource) target : target.getParent();
      boolean found = false;
      DirectoryResource r = bound;
      while (r != null && !found)
      {
         found = buildSystem.containsProject(r);
         if (dir.equals(r))
         {
            break;
         }
         r = r.getParent();
      }
      return found;
   }
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource

      return found;
   }

   private boolean isParent(DirectoryResource dir, FileResource<?> child)
   {
      DirectoryResource childDir = (child instanceof DirectoryResource) ? child.reify(DirectoryResource.class) : child
               .getParent();
      while (childDir != null)
      {
         if (dir.equals(childDir))
         {
            return true;
         }
         childDir = childDir.getParent();
      }
      return false;
   }
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource

   public boolean containsProject(FileResource<?> target, BuildSystem buildSystem)
   {
      Assert.notNull(target, "Target resource must not be null.");
      Assert.notNull(buildSystem, "Project build system must not be null.");
      boolean found = false;
      DirectoryResource dir = (target instanceof DirectoryResource) ? (DirectoryResource) target : target.getParent();
      DirectoryResource r = dir;
      while (r != null && !found)
      {
         found = buildSystem.containsProject(r);
         r = r.getParent();
      }
      return found;
   }
View Full Code Here

Examples of org.jboss.forge.addon.resource.DirectoryResource

   public void setupAddonProject(Project project, Version forgeVersion, Iterable<AddonId> dependencyAddons)
   {
      MetadataFacet metadata = project.getFacet(MetadataFacet.class);
      String projectName = metadata.getProjectName();
      metadata.setProjectName(projectName + "-parent");
      DirectoryResource newRoot = project.getProjectRoot().getParent().getChildDirectory(metadata.getProjectName());
      // FORGE-877: there's an eclipse (not m2e) limitation that says if a project is located directly in the workspace
      // folder, then the imported project's name is always the same as the folder it is contained in.
      if (newRoot.exists() || !project.getProjectRoot().renameTo(newRoot))
      {
         log.warning("Could not rename project root");
      }

      dependencyInstaller.installManaged(project, DependencyBuilder.create(ForgeContainerAPIFacet.FORGE_API_DEPENDENCY)
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.