本文整理了Java中org.sonatype.nexus.proxy.repository.Repository.deleteItem
方法的一些代码示例,展示了Repository.deleteItem
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.deleteItem
方法的具体详情如下:
包路径:org.sonatype.nexus.proxy.repository.Repository
类名称:Repository
方法名:deleteItem
暂无
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-unpack-plugin
private void deleteItem(final Repository repository, final StorageItem item) throws Exception {
repository.deleteItem(item.getResourceStoreRequest());
}
代码示例来源:origin: org.sonatype.nexus/nexus-proxy
protected void doDelete( WalkerContext ctx, StorageFileItem item )
throws StorageException, UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException
{
getRepository( ctx ).deleteItem( false, new ResourceStoreRequest( item ) );
}
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-indexer-lucene-plugin
@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);
}
}
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-yum-repository-plugin
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))
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-archetype-plugin
repository.deleteItem(false, new ResourceStoreRequest(ARCHETYPE_PATH));
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-p2-repository-plugin
@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);
}
}
代码示例来源:origin: org.sonatype.nexus/nexus-proxy
getRepository( ctx ).deleteItem( false, new ResourceStoreRequest( coll ) );
代码示例来源:origin: org.sonatype.nexus/nexus-proxy
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!" );
}
}
内容来源于网络,如有侵权,请联系作者删除!