@Override public Boolean getValueFor( RepositoryItemUid subject ) { return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class ) && M2ArtifactRecognizer.isMetadata( subject.getPath() ) && !M2ArtifactRecognizer.isChecksum( subject.getPath() ); } }
public Boolean getValueFor( RepositoryItemUid subject ) { // stuff not having metadata: // /.nexus/attributes // /.nexus/trash // we are specific about these for a good reason (see future) return subject.getBooleanAttributeValue( IsItemAttributeMetacontentAttribute.class ) || subject.getBooleanAttributeValue( IsTrashMetacontentAttribute.class ); } }
public Boolean getValueFor( final RepositoryItemUid subject ) { if ( subject.getBooleanAttributeValue( IsMetacontentAttribute.class ) ) { // metacontent is hidden return true; } else if ( subject.getPath() != null && ( subject.getPath().indexOf( "/." ) > -1 || subject.getPath().startsWith( "." ) ) ) { // paths that start with a . in any directory (or filename) // are considered hidden. // This check will catch (for example): // .metadata // /.meta/something.jar // /something/else/.hidden/something.jar return true; } else { return false; } } }
/** * Creates a request aimed at given path denoted by RepositoryItemUid. * * @param uid the uid * @deprecated use ResourceStoreRequest(String path) */ public ResourceStoreRequest( RepositoryItemUid uid, boolean localOnly ) { this( uid.getPath(), localOnly, false ); }
public boolean deleteAttributes( final RepositoryItemUid uid ) throws IOException final RepositoryItemUidLock uidLock = uid.getAttributeLock(); final Repository repository = uid.getRepository(); new ResourceStoreRequest( getAttributePath( repository, uid.getPath() ) );
public boolean shouldProcess( WalkerContext context, StorageItem item ) { return target.isPathContained( item.getRepositoryItemUid().getRepository().getRepositoryContentClass(), item .getPath() ); }
final RepositoryItemUidLock uidLock = uid.getLock(); file.setContentLocator( generator.generateContent( this, uid.getPath(), file ) ); String.format( "The file in repository %s on path=\"%s\" should be generated by ContentGeneratorId=%s, but component does not exists!", RepositoryStringUtils.getHumanizedNameString( this ), uid.getPath(), key ) );
final RepositoryItemUidLock uidLock = item.getRepositoryItemUid().getLock(); uidLock.lock( Action.create ); !item.getRepositoryItemUid().getBooleanAttributeValue( IsItemAttributeMetacontentAttribute.class );
/** * Dereferences the passed in link completely (following link-to-links too) as long as non-link item is found as * target. This method will detect cycles, and will fail if such link constellation is found. If any target during * 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; } else { currentLink = (StorageLinkItem) item; } } else { // cycle detected, current link already processed throw new ItemNotFoundException(ItemNotFoundException.reasonFor(link.getResourceStoreRequest(), link .getRepositoryItemUid().getRepository(), "Link item %s introduced a cycle while referencing it, cycle is %s", link.getRepositoryItemUid(), hops)); } } }
@Override public DefaultRepositoryItemUidLock createUidAttributeLock( final RepositoryItemUid uid ) { final String key = new String( "attribute:" + uid.getKey() ); return doCreateUidLockForKey( key ); }
public void putAttributes( final RepositoryItemUid uid, Attributes attributes ) final RepositoryItemUidLock uidLock = uid.getAttributeLock(); onDisk.setRepositoryId( uid.getRepository().getId() ); onDisk.setPath( uid.getPath() ); onDisk.setReadable( attributes.isReadable() ); onDisk.setWritable( attributes.isWritable() );
new Object[]{ P2Constants.CONTENT_XML, RepositoryStringUtils.getHumanizedNameString(fileItem.getRepositoryItemUid().getRepository()), e.getMessage(), name }); new Object[]{ P2Constants.CONTENT_XML, RepositoryStringUtils.getHumanizedNameString(fileItem.getRepositoryItemUid().getRepository()), e.getMessage(), name });
if (item.getRepositoryItemUid().getBooleanAttributeValue(IsHiddenAttribute.class)) { return; Gav gav = ((MavenRepository) repository).getGavCalculator().pathToGav(item.getRepositoryItemUid().getPath()); if (gav == null || gav.isSignature() || gav.isHash()) { return;
@Override public DefaultRepositoryItemUidLock createUidLock( final RepositoryItemUid uid ) { final String key = new String( uid.getKey() ); return doCreateUidLockForKey( key ); }
@Override public Boolean getValueFor( RepositoryItemUid subject ) { return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class ) && M2ArtifactRecognizer.isPom( subject.getPath() ) && !M2ArtifactRecognizer.isChecksum( subject.getPath() ); } }
public Boolean getValueFor( RepositoryItemUid subject ) { return !subject.getBooleanAttributeValue( IsMetacontentAttribute.class ); } }