@Override public boolean expireNotFoundMetadataCaches( final ResourceStoreRequest request ) { boolean cacheChanged = false; for ( String metadataPath : getMetadataFilePaths() ) { final ResourceStoreRequest expireRequest = new ResourceStoreRequest( request ); expireRequest.setRequestPath( metadataPath ); boolean expired = getRepository().expireNotFoundCaches( expireRequest, null ); cacheChanged = cacheChanged || expired; } return cacheChanged; }
@Override public boolean expireMetadataCaches( final ResourceStoreRequest request ) { boolean cacheChanged = false; for ( String metadataPath : getMetadataFilePaths() ) { final ResourceStoreRequest expireRequest = new ResourceStoreRequest( request ); expireRequest.setRequestPath( metadataPath ); boolean expired = getRepository().expireCaches( expireRequest, null ); cacheChanged = cacheChanged || expired; } return cacheChanged; }
@Override protected boolean isRemoteStorageReachable(final ResourceStoreRequest request) throws StorageException, RemoteAuthenticationNeededException, RemoteAccessDeniedException { // For p2 repositories, the root URL may not be reachable, // so we test if we can reach one of the "standard" p2 repository metadata files. for (final String metadataFilePath : P2Constants.METADATA_FILE_PATHS) { log.debug( "isRemoteStorageReachable: RepositoryId=" + getId() + ": Trying to access " + metadataFilePath); request.setRequestPath(metadataFilePath); try { // We cannot use getRemoteStorage().isReachable() here because that forces the request path to be "/" if (getRemoteStorage().containsItem(this, request)) { log.debug( "isRemoteStorageReachable: RepositoryId=" + getId() + ": Successfully accessed " + metadataFilePath); return true; } } catch (final RemoteStorageException e) { log.debug( "isRemoteStorageReachable: RepositoryId=" + getId() + ": Caught exception while trying to access " + metadataFilePath, e); // rethrow and core will say _why_ it autoblocked too // everything else than RemoteStorageException will bubble up too throw e; } } return false; }
request.setRequestPath( originalPath + ".sha1" ); request.setRequestPath( originalPath + ".md5" ); request.setRequestPath( originalPath + ".asc" );
request.setRequestPath( originalPath + ".sha1" ); request.setRequestPath( originalPath + ".md5" ); request.setRequestPath( originalPath + ".asc" );
@Override public void storeItem(Repository repository, StorageItem item) throws UnsupportedStorageOperationException, LocalStorageException { if (!item.getPath().startsWith("/.nexus")) { RubygemsFile file = fileSystem.file(item.getResourceStoreRequest()); if (file.type() != FileType.NOT_FOUND) { item.getResourceStoreRequest().setRequestPath(file.storagePath()); ((AbstractStorageItem) item).setPath(file.storagePath()); } } super.storeItem(repository, item); }
if ( target.exists() && target.isDirectory() ) request.setRequestPath( path ); request.setRequestPath( path );
request.setRequestPath( storedFile.getPath() + ".sha1" ); request.setRequestPath( storedFile.getPath() + ".md5" ); request.setRequestPath( originalPath );
request.setRequestPath( RepositoryItemUid.PATH_ROOT );
req.setRequestPath( item.getPath() + ".sha1" ); req.setRequestPath( item.getPath() + ".md5" );
request.setRequestPath( RepositoryItemUid.PATH_ROOT );
request.setRequestPath( storedFile.getPath() + ".sha1" ); request.setRequestPath( storedFile.getPath() + ".md5" ); request.setRequestPath( originalPath );
@SuppressWarnings("deprecation") @Override public void storeItem(ResourceStoreRequest request, InputStream is, Map<String, String> userAttributes) throws UnsupportedStorageOperationException, IllegalOperationException, StorageException, AccessDeniedException { RubygemsFile file = facade.file(request.getRequestPath()); if (file == null) { throw new UnsupportedStorageOperationException("only gem-files can be stored"); } request.setRequestPath(file.storagePath()); // first check permissions, i.e. is redeploy allowed try { checkConditions(request, getResultingActionOnWrite(request)); } catch (ItemNotFoundException e) { throw new AccessDeniedException(request, e.getMessage()); } // now store the gem facade.handleMutation(this, facade.post(is, file)); }
request.setRequestPath( RepositoryItemUid.PATH_ROOT );
req.setRequestPath( item.getPath() + ".sha1" ); req.setRequestPath( item.getPath() + ".md5" );
request.setRequestPath( RepositoryItemUid.PATH_ROOT );
if (file.type() == FileType.DIRECTORY) { req.setRequestPath(file.storagePath()); return new DirectoryStoreageItem(repository, req, (Directory) file);