private void deleteItem(final Repository repository, final StorageItem item) throws Exception { repository.deleteItem(item.getResourceStoreRequest()); }
protected void doDelete( WalkerContext ctx, StorageFileItem item ) throws StorageException, UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException { getRepository( ctx ).deleteItem( false, new ResourceStoreRequest( item ) ); }
@SuppressWarnings("deprecation") protected void deleteIndexItems(Repository repository) { ResourceStoreRequest request = new ResourceStoreRequest(PUBLISHING_PATH_PREFIX); try { // kill the chain, deleting the props file basically resets the chain shared(repository, new Runnable() { @Override public void run(IndexingContext context) throws IOException { if (context.getIndexDirectoryFile() != null) { new File( context.getIndexDirectoryFile(), IndexingContext.INDEX_PACKER_PROPERTIES_FILE ).delete(); } }}); repository.deleteItem(false, request); } catch (ItemNotFoundException e) { // nothing serious, no index was published yet, keep it silent } catch (Exception e) { log.error("Cannot delete index items!", e); } }
byte[] primaryContent = compress(out.toByteArray()); if (primaryHref.contains(primaryChecksum)) { repository.deleteItem(false, new ResourceStoreRequest("/" + primaryHref)); primaryHref = primaryHref.replace( primaryChecksum, getDigest("SHA-256", new ByteArrayInputStream(primaryContent))
repository.deleteItem(false, new ResourceStoreRequest(ARCHETYPE_PATH));
@Override public void removeConfiguration(final P2RepositoryAggregatorConfiguration configuration) { try { final Repository repository = repositories.getRepository(configuration.repositoryId()); final RepositoryItemUid p2RepoUid = repository.createUid(P2_REPOSITORY_ROOT_PATH); try { p2RepoUid.getLock().lock(Action.create); final ResourceStoreRequest request = new ResourceStoreRequest(P2_REPOSITORY_ROOT_PATH); repository.deleteItem(request); } finally { p2RepoUid.getLock().unlock(); } } catch (final Exception e) { logger.warn(String.format("Could not delete P2 repository [%s:%s] due to [%s]", configuration.repositoryId(), P2_REPOSITORY_ROOT_PATH, e.getMessage()), e); } }
getRepository( ctx ).deleteItem( false, new ResourceStoreRequest( coll ) );
public void deleteItem( ResourceStoreRequest request ) throws UnsupportedStorageOperationException, ItemNotFoundException, IllegalOperationException, StorageException, AccessDeniedException { RequestRoute route = getRequestRouteForRequest( request ); if ( route.isRepositoryHit() ) { // it hits a repository, mangle path and call it try { request.pushRequestPath( route.getRepositoryPath() ); route.getTargetedRepository().deleteItem( request ); } finally { request.popRequestPath(); } } else { // this is "above" repositories throw new IllegalRequestException( request, "The path '" + request.getRequestPath() + "' does not points to any repository!" ); } }