public String getName() { return new File( getPath() ).getName(); }
public String getParentPath() { return ItemPathUtils.getParentPath( getPath() ); }
public String toString() { if ( isVirtual() ) { return getPath(); } else { return getRepositoryItemUid().toString(); } }
/** * Instantiates a new abstract storage item. */ public AbstractStorageItem( Repository repository, ResourceStoreRequest request, boolean readable, boolean writable ) { this( request, readable, writable ); this.store = repository; this.repositoryItemUid = repository.createUid( getPath() ); setRepositoryId( repository.getId() ); }
@Override protected RemoteHashResponse retrieveRemoteHash(final AbstractStorageItem item, final ProxyRepository proxy, final String baseUrl) throws LocalStorageException { final P2ProxyRepository p2repo = proxy.adaptToFacet(P2ProxyRepository.class); Map<String, ArtifactPath> paths; try { final ArtifactMapping artifactMapping = p2repo.getArtifactMappings().get(baseUrl); if (artifactMapping == null) { log.debug("Unable to retrive remote has for " + item.getPath()); return null; } paths = artifactMapping.getArtifactsPath(); } catch (StorageException e) { throw new LocalStorageException(e); } catch (final IllegalOperationException e) { log.error("Unable to open artifactsMapping.xml", e); return null; } final String md5 = paths.get(item.getPath()).getMd5(); if (md5 == null) { return null; } return new RemoteHashResponse(DigestCalculatingInspector.DIGEST_MD5_KEY, md5, null); }
"The artifact " + item.getPath() + " has no remote checksum in repository " + item.getRepositoryId() + "! The checksumPolicy of repository forbids downloading of it."; "Warning, the artifact " + item.getPath() + " has no remote checksum in repository " + item.getRepositoryId() + "!"; "Warning, the artifact " + item.getPath() + " and it's remote checksums does not match in repository " + item.getRepositoryId() + "!"; "The artifact " + item.getPath() + " and it's remote checksums does not match in repository " + item.getRepositoryId() + "! The checksumPolicy of repository forbids downloading of it.";
&& M2ArtifactRecognizer.isMetadata( item.getPath() ) )