@SuppressWarnings("deprecation") @Override public StorageItem retrieveDirectItem(ResourceStoreRequest request) throws IllegalOperationException, ItemNotFoundException, IOException { // bypass access control return super.retrieveItem(false, request); }
@SuppressWarnings("deprecation") @Override public StorageItem retrieveItem(ResourceStoreRequest request) throws IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException { // TODO do not use this since it bypasses access control if (request.getRequestPath().startsWith("/.nexus")) { return super.retrieveItem(request); } return facade.handleRetrieve(this, request, facade.get(request)); }
@SuppressWarnings("deprecation") @Override public StorageItem retrieveItem(boolean fromTask, ResourceStoreRequest request) throws IllegalOperationException, ItemNotFoundException, org.sonatype.nexus.proxy.StorageException { if (!fromTask && request.getRequestPath().contains("?gems=") && !request.getRequestPath().startsWith("/.nexus")) { return facade.handleRetrieve(this, request, facade.get(request)); } else { return super.retrieveItem(fromTask, request); } }
@Override public StorageItem retrieveItem(final boolean fromTask, final ResourceStoreRequest request) throws IllegalOperationException, ItemNotFoundException, StorageException { final RepositoryItemUid uid = createUid(P2Constants.METADATA_LOCK_PATH); final RepositoryItemUidLock lock = uid.getLock(); try { // Lock the metadata do be sure that the artifacts are retrieved from consistent paths. lock.lock(Action.read); try { // NOTE - THIS CANNOT be a write action (create/delete/update) as that will force a write lock // thus serializing access to this p2 repo. Using a read action here, will block the file from // being deleted/updated while retrieving the remote item, and that is all we need. // NXCM-2499 temporarily we do put access serialization back here, to avoid all the deadlocks. lock.lock(Action.create); return super.retrieveItem(fromTask, request); } finally { lock.unlock(); } } finally { lock.unlock(); } }