Package org.sonatype.nexus.proxy.item

Examples of org.sonatype.nexus.proxy.item.DefaultStorageLinkItem


    if (shadowPaths != null && !shadowPaths.isEmpty()) {
      ResourceStoreRequest req = new ResourceStoreRequest(shadowPaths.get(0));
      req.getRequestContext().setParentContext(item.getItemContext());

      DefaultStorageLinkItem link =
          new DefaultStorageLinkItem(this, req, true, true, item.getRepositoryItemUid());

      storeItem(false, link);

      return link;
    }
View Full Code Here


        // Probe for link only if we KNOW it's not an attribute but "plain" content
        final boolean isAttribute = uid.getBooleanAttributeValue(IsItemAttributeMetacontentAttribute.class);
        final boolean isLink = !isAttribute && getLinkPersister().isLinkContent(fileContent);
        if (isLink) {
          try {
            DefaultStorageLinkItem link =
                new DefaultStorageLinkItem(repository, request, target.canRead(), target.canWrite(),
                    getLinkPersister().readLinkContent(fileContent));
            repository.getAttributesHandler().fetchAttributes(link);
            link.setModified(target.lastModified());
            link.setCreated(target.lastModified());
            result = link;

            repository.getAttributesHandler().touchItemLastRequested(System.currentTimeMillis(), link);
          }
          catch (NoSuchRepositoryException e) {
View Full Code Here

  {
    final ResourceStoreRequest req = new ResourceStoreRequest(path);

    req.getRequestContext().setParentContext(item.getItemContext());

    final DefaultStorageLinkItem link =
        new DefaultStorageLinkItem(repository, req, true, true, item.getRepositoryItemUid());

    repository.storeItem(false, link);
  }
View Full Code Here

        new ResourceStoreRequest("/a.txt"),
        true,
        true,
        new StringContentLocator(contentString));
    inhouse.storeItem(false, file);
    DefaultStorageLinkItem link = new DefaultStorageLinkItem(inhouse, new ResourceStoreRequest("/b.txt"), true, true,
        file.getRepositoryItemUid());
    inhouse.storeItem(false, link);
  }
View Full Code Here

        true,
        new StringContentLocator(contentString));
    file.getRepositoryItemAttributes().put("attr1", "ATTR1");
    repo1.storeItem(false, file);

    DefaultStorageLinkItem link = new DefaultStorageLinkItem(repo1, new ResourceStoreRequest("/b.txt"), true, true, file
        .getRepositoryItemUid());
    repo1.getLocalStorage().storeItem(repo1, link);

    StorageItem item = repo1.retrieveItem(new ResourceStoreRequest("/b.txt", true));
    assertEquals(DefaultStorageLinkItem.class, item.getClass());
View Full Code Here

            "This is a file."));
    repository.storeItem(false, fileItem);
    // a link
    final ResourceStoreRequest linkRequest = new ResourceStoreRequest("/linkItem.txt");
    final StorageLinkItem linkItem =
        new DefaultStorageLinkItem(repository, linkRequest, true, true, fileItem.getRepositoryItemUid());
    repository.storeItem(false, linkItem);
    // a composite
    final ResourceStoreRequest compositeRequest = new ResourceStoreRequest("/compositeItem.txt");
    final StorageCompositeFileItem compositeItem =
        new DefaultStorageCompositeFileItem(repository, compositeRequest, true, true, new StringContentLocator(
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.item.DefaultStorageLinkItem

Copyright © 2018 www.massapicom. 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.