Package org.sonatype.nexus.proxy.item

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


        try {
          result = doRetrieveItemFromMaster(request);

          // try to create link on the fly
          try {
            StorageLinkItem link = createLink(result);

            if (link != null) {
              return link;
            }
            else {
View Full Code Here


        new DefaultStorageFileItem(repository, fileRequest, true, true, new StringContentLocator(
            "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 =
View Full Code Here

    final ResourceStoreRequest rsr = getResourceStoreRequest(request);
    try {
      try {
        StorageItem item = repositoryRouter.retrieveItem(rsr);
        if (item instanceof StorageLinkItem) {
          final StorageLinkItem link = (StorageLinkItem) item;
          if (DEREFERENCE_LINKS) {
            item = dereferenceLink(link);
          }
          else {
            webUtils.sendTemporaryRedirect(response, getLinkTargetUrl(link));
View Full Code Here

   * dereference is not found, the usual {@link ItemNotFoundException} will be thrown (by the method used to
   * dereference).
   */
  protected StorageItem dereferenceLink(final StorageLinkItem link) throws Exception {
    final List<String> hops = Lists.newArrayList();
    StorageLinkItem currentLink = link;
    while (true) {
      final String hop = currentLink.getRepositoryItemUid().getKey();
      if (!hops.contains(hop)) {
        hops.add(hop);
        final StorageItem item = repositoryRouter.dereferenceLink(currentLink);
        if (!(item instanceof StorageLinkItem)) {
          return item;
View Full Code Here

TOP

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

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.