Package org.sonatype.nexus.proxy

Examples of org.sonatype.nexus.proxy.StorageException


    final StorageItem item;
    try {
      item = metadataSource.doRetrieveItem(request, this);
    }
    catch (IOException e) {
      throw new StorageException(e);
    }
    if (item != null) {
      return item;
    }
View Full Code Here


    final StorageItem item;
    try {
      item = metadataSource.doRetrieveItem(request, this);
    }
    catch (IOException e) {
      throw new StorageException(e);
    }

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

        return;
      }
      site = UpdateSite.read(siteItem.getInputStream());
    }
    catch (final Exception e) {
      throw new StorageException("Could not read site.xml", e);
    }

    final List<SiteFeatureRef> features = site.getFeatures();

    log.info("Mirroring " + features.size() + " features from update site " + getName());
View Full Code Here

      }

      return null; // not found, this might be a real path in the original OBR
    }
    catch (final IOException e) {
      throw new StorageException(e);
    }
    catch (final ItemNotFoundException e) {
      throw new StorageException(e);
    }
  }
View Full Code Here

        }

        writer.complete(); // the OBR is only updated once the stream is complete and closed
      }
      catch (final IOException e) {
        throw new StorageException(e);
      }
      finally {
        // avoid file locks by closing reader first
        IOUtils.closeQuietly(reader);
        IOUtils.closeQuietly(writer);
      }

      obrItem = ObrUtils.getCachedItem(obrUid);
      if (null == obrItem) {
        // this shouldn't happen as we just saved it, but just in case...
        throw new StorageException("Problem reading OBR metadata from repository " + getId());
      }
    }

    return (AbstractStorageItem) obrItem;
  }
View Full Code Here

  {
    try {
      return new DefaultObrResourceReader(site, obrConfiguration.isBundleCacheActive());
    }
    catch (final IOException e) {
      throw new StorageException(e);
    }
  }
View Full Code Here

  {
    try {
      return new DefaultObrResourceWriter(uid, nexusConfiguration.getTemporaryDirectory(), mimeSupport);
    }
    catch (final IOException e) {
      throw new StorageException(e);
    }
  }
View Full Code Here

  public void append(final Resource resource)
      throws IOException
  {
    if (isComplete) {
      throw new StorageException("OBR metadata is already complete");
    }

    ResourceImpl.toXML(resource, urlTransformer).print(0, pw);
  }
View Full Code Here

  {
    IOUtils.closeQuietly(pw);

    if (!isComplete) {
      // we don't want to overwrite the current OBR with bad data
      throw new StorageException("OBR metadata is not complete");
    }

    final ResourceStoreRequest request = new ResourceStoreRequest(path);
    final ContentLocator content = new FileContentLocator(file,
        mimeSupport.guessMimeTypeFromPath(file.getAbsolutePath()));

    try {
      repository.storeItem(false, new DefaultStorageFileItem(repository, request, true, true, content));
    }
    catch (final IllegalOperationException e) {
      throw new StorageException(e);
    }
    catch (final UnsupportedStorageOperationException e) {
      throw new StorageException(e);
    }

    if (!file.delete()) {
      file.deleteOnExit(); // see if we can delete it later...
    }
View Full Code Here

      }

      obrItem = ObrUtils.getCachedItem(obrUid);
      if (null == obrItem) {
        // this shouldn't happen as we just saved it, but just in case...
        throw new StorageException("Problem reading OBR metadata from repository " + getId());
      }

      lastModified = modified;
    }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.StorageException

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.