Examples of ResourceMetadata


Examples of net.sf.clairv.common.ResourceMetaData

  public void start() {
    Collection resources = context.getResources();
    ResourceProcessor resourceProcessor = context.getResourceProcessor();
    for (Iterator itr = resources.iterator(); itr.hasNext(); ) {
      Resource resource = (Resource)itr.next();
      ResourceMetaData meta = resource.getMetaData();
      log.info("Starting to indexing resource: " + meta.getResourceName());
      long start = System.currentTimeMillis();
      int count = resourceProcessor.process(resource);
      log.info("Indexing on resource \"" + meta.getResourceName()
          + "\" done (" + (System.currentTimeMillis() - start)
          + "ms used, " + count + " records indexed)");
    }
    resourceProcessor.close();
  }
View Full Code Here

Examples of org.apache.ace.obr.metadata.util.ResourceMetaData

                resources.add(resource);
            }
            else {
                // this is some other resource, we might want to include it.
                if (all) {
                    ResourceMetaData metadata = ResourceMetaData.getArtifactMetaData(path.getName());
                    ResourceImpl impl = new ResourceImpl(repository, metadata.getSymbolicName(), new VersionRange(metadata.getVersion()));
                    impl.setURL(path.toURI().toURL());
                    resources.add(impl);
                }
            }
        }
View Full Code Here

Examples of org.apache.ace.obr.storage.file.BundleFileStore.ResourceMetaData

        assert !m_metadata.generated() : "After changing the directory, the metadata should not be regenerated.";
    }
   
    @Test(groups = { UNIT })
    public void checkArtifactMetadataGeneration() {
      ResourceMetaData data = m_bundleStore.getArtifactMetaData("resource-1.0.3.xml");
    assert "resource".equals(data.getSymbolicName()) : "Generated symbolic name should be 'resource', was " + data.getSymbolicName();
    assert "1.0.3".equals(data.getVersion()) : "Generated version should be '1.0.3', was " + data.getVersion();
    assert "xml".equals(data.getExtension()) : "Extension should be 'xml', was " + data.getExtension();

    data = m_bundleStore.getArtifactMetaData("maven-artifact-2.3.5-SNAPSHOT.jar");
    assert "maven-artifact".equals(data.getSymbolicName()) : "Generated symbolic name should be 'maven-artifact', was " + data.getSymbolicName();
    assert "2.3.5-SNAPSHOT".equals(data.getVersion()) : "Generated version should be '2.3.5-SNAPSHOT', was " + data.getVersion();
    assert "jar".equals(data.getExtension()) : "Extension should be 'jar', was " + data.getExtension();
    }
View Full Code Here

Examples of org.apache.hadoop.mapred.ResourceMetadata

        !counters.containsKey(MetricName.GRANTED) ||
        !counters.containsKey(MetricName.REQUESTED)) {
      return null;
    }

    return new ResourceMetadata(
        PoolInfo.createStringFromPoolInfo(poolInfo),
        counters.get(MetricName.MIN).intValue(),
        counters.get(MetricName.MAX).intValue(),
        counters.get(MetricName.GRANTED).intValue(),
        counters.get(MetricName.REQUESTED).intValue());
View Full Code Here

Examples of org.apache.sling.api.resource.ResourceMetadata

        this.resourceResolver = resourceResolver;
        this.bundle = bundle;
        this.mappedPath = mappedPath;

        metadata = new ResourceMetadata();
        metadata.setResolutionPath(resourcePath);
        metadata.setCreationTime(bundle.getBundle().getLastModified());
        metadata.setModificationTime(bundle.getBundle().getLastModified());

        if (resourcePath.endsWith("/")) {
View Full Code Here

Examples of org.apache.sling.api.resource.ResourceMetadata

     * length, last modification time and the resource path (same as
     * {@link #getPath()}).
     */
    public ResourceMetadata getResourceMetadata() {
        if (metaData == null) {
            metaData = new ResourceMetadata();
            metaData.setContentLength(file.length());
            metaData.setModificationTime(file.lastModified());
            metaData.setResolutionPath(resourcePath);
            if ( this.file.isDirectory() ) {
                metaData.put(ResourceMetadata.INTERNAL_CONTINUE_RESOLVING, Boolean.TRUE);
View Full Code Here

Examples of org.apache.sling.api.resource.ResourceMetadata

            } catch(MalformedURLException ignore) {
            }
        }
        final int firstDot = fullPath.indexOf(".");
       
        final ResourceMetadata metadata = new ResourceMetadata();
        final Resource r = new SyntheticResource(null, metadata, null);
        metadata.setResolutionPath(firstDot < 0 ? fullPath : fullPath.substring(0, firstDot));
        metadata.setResolutionPathInfo(firstDot < 0 ? null : fullPath.substring(firstDot));
        requestPathInfo = new SlingRequestPathInfo(r);
    }
View Full Code Here

Examples of org.apache.sling.api.resource.ResourceMetadata

        this.resourceResolver = resourceResolver;
        this.servlet = servlet;
        this.path = path;
        this.resourceType = ServletResourceProviderFactory.ensureServletNameExtension(path);

        this.metadata = new ResourceMetadata();
        metadata.setResolutionPath(path);
    }
View Full Code Here

Examples of org.apache.sling.api.resource.ResourceMetadata

        ResourceResolver resolver = requestResourceResolver.get();
        if (resolver != null) {
            try {
                final Resource resource = resolver.getResource(cleanPath(path, true));
                if (resource != null) {
                    ResourceMetadata meta = resource.getResourceMetadata();
                    long modTime = meta.getModificationTime();
                    return (modTime > 0) ? modTime : 0;
                }
            } catch (final SlingException se) {
                log.error("Cannot get last modification time for " + path, se);
            }
View Full Code Here

Examples of org.apache.sling.api.resource.ResourceMetadata

/** Test the StarResource */
public class StarResourceTest {

  private void assertSplit(String requestPath, String path, String pathInfo) {
    final ResourceMetadata rm = StarResource.getResourceMetadata(requestPath);
    assertEquals("For requestPath=" + requestPath + ", path matches", path, rm.getResolutionPath());
    assertEquals("For requestPath=" + requestPath + ", pathInfo matches", pathInfo, rm.getResolutionPathInfo());
  }
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.