1 package org.apache.archiva.webdav;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
23 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
24 import org.apache.archiva.audit.Auditable;
25 import org.apache.archiva.checksum.ChecksumAlgorithm;
26 import org.apache.archiva.checksum.ChecksumUtil;
27 import org.apache.archiva.checksum.ChecksummedFile;
28 import org.apache.archiva.checksum.StreamingChecksum;
29 import org.apache.archiva.common.filelock.FileLockManager;
30 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
31 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
32 import org.apache.archiva.common.utils.PathUtil;
33 import org.apache.archiva.common.utils.VersionUtil;
34 import org.apache.archiva.configuration.ArchivaConfiguration;
35 import org.apache.archiva.indexer.ArchivaIndexingContext;
36 import org.apache.archiva.indexer.merger.IndexMerger;
37 import org.apache.archiva.indexer.merger.IndexMergerException;
38 import org.apache.archiva.indexer.merger.IndexMergerRequest;
39 import org.apache.archiva.indexer.merger.MergedRemoteIndexesTask;
40 import org.apache.archiva.indexer.merger.MergedRemoteIndexesTaskRequest;
41 import org.apache.archiva.indexer.merger.TemporaryGroupIndex;
42 import org.apache.archiva.indexer.search.RepositorySearch;
43 import org.apache.archiva.indexer.search.RepositorySearchException;
44 import org.apache.archiva.maven2.metadata.MavenMetadataReader;
45 import org.apache.archiva.metadata.model.facets.AuditEvent;
46 import org.apache.archiva.metadata.repository.storage.RelocationException;
47 import org.apache.archiva.metadata.repository.storage.RepositoryStorage;
48 import org.apache.archiva.model.ArchivaRepositoryMetadata;
49 import org.apache.archiva.model.ArtifactReference;
50 import org.apache.archiva.policies.ProxyDownloadException;
51 import org.apache.archiva.proxy.ProxyRegistry;
52 import org.apache.archiva.proxy.model.RepositoryProxyHandler;
53 import org.apache.archiva.redback.authentication.AuthenticationException;
54 import org.apache.archiva.redback.authentication.AuthenticationResult;
55 import org.apache.archiva.redback.authorization.AuthorizationException;
56 import org.apache.archiva.redback.authorization.UnauthorizedException;
57 import org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator;
58 import org.apache.archiva.redback.policy.AccountLockedException;
59 import org.apache.archiva.redback.policy.MustChangePasswordException;
60 import org.apache.archiva.redback.system.SecuritySession;
61 import org.apache.archiva.redback.users.User;
62 import org.apache.archiva.redback.users.UserManager;
63 import org.apache.archiva.repository.LayoutException;
64 import org.apache.archiva.repository.ManagedRepository;
65 import org.apache.archiva.repository.ManagedRepositoryContent;
66 import org.apache.archiva.repository.ReleaseScheme;
67 import org.apache.archiva.repository.RepositoryGroup;
68 import org.apache.archiva.repository.RepositoryRegistry;
69 import org.apache.archiva.repository.RepositoryRequestInfo;
70 import org.apache.archiva.repository.content.FilesystemAsset;
71 import org.apache.archiva.repository.content.FilesystemStorage;
72 import org.apache.archiva.repository.content.StorageAsset;
73 import org.apache.archiva.repository.events.AuditListener;
74 import org.apache.archiva.repository.features.IndexCreationFeature;
75 import org.apache.archiva.repository.metadata.MetadataTools;
76 import org.apache.archiva.repository.metadata.RepositoryMetadataException;
77 import org.apache.archiva.repository.metadata.RepositoryMetadataMerge;
78 import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
79 import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
80 import org.apache.archiva.security.ServletAuthenticator;
81 import org.apache.archiva.webdav.util.MimeTypes;
82 import org.apache.archiva.webdav.util.TemporaryGroupIndexSessionCleaner;
83 import org.apache.archiva.webdav.util.WebdavMethodUtil;
84 import org.apache.archiva.xml.XMLException;
85 import org.apache.commons.io.FilenameUtils;
86 import org.apache.commons.lang.StringUtils;
87 import org.apache.commons.lang.SystemUtils;
88 import org.apache.jackrabbit.webdav.DavException;
89 import org.apache.jackrabbit.webdav.DavResource;
90 import org.apache.jackrabbit.webdav.DavResourceFactory;
91 import org.apache.jackrabbit.webdav.DavResourceLocator;
92 import org.apache.jackrabbit.webdav.DavServletRequest;
93 import org.apache.jackrabbit.webdav.DavServletResponse;
94 import org.apache.jackrabbit.webdav.DavSession;
95 import org.apache.jackrabbit.webdav.lock.LockManager;
96 import org.apache.jackrabbit.webdav.lock.SimpleLockManager;
97 import org.codehaus.plexus.digest.Digester;
98 import org.codehaus.plexus.digest.DigesterException;
99 import org.slf4j.Logger;
100 import org.slf4j.LoggerFactory;
101 import org.slf4j.MarkerFactory;
102 import org.springframework.context.ApplicationContext;
103 import org.springframework.stereotype.Service;
105 import javax.annotation.PostConstruct;
106 import javax.inject.Inject;
107 import javax.inject.Named;
108 import javax.servlet.http.HttpServletResponse;
109 import javax.servlet.http.HttpSession;
110 import java.io.IOException;
111 import java.io.OutputStream;
112 import java.io.OutputStreamWriter;
113 import java.nio.file.Files;
114 import java.nio.file.Path;
115 import java.nio.file.Paths;
116 import java.util.ArrayList;
117 import java.util.Date;
118 import java.util.HashMap;
119 import java.util.HashSet;
120 import java.util.List;
121 import java.util.Map;
122 import java.util.Objects;
123 import java.util.Set;
124 import java.util.stream.Collectors;
129 @Service( "davResourceFactory#archiva" )
130 public class ArchivaDavResourceFactory
131 implements DavResourceFactory, Auditable
133 private static final String PROXIED_SUFFIX = " (proxied)";
135 private static final String HTTP_PUT_METHOD = "PUT";
137 private Logger log = LoggerFactory.getLogger( ArchivaDavResourceFactory.class );
140 private List<AuditListener> auditListeners = new ArrayList<>();
143 private ProxyRegistry proxyRegistry;
146 private MetadataTools metadataTools;
149 private MimeTypes mimeTypes;
151 private ArchivaConfiguration archivaConfiguration;
154 private ServletAuthenticator servletAuth;
157 @Named( value = "httpAuthenticator#basic" )
158 private HttpAuthenticator httpAuth;
161 private RemoteRepositoryAdmin remoteRepositoryAdmin;
164 private ManagedRepositoryAdmin managedRepositoryAdmin;
167 private RepositoryRegistry repositoryRegistry;
170 private IndexMerger indexMerger;
173 private RepositorySearch repositorySearch;
176 * Lock Manager - use simple implementation from JackRabbit
178 private final LockManager lockManager = new SimpleLockManager();
181 @Named( value = "archivaTaskScheduler#repository" )
182 private RepositoryArchivaTaskScheduler scheduler;
185 @Named( value = "fileLockManager#default" )
186 private FileLockManager fileLockManager;
188 private ApplicationContext applicationContext;
192 public ArchivaDavResourceFactory( ApplicationContext applicationContext, ArchivaConfiguration archivaConfiguration )
193 throws PlexusSisuBridgeException
195 this.archivaConfiguration = archivaConfiguration;
196 this.applicationContext = applicationContext;
201 public void initialize() throws IOException
208 public DavResource createResource( final DavResourceLocator locator, final DavServletRequest request,
209 final DavServletResponse response )
212 final ArchivaDavResourceLocator archivaLocator = checkLocatorIsInstanceOfRepositoryLocator( locator );
214 final String sRepoId = archivaLocator.getRepositoryId();
216 RepositoryGroup repoGroup = repositoryRegistry.getRepositoryGroup(sRepoId);
218 final boolean isGroupRepo = repoGroup != null;
220 String activePrincipal = getActivePrincipal( request );
222 List<String> resourcesInAbsolutePath = new ArrayList<>();
224 boolean readMethod = WebdavMethodUtil.isReadMethod( request.getMethod() );
225 RepositoryRequestInfo repositoryRequestInfo = null;
226 DavResource resource;
231 throw new DavException( HttpServletResponse.SC_METHOD_NOT_ALLOWED,
232 "Write method not allowed for repository groups." );
235 log.debug( "Repository group '{}' accessed by '{}", repoGroup.getId(), activePrincipal );
237 // handle browse requests for virtual repos
238 if ( getLogicalResource( archivaLocator, null, true ).endsWith( "/" ) )
240 DavResource davResource =
241 getResourceFromGroup( request, archivaLocator,
244 setHeaders( response, locator, davResource, true );
251 // make a copy to avoid potential concurrent modifications (eg. by configuration)
252 // TODO: ultimately, locking might be more efficient than copying in this fashion since updates are
254 resource = processRepositoryGroup( request, archivaLocator, activePrincipal,
255 resourcesInAbsolutePath, repoGroup );
256 for (ManagedRepository repo : repoGroup.getRepositories() ) {
258 repositoryRequestInfo = repo.getRequestInfo();
267 // We do not provide folders for remote repositories
270 ManagedRepository repo = repositoryRegistry.getManagedRepository( sRepoId );
272 throw new DavException( HttpServletResponse.SC_NOT_FOUND,
273 "Invalid repository: " + archivaLocator.getRepositoryId() );
275 ManagedRepositoryContent managedRepositoryContent = repo.getContent( );
276 if (managedRepositoryContent==null) {
277 log.error("Inconsistency detected. Repository content not found for '{}'", archivaLocator.getRepositoryId());
278 throw new DavException( HttpServletResponse.SC_NOT_FOUND,
279 "Invalid repository: " + archivaLocator.getRepositoryId() );
282 log.debug( "Managed repository '{}' accessed by '{}'", managedRepositoryContent.getId(), activePrincipal );
284 resource = processRepository( request, archivaLocator, activePrincipal, managedRepositoryContent,
286 repositoryRequestInfo = repo.getRequestInfo();
287 String logicalResource = getLogicalResource( archivaLocator, null, false );
288 resourcesInAbsolutePath.add(
289 Paths.get( managedRepositoryContent.getRepoRoot(), logicalResource ).toAbsolutePath().toString() );
293 String requestedResource = request.getRequestURI();
295 // MRM-872 : merge all available metadata
296 // merge metadata only when requested via the repo group
297 if ( ( repositoryRequestInfo.isMetadata( requestedResource ) || repositoryRequestInfo.isMetadataSupportFile(
298 requestedResource ) ) && isGroupRepo )
300 // this should only be at the project level not version level!
301 if ( isProjectReference( requestedResource ) )
304 ArchivaDavResource res = (ArchivaDavResource) resource;
306 if (res.getAsset().hasParent())
308 newPath = res.getAsset( ).getParent( ).getPath( ) + "/maven-metadata-" + sRepoId + ".xml";
310 newPath = StringUtils.substringBeforeLast( res.getAsset().getPath(), "/" ) + "/maven-metadata-" + sRepoId + ".xml";;
312 // for MRM-872 handle checksums of the merged metadata files
313 if ( repositoryRequestInfo.isSupportFile( requestedResource ) )
315 String metadataChecksumPath = newPath + "." + StringUtils.substringAfterLast( requestedResource, "." );
316 StorageAsset metadataChecksum = repoGroup.getAsset( metadataChecksumPath );
317 if ( repoGroup.getAsset( metadataChecksumPath ).exists() )
319 LogicalResource logicalResource =
320 new LogicalResource( getLogicalResource( archivaLocator, null, false ) );
325 new ArchivaDavResource( metadataChecksum, logicalResource.getPath(), repoGroup,
326 request.getRemoteAddr(), activePrincipal, request.getDavSession(),
327 archivaLocator, this, mimeTypes, auditListeners, scheduler);
329 catch ( LayoutException e )
331 log.error("Incompatible layout: {}", e.getMessage(), e);
332 throw new DavException( 500, e );
338 if ( resourcesInAbsolutePath != null && resourcesInAbsolutePath.size() > 1 )
340 // merge the metadata of all repos under group
341 ArchivaRepositoryMetadata mergedMetadata = new ArchivaRepositoryMetadata();
342 for ( String resourceAbsPath : resourcesInAbsolutePath )
346 Path metadataFile = Paths.get( resourceAbsPath );
347 ArchivaRepositoryMetadata repoMetadata = MavenMetadataReader.read( metadataFile );
348 mergedMetadata = RepositoryMetadataMerge.merge( mergedMetadata, repoMetadata );
350 catch ( XMLException e )
352 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
353 "Error occurred while reading metadata file." );
355 catch ( RepositoryMetadataException r )
357 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
358 "Error occurred while merging metadata file." );
364 StorageAsset resourceFile = writeMergedMetadataToFile( repoGroup, mergedMetadata, newPath );
366 LogicalResource logicalResource =
367 new LogicalResource( getLogicalResource( archivaLocator, null, false ) );
370 new ArchivaDavResource( resourceFile, logicalResource.getPath(), repoGroup,
371 request.getRemoteAddr(), activePrincipal,
372 request.getDavSession(), archivaLocator, this, mimeTypes,
373 auditListeners, scheduler);
375 catch ( RepositoryMetadataException r )
377 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
378 "Error occurred while writing metadata file." );
380 catch ( IOException ie )
382 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
383 "Error occurred while generating checksum files." );
385 catch ( DigesterException de )
387 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
388 "Error occurred while generating checksum files."
391 catch ( LayoutException e )
393 log.error("Incompatible layout: {}", e.getMessage(), e);
394 throw new DavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Incompatible layout for repository "+repoGroup.getId());
401 setHeaders( response, locator, resource, false );
403 // compatibility with MRM-440 to ensure browsing the repository works ok
404 if ( resource.isCollection() && !request.getRequestURI().endsWith( "/" ) )
406 throw new BrowserRedirectException( resource.getHref() );
408 resource.addLockManager( lockManager );
412 private DavResource processRepositoryGroup( final DavServletRequest request,
413 ArchivaDavResourceLocator archivaLocator,
414 String activePrincipal, List<String> resourcesInAbsolutePath,
415 RepositoryGroup repoGroup )
418 DavResource resource = null;
419 List<DavException> storedExceptions = new ArrayList<>();
421 String pathInfo = StringUtils.removeEnd( request.getPathInfo(), "/" );
423 String rootPath = StringUtils.substringBeforeLast( pathInfo, "/" );
425 String mergedIndexPath = "/";
426 if (repoGroup.supportsFeature( IndexCreationFeature.class )) {
427 mergedIndexPath = repoGroup.getFeature( IndexCreationFeature.class ).get().getIndexPath().getPath();
430 if ( StringUtils.endsWith( rootPath, mergedIndexPath ) )
432 // we are in the case of index file request
433 String requestedFileName = StringUtils.substringAfterLast( pathInfo, "/" );
434 Path temporaryIndexDirectory =
435 buildMergedIndexDirectory( activePrincipal, request, repoGroup );
436 FilesystemAsset asset = new FilesystemAsset( pathInfo, temporaryIndexDirectory.resolve(requestedFileName) );
438 Path resourceFile = temporaryIndexDirectory.resolve( requestedFileName );
440 resource = new ArchivaDavResource( asset, requestedFileName, null,
441 request.getRemoteAddr(), activePrincipal, request.getDavSession(),
442 archivaLocator, this, mimeTypes, auditListeners, scheduler );
443 } catch (LayoutException e) {
444 log.error("Bad layout: {}", e.getMessage(), e);
445 throw new DavException(500, e);
451 for ( ManagedRepository repository : repoGroup.getRepositories() )
453 String repositoryId = repository.getId();
454 ManagedRepositoryContent managedRepositoryContent;
455 ManagedRepository managedRepository = repositoryRegistry.getManagedRepository( repositoryId );
456 if (managedRepository==null) {
457 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not find repository with id "+repositoryId );
459 managedRepositoryContent = managedRepository.getContent();
460 if (managedRepositoryContent==null) {
461 log.error("Inconsistency detected. Repository content not found for '{}'",repositoryId);
462 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not find repository content with id "+repositoryId );
466 DavResource updatedResource =
467 processRepository( request, archivaLocator, activePrincipal, managedRepositoryContent,
469 if ( resource == null )
471 resource = updatedResource;
474 String logicalResource = getLogicalResource( archivaLocator, null, false );
475 if ( logicalResource.endsWith( "/" ) )
477 logicalResource = logicalResource.substring( 1 );
479 resourcesInAbsolutePath.add(
480 Paths.get( managedRepositoryContent.getRepoRoot(), logicalResource ).toAbsolutePath().toString() );
482 catch ( DavException e )
484 storedExceptions.add( e );
488 if ( resource == null )
490 if ( !storedExceptions.isEmpty() )
493 for ( DavException e : storedExceptions )
495 if ( 401 == e.getErrorCode() )
501 throw new DavException( HttpServletResponse.SC_NOT_FOUND );
505 throw new DavException( HttpServletResponse.SC_NOT_FOUND );
511 private String getLogicalResource( ArchivaDavResourceLocator archivaLocator, org.apache.archiva.repository.ManagedRepository managedRepository,
512 boolean useOrigResourcePath )
514 // FIXME remove this hack
515 // but currently managedRepository can be null in case of group
516 String layout = managedRepository == null ? "default" : managedRepository.getLayout();
517 RepositoryStorage repositoryStorage =
518 this.applicationContext.getBean( "repositoryStorage#" + layout, RepositoryStorage.class );
519 String path = repositoryStorage.getFilePath(
520 useOrigResourcePath ? archivaLocator.getOrigResourcePath() : archivaLocator.getResourcePath(),
522 log.debug( "found path {} for resourcePath: '{}' with managedRepo '{}' and layout '{}'", path,
523 archivaLocator.getResourcePath(), managedRepository == null ? "null" : managedRepository.getId(),
528 private String evaluatePathWithVersion( ArchivaDavResourceLocator archivaLocator, //
529 ManagedRepositoryContent managedRepositoryContent, //
533 String layout = managedRepositoryContent.getRepository() == null
535 : managedRepositoryContent.getRepository().getLayout();
536 RepositoryStorage repositoryStorage =
537 this.applicationContext.getBean( "repositoryStorage#" + layout, RepositoryStorage.class );
540 return repositoryStorage.getFilePathWithVersion( archivaLocator.getResourcePath(), //
541 managedRepositoryContent );
543 catch ( RelocationException e )
545 String path = e.getPath();
546 log.debug( "Relocation to {}", path );
548 throw new BrowserRedirectException( addHrefPrefix( contextPath, path ), e.getRelocationType() );
550 catch ( XMLException e )
552 log.error( e.getMessage(), e );
553 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
557 private DavResource processRepository( final DavServletRequest request, ArchivaDavResourceLocator archivaLocator,
558 String activePrincipal, ManagedRepositoryContent managedRepositoryContent,
559 org.apache.archiva.repository.ManagedRepository managedRepository )
562 DavResource resource = null;
563 if ( isAuthorized( request, managedRepositoryContent.getId() ) )
565 boolean readMethod = WebdavMethodUtil.isReadMethod( request.getMethod() );
566 // Maven Centric part ask evaluation if -SNAPSHOT
567 // MRM-1846 test if read method to prevent issue with maven 2.2.1 and uniqueVersion false
569 String path = readMethod
570 ? evaluatePathWithVersion( archivaLocator, managedRepositoryContent, request.getContextPath() )
571 : getLogicalResource( archivaLocator, managedRepository, false );
572 if ( path.startsWith( "/" ) )
574 path = path.substring( 1 );
576 LogicalResource logicalResource = new LogicalResource( path );
577 StorageAsset repoAsset = managedRepositoryContent.getAsset( path );
578 // Path resourceFile = Paths.get( managedRepositoryContent.getRepoRoot(), path );
582 new ArchivaDavResource( repoAsset, path, managedRepositoryContent,
583 request.getRemoteAddr(), activePrincipal, request.getDavSession(),
584 archivaLocator, this, mimeTypes, auditListeners, scheduler );
586 catch ( LayoutException e )
588 log.error("Incompatible layout: {}", e.getMessage(), e);
589 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
592 if ( WebdavMethodUtil.isReadMethod( request.getMethod() ) )
594 if ( archivaLocator.getHref( false ).endsWith( "/" ) && !repoAsset.isContainer() )
596 // force a resource not found
597 throw new DavException( HttpServletResponse.SC_NOT_FOUND, "Resource does not exist" );
601 if ( !resource.isCollection() )
603 boolean previouslyExisted = repoAsset.exists();
605 boolean fromProxy = fetchContentFromProxies( managedRepositoryContent, request, logicalResource );
607 StorageAsset resourceAsset=null;
608 // At this point the incoming request can either be in default or
609 // legacy layout format.
612 // Perform an adjustment of the resource to the managed
613 // repository expected path.
614 // String localResourcePath = managedRepository.getRequestInfo().toNativePath( logicalResource.getPath() );
615 resourceAsset = managedRepositoryContent.getAsset( logicalResource.getPath() );
617 new ArchivaDavResource( resourceAsset, logicalResource.getPath(),
618 managedRepositoryContent,
619 request.getRemoteAddr(), activePrincipal,
620 request.getDavSession(), archivaLocator, this, mimeTypes,
621 auditListeners, scheduler );
623 catch ( LayoutException e )
625 if ( resourceAsset==null || !resourceAsset.exists() )
627 throw new DavException( HttpServletResponse.SC_NOT_FOUND, e );
633 String action = ( previouslyExisted ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE )
636 log.debug( "Proxied artifact '{}' in repository '{}' (current user '{}')",
637 resourceAsset.getName(), managedRepositoryContent.getId(), activePrincipal );
639 triggerAuditEvent( request.getRemoteAddr(), archivaLocator.getRepositoryId(),
640 logicalResource.getPath(), action, activePrincipal );
643 if ( !resourceAsset.exists() )
645 throw new DavException( HttpServletResponse.SC_NOT_FOUND, "Resource does not exist" );
651 if ( request.getMethod().equals( HTTP_PUT_METHOD ) )
653 String resourcePath = logicalResource.getPath();
654 RepositoryRequestInfo repositoryRequestInfo = managedRepository.getRequestInfo();
655 // check if target repo is enabled for releases
656 // we suppose that release-artifacts can be deployed only to repos enabled for releases
657 if ( managedRepositoryContent.getRepository().getActiveReleaseSchemes().contains( ReleaseScheme.RELEASE ) && !repositoryRequestInfo.isMetadata(
658 resourcePath ) && !repositoryRequestInfo.isSupportFile( resourcePath ) )
660 ArtifactReference artifact = null;
663 artifact = managedRepositoryContent.toArtifactReference( resourcePath );
665 if ( !VersionUtil.isSnapshot( artifact.getVersion() ) )
667 // check if artifact already exists and if artifact re-deployment to the repository is allowed
668 if ( managedRepositoryContent.hasContent( artifact )
669 && managedRepositoryContent.getRepository().blocksRedeployments())
671 log.warn( "Overwriting released artifacts in repository '{}' is not allowed.",
672 managedRepositoryContent.getId() );
673 throw new DavException( HttpServletResponse.SC_CONFLICT,
674 "Overwriting released artifacts is not allowed." );
678 catch ( LayoutException e )
680 log.warn( "Artifact path '{}' is invalid.", resourcePath );
685 * Create parent directories that don't exist when writing a file This actually makes this
686 * implementation not compliant to the WebDAV RFC - but we have enough knowledge about how the
687 * collection is being used to do this reasonably and some versions of Maven's WebDAV don't correctly
688 * create the collections themselves.
691 Path rootDirectory = Paths.get( managedRepositoryContent.getRepoRoot() );
692 Path destDir = rootDirectory.resolve( logicalResource.getPath() ).getParent();
694 if ( !Files.exists(destDir) )
698 Files.createDirectories( destDir );
700 catch ( IOException e )
702 log.error("Could not create directory {}: {}", destDir, e.getMessage(), e);
703 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not create directory "+destDir );
705 String relPath = PathUtil.getRelative( rootDirectory.toAbsolutePath().toString(), destDir );
707 log.debug( "Creating destination directory '{}' (current user '{}')", destDir.getFileName(),
710 triggerAuditEvent( request.getRemoteAddr(), managedRepositoryContent.getId(), relPath,
711 AuditEvent.CREATE_DIR, activePrincipal );
719 public DavResource createResource( final DavResourceLocator locator, final DavSession davSession )
722 ArchivaDavResourceLocator archivaLocator = checkLocatorIsInstanceOfRepositoryLocator( locator );
724 ManagedRepositoryContent managedRepositoryContent;
725 ManagedRepository repo = repositoryRegistry.getManagedRepository( archivaLocator.getRepositoryId( ) );
727 throw new DavException( HttpServletResponse.SC_NOT_FOUND,
728 "Invalid repository: " + archivaLocator.getRepositoryId() );
730 managedRepositoryContent = repo.getContent();
731 if (managedRepositoryContent==null) {
732 log.error("Inconsistency detected. Repository content not found for '{}'", archivaLocator.getRepositoryId());
733 throw new DavException( HttpServletResponse.SC_NOT_FOUND,
734 "Invalid repository: " + archivaLocator.getRepositoryId() );
737 DavResource resource = null;
738 String logicalResource = getLogicalResource( archivaLocator, repo, false );
739 if ( logicalResource.startsWith( "/" ) )
741 logicalResource = logicalResource.substring( 1 );
743 StorageAsset resourceAsset = managedRepositoryContent.getAsset( logicalResource );
746 resource = new ArchivaDavResource( resourceAsset, logicalResource,
747 repo.getContent(), davSession, archivaLocator,
748 this, mimeTypes, auditListeners, scheduler);
750 catch ( LayoutException e )
752 log.error( "Incompatible layout: {}", e.getMessage( ), e );
753 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
756 resource.addLockManager( lockManager );
760 private boolean fetchContentFromProxies( ManagedRepositoryContent managedRepository, DavServletRequest request,
761 LogicalResource resource )
764 String path = resource.getPath();
765 if (!proxyRegistry.hasHandler(managedRepository.getRepository().getType())) {
766 throw new DavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No proxy handler found for repository type "+managedRepository.getRepository().getType());
768 RepositoryRequestInfo repositoryRequestInfo = managedRepository.getRepository().getRequestInfo();
769 RepositoryProxyHandler proxyHandler = proxyRegistry.getHandler(managedRepository.getRepository().getType()).get(0);
770 if ( repositoryRequestInfo.isSupportFile( path ) )
772 Path proxiedFile = proxyHandler.fetchFromProxies( managedRepository, path );
774 return ( proxiedFile != null );
777 // Is it a Metadata resource?
778 if ( "default".equals(repositoryRequestInfo.getLayout( path )) && repositoryRequestInfo.isMetadata( path ) )
780 return proxyHandler.fetchMetadataFromProxies( managedRepository, path ).isModified();
783 // Is it an Archetype Catalog?
784 if ( repositoryRequestInfo.isArchetypeCatalog( path ) )
786 // FIXME we must implement a merge of remote archetype catalog from remote servers.
787 Path proxiedFile = proxyHandler.fetchFromProxies( managedRepository, path );
789 return ( proxiedFile != null );
792 // Not any of the above? Then it's gotta be an artifact reference.
795 // Get the artifact reference in a layout neutral way.
796 ArtifactReference artifact = repositoryRequestInfo.toArtifactReference( path );
798 if ( artifact != null )
800 String repositoryLayout = managedRepository.getRepository().getLayout();
802 RepositoryStorage repositoryStorage =
803 this.applicationContext.getBean( "repositoryStorage#" + repositoryLayout, RepositoryStorage.class );
804 repositoryStorage.applyServerSideRelocation( managedRepository, artifact );
806 Path proxiedFile = proxyHandler.fetchFromProxies( managedRepository, artifact );
808 resource.setPath( managedRepository.toPath( artifact ) );
810 log.debug( "Proxied artifact '{}:{}:{}'", artifact.getGroupId(), artifact.getArtifactId(),
811 artifact.getVersion() );
813 return ( proxiedFile != null );
816 catch ( LayoutException e )
820 catch ( ProxyDownloadException e )
822 log.error( e.getMessage(), e );
823 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
824 "Unable to fetch artifact resource." );
831 private void triggerAuditEvent( String remoteIP, String repositoryId, String resource, String action,
834 AuditEvent event = new AuditEvent( repositoryId, principal, resource, action );
835 event.setRemoteIP( remoteIP );
837 for ( AuditListener listener : auditListeners )
839 listener.auditEvent( event );
844 public void addAuditListener( AuditListener listener )
846 this.auditListeners.add( listener );
850 public void clearAuditListeners()
852 this.auditListeners.clear();
856 public void removeAuditListener( AuditListener listener )
858 this.auditListeners.remove( listener );
861 private void setHeaders( DavServletResponse response, DavResourceLocator locator, DavResource resource,
864 // [MRM-503] - Metadata file need Pragma:no-cache response
866 if ( locator.getResourcePath().endsWith( "/maven-metadata.xml" ) || ( resource instanceof ArchivaDavResource
867 && ( ArchivaDavResource.class.cast( resource ).getAsset().isContainer() ) ) )
869 response.setHeader( "Pragma", "no-cache" );
870 response.setHeader( "Cache-Control", "no-cache" );
871 response.setDateHeader( "Last-Modified", new Date().getTime() );
873 // if the resource is a directory don't cache it as new groupId deployed will be available
874 // without need of refreshing browser
875 else if ( locator.getResourcePath().endsWith( "/maven-metadata.xml" ) || (
876 resource instanceof ArchivaVirtualDavResource && ( Files.isDirectory(Paths.get(
877 ArchivaVirtualDavResource.class.cast( resource ).getLogicalResource() )) ) ) )
879 response.setHeader( "Pragma", "no-cache" );
880 response.setHeader( "Cache-Control", "no-cache" );
881 response.setDateHeader( "Last-Modified", new Date().getTime() );
885 if ( resource instanceof ArchivaVirtualDavResource )
887 //MRM-1854 here we have a directory so force "Last-Modified"
888 response.setDateHeader( "Last-Modified", new Date().getTime() );
893 // We need to specify this so connecting wagons can work correctly
894 response.setDateHeader( "Last-Modified", resource.getModificationTime() );
896 // TODO: [MRM-524] determine http caching options for other types of files (artifacts, sha1, md5, snapshots)
899 private ArchivaDavResourceLocator checkLocatorIsInstanceOfRepositoryLocator( DavResourceLocator locator )
902 if ( !( locator instanceof ArchivaDavResourceLocator ) )
904 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
905 "Locator does not implement RepositoryLocator" );
909 if ( locator.getResourcePath().startsWith( ArchivaDavResource.HIDDEN_PATH_PREFIX ) )
911 throw new DavException( HttpServletResponse.SC_NOT_FOUND );
914 ArchivaDavResourceLocator archivaLocator = (ArchivaDavResourceLocator) locator;
916 // MRM-419 - Windows Webdav support. Should not 404 if there is no content.
917 if ( StringUtils.isEmpty( archivaLocator.getRepositoryId() ) )
919 throw new DavException( HttpServletResponse.SC_NO_CONTENT );
921 return archivaLocator;
924 private String addHrefPrefix( String contextPath, String path ) {
925 String prefix = archivaConfiguration.getConfiguration().getWebapp().getUi().getApplicationUrl();
926 if (prefix == null || prefix.isEmpty()) {
927 prefix = contextPath;
929 return prefix + ( StringUtils.startsWith( path, "/" ) ? "" :
930 ( StringUtils.endsWith( prefix, "/" ) ? "" : "/" ) )
934 public void setProxyRegistry(ProxyRegistry proxyRegistry) {
935 this.proxyRegistry = proxyRegistry;
938 public ProxyRegistry getProxyRegistry() {
939 return this.proxyRegistry;
942 private static class LogicalResource
946 public LogicalResource( String path )
951 public String getPath()
956 public void setPath( String path )
962 protected boolean isAuthorized( DavServletRequest request, String repositoryId )
967 AuthenticationResult result = httpAuth.getAuthenticationResult( request, null );
968 SecuritySession securitySession = httpAuth.getSecuritySession( request.getSession( true ) );
970 return servletAuth.isAuthenticated( request, result ) //
971 && servletAuth.isAuthorized( request, securitySession, repositoryId, //
972 WebdavMethodUtil.getMethodPermission( request.getMethod() ) );
974 catch ( AuthenticationException e )
976 // safety check for MRM-911
977 String guest = UserManager.GUEST_USERNAME;
980 if ( servletAuth.isAuthorized( guest,
981 ( (ArchivaDavResourceLocator) request.getRequestLocator() ).getRepositoryId(),
982 WebdavMethodUtil.getMethodPermission( request.getMethod() ) ) )
987 catch ( UnauthorizedException ae )
989 throw new UnauthorizedDavException( repositoryId,
990 "You are not authenticated and authorized to access any repository." );
993 throw new UnauthorizedDavException( repositoryId, "You are not authenticated" );
995 catch ( MustChangePasswordException e )
997 throw new UnauthorizedDavException( repositoryId, "You must change your password." );
999 catch ( AccountLockedException e )
1001 throw new UnauthorizedDavException( repositoryId, "User account is locked." );
1003 catch ( AuthorizationException e )
1005 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
1006 "Fatal Authorization Subsystem Error." );
1008 catch ( UnauthorizedException e )
1010 throw new UnauthorizedDavException( repositoryId, e.getMessage() );
1014 private DavResource getResourceFromGroup( DavServletRequest request,
1015 ArchivaDavResourceLocator locator,
1016 RepositoryGroup repositoryGroup )
1019 final String id = repositoryGroup.getId();
1020 final List<ManagedRepository> repositories = repositoryGroup.getRepositories();
1021 if ( repositories == null
1022 || repositories.isEmpty() )
1025 return new ArchivaDavResource( repositoryGroup.getAsset("/"), "groups/" + id, null,
1026 request.getDavSession(), locator, this, mimeTypes, auditListeners, scheduler);
1027 } catch (LayoutException e) {
1028 log.error("Bad repository layout: {}", e.getMessage(), e);
1029 throw new DavException(500, e);
1032 List<StorageAsset> mergedRepositoryContents = new ArrayList<>();
1034 ManagedRepository firstRepo = repositories.get( 0 );
1036 String path = getLogicalResource( locator, firstRepo, false );
1037 if ( path.startsWith( "/" ) )
1039 path = path.substring( 1 );
1041 LogicalResource logicalResource = new LogicalResource( path );
1044 // if the current user logged in has permission to any of the repositories, allow user to
1045 // browse the repo group but displaying only the repositories which the user has permission to access.
1046 // otherwise, prompt for authentication.
1048 String activePrincipal = getActivePrincipal( request );
1050 boolean allow = isAllowedToContinue( request, repositories, activePrincipal );
1053 String pathInfo = StringUtils.removeEnd( request.getPathInfo(), "/" );
1054 String mergedIndexPath = "/";
1055 if (repositoryGroup.supportsFeature( IndexCreationFeature.class )) {
1056 IndexCreationFeature indexCreationFeature = repositoryGroup.getFeature( IndexCreationFeature.class ).get();
1057 mergedIndexPath = indexCreationFeature.getIndexPath().getPath();
1063 if ( StringUtils.endsWith( pathInfo, mergedIndexPath ) )
1065 Path mergedRepoDirPath =
1066 buildMergedIndexDirectory( activePrincipal, request, repositoryGroup );
1067 FilesystemAsset mergedRepoDir = new FilesystemAsset(pathInfo, mergedRepoDirPath);
1068 mergedRepositoryContents.add( mergedRepoDir );
1072 if ( StringUtils.equalsIgnoreCase( pathInfo, "/" + id ) )
1074 Path tmpDirectory = Paths.get( SystemUtils.getJavaIoTmpDir().toString(),
1077 if ( !Files.exists(tmpDirectory) )
1079 synchronized ( tmpDirectory.toAbsolutePath().toString() )
1081 if ( !Files.exists(tmpDirectory) )
1085 Files.createDirectories( tmpDirectory );
1087 catch ( IOException e )
1089 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not create direcotory "+tmpDirectory );
1094 FilesystemAsset parentDir = new FilesystemAsset(pathInfo, tmpDirectory.getParent());
1095 mergedRepositoryContents.add( parentDir );
1097 for ( ManagedRepository repo : repositories )
1099 ManagedRepositoryContent managedRepository = null;
1101 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
1102 "Invalid managed repository <" + repo.getId() + ">");
1104 managedRepository = repo.getContent();
1105 if (managedRepository==null) {
1106 log.error("Inconsistency detected. Repository content not found for '{}'",repo.getId());
1107 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
1108 "Invalid managed repository <" + repo.getId() + ">");
1110 // Path resourceFile = Paths.get( managedRepository.getRepoRoot(), logicalResource.getPath() );
1111 StorageAsset resourceFile = managedRepository.getAsset(logicalResource.getPath());
1112 if ( resourceFile.exists() && managedRepository.getRepository().supportsFeature( IndexCreationFeature.class ))
1114 // in case of group displaying index directory doesn't have sense !!
1115 IndexCreationFeature idf = managedRepository.getRepository().getFeature(IndexCreationFeature.class).get();
1116 StorageAsset repoIndexDirectory = idf.getLocalIndexPath();
1117 if ( !StringUtils.equals( FilenameUtils.normalize( repoIndexDirectory.getPath() ),
1118 FilenameUtils.normalize( logicalResource.getPath() ) ) )
1120 // for prompted authentication
1121 if ( httpAuth.getSecuritySession( request.getSession( true ) ) != null )
1125 if ( isAuthorized( request, repo.getId() ) )
1127 mergedRepositoryContents.add( resourceFile );
1128 log.debug( "Repository '{}' accessed by '{}'", repo.getId(), activePrincipal );
1131 catch ( DavException e )
1133 // TODO: review exception handling
1135 log.debug( "Skipping repository '{}' for user '{}': {}", managedRepository,
1136 activePrincipal, e.getMessage() );
1143 // for the current user logged in
1146 if ( servletAuth.isAuthorized( activePrincipal, repo.getId(),
1147 WebdavMethodUtil.getMethodPermission(
1148 request.getMethod() ) ) )
1150 mergedRepositoryContents.add( resourceFile );
1151 log.debug( "Repository '{}' accessed by '{}'", repo.getId(), activePrincipal );
1154 catch ( UnauthorizedException e )
1156 // TODO: review exception handling
1158 log.debug( "Skipping repository '{}' for user '{}': {}", managedRepository,
1159 activePrincipal, e.getMessage() );
1170 throw new UnauthorizedDavException( locator.getRepositoryId(), "User not authorized." );
1173 ArchivaVirtualDavResource resource =
1174 new ArchivaVirtualDavResource( mergedRepositoryContents, logicalResource.getPath(), mimeTypes, locator,
1177 // compatibility with MRM-440 to ensure browsing the repository group works ok
1178 if ( resource.isCollection() && !request.getRequestURI().endsWith( "/" ) )
1180 throw new BrowserRedirectException( resource.getHref() );
1186 protected String getActivePrincipal( DavServletRequest request )
1188 User sessionUser = httpAuth.getSessionUser( request.getSession() );
1189 return sessionUser != null ? sessionUser.getUsername() : UserManager.GUEST_USERNAME;
1193 * Check if the current user is authorized to access any of the repos
1196 * @param repositories
1197 * @param activePrincipal
1200 private boolean isAllowedToContinue( DavServletRequest request, List<ManagedRepository> repositories, String activePrincipal )
1202 // when no repositories configured it's impossible to browse nothing !
1203 // at least make possible to see nothing :-)
1204 if ( repositories == null || repositories.isEmpty() )
1209 boolean allow = false;
1211 // if securitySession != null, it means that the user was prompted for authentication
1212 if ( httpAuth.getSecuritySession( request.getSession() ) != null )
1214 for ( ManagedRepository repository : repositories )
1218 if ( isAuthorized( request, repository.getId() ) )
1224 catch ( DavException e )
1232 for ( ManagedRepository repository : repositories )
1236 if ( servletAuth.isAuthorized( activePrincipal, repository.getId(),
1237 WebdavMethodUtil.getMethodPermission( request.getMethod() ) ) )
1243 catch ( UnauthorizedException e )
1253 private StorageAsset writeMergedMetadataToFile( RepositoryGroup repoGroup, ArchivaRepositoryMetadata mergedMetadata, String outputFilename )
1254 throws RepositoryMetadataException, DigesterException, IOException
1256 StorageAsset asset = repoGroup.addAsset( outputFilename, false );
1257 OutputStream stream = asset.writeData( true );
1258 OutputStreamWriter sw = new OutputStreamWriter( stream, "UTF-8" );
1259 RepositoryMetadataWriter.write( mergedMetadata, sw );
1261 createChecksumFiles( repoGroup, outputFilename );
1266 private void createChecksumFiles(RepositoryGroup repo, String path) {
1267 List<ChecksumAlgorithm> algorithms = ChecksumUtil.getAlgorithms( archivaConfiguration.getConfiguration( ).getArchivaRuntimeConfiguration( ).getChecksumTypes( ) );
1268 List<OutputStream> outStreams = algorithms.stream( ).map( algo -> {
1269 String ext = algo.getDefaultExtension( );
1272 return repo.getAsset( path + "." + ext ).writeData( true );
1274 catch ( IOException e )
1276 e.printStackTrace( );
1279 } ).filter( Objects::nonNull ).collect( Collectors.toList( ) );
1282 StreamingChecksum.updateChecksums( repo.getAsset(path).getData(), algorithms, outStreams );
1284 catch ( IOException e )
1286 e.printStackTrace( );
1292 private boolean isProjectReference( String requestedResource )
1296 metadataTools.toVersionedReference( requestedResource );
1299 catch ( RepositoryMetadataException re )
1305 protected Path buildMergedIndexDirectory( String activePrincipal,
1306 DavServletRequest request,
1307 RepositoryGroup repositoryGroup )
1313 final List<ManagedRepository> repositories = repositoryGroup.getRepositories();
1314 HttpSession session = request.getSession();
1316 @SuppressWarnings( "unchecked" ) Map<String, TemporaryGroupIndex> temporaryGroupIndexMap =
1317 (Map<String, TemporaryGroupIndex>) session.getAttribute(
1318 TemporaryGroupIndexSessionCleaner.TEMPORARY_INDEX_SESSION_KEY );
1319 if ( temporaryGroupIndexMap == null )
1321 temporaryGroupIndexMap = new HashMap<>();
1324 final String id = repositoryGroup.getId();
1325 TemporaryGroupIndex tmp = temporaryGroupIndexMap.get(id);
1327 if ( tmp != null && tmp.getDirectory() != null && Files.exists(tmp.getDirectory()))
1329 if ( System.currentTimeMillis() - tmp.getCreationTime() > (
1330 repositoryGroup.getMergedIndexTTL() * 60 * 1000 ) )
1332 log.debug( MarkerFactory.getMarker( "group.merged.index" ),
1333 "tmp group index '{}' is too old so delete it", id);
1334 indexMerger.cleanTemporaryGroupIndex( tmp );
1338 log.debug( MarkerFactory.getMarker( "group.merged.index" ),
1339 "merged index for group '{}' found in cache", id);
1340 return tmp.getDirectory();
1344 Set<String> authzRepos = new HashSet<String>();
1346 String permission = WebdavMethodUtil.getMethodPermission( request.getMethod() );
1348 for ( ManagedRepository repository : repositories )
1352 if ( servletAuth.isAuthorized( activePrincipal, repository.getId(), permission ) )
1354 authzRepos.add( repository.getId() );
1355 authzRepos.addAll( this.repositorySearch.getRemoteIndexingContextIds( repository.getId() ) );
1358 catch ( UnauthorizedException e )
1360 // TODO: review exception handling
1362 log.debug( "Skipping repository '{}' for user '{}': {}", repository, activePrincipal,
1368 log.info( "generate temporary merged index for repository group '{}' for repositories '{}'",
1371 IndexCreationFeature indexCreationFeature = repositoryGroup.getFeature( IndexCreationFeature.class ).get();
1372 Path indexPath = indexCreationFeature.getLocalIndexPath().getFilePath();
1373 if (indexPath!=null)
1375 Path tempRepoFile = Files.createTempDirectory( "temp" );
1376 tempRepoFile.toFile( ).deleteOnExit( );
1378 IndexMergerRequest indexMergerRequest =
1379 new IndexMergerRequest( authzRepos, true, id,
1380 indexPath.toString( ),
1381 repositoryGroup.getMergedIndexTTL( ) ).mergedIndexDirectory(
1382 tempRepoFile ).temporary( true );
1384 MergedRemoteIndexesTaskRequest taskRequest =
1385 new MergedRemoteIndexesTaskRequest( indexMergerRequest, indexMerger );
1387 MergedRemoteIndexesTask job = new MergedRemoteIndexesTask( taskRequest );
1389 ArchivaIndexingContext indexingContext = job.execute( ).getIndexingContext( );
1391 Path mergedRepoDir = Paths.get( indexingContext.getPath( ) );
1392 TemporaryGroupIndex temporaryGroupIndex =
1393 new TemporaryGroupIndex( mergedRepoDir, indexingContext.getId( ), id,
1394 repositoryGroup.getMergedIndexTTL( ) ) //
1395 .setCreationTime( new Date( ).getTime( ) );
1396 temporaryGroupIndexMap.put( id, temporaryGroupIndex );
1397 session.setAttribute( TemporaryGroupIndexSessionCleaner.TEMPORARY_INDEX_SESSION_KEY,
1398 temporaryGroupIndexMap );
1399 return mergedRepoDir;
1401 log.error("Local index path for repository group {} does not exist.", repositoryGroup.getId());
1402 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
1405 catch ( RepositorySearchException e )
1407 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
1409 catch ( IndexMergerException e )
1411 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
1413 catch ( IOException e )
1415 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
1420 public void setServletAuth( ServletAuthenticator servletAuth )
1422 this.servletAuth = servletAuth;
1425 public void setHttpAuth( HttpAuthenticator httpAuth )
1427 this.httpAuth = httpAuth;
1430 public void setScheduler( RepositoryArchivaTaskScheduler scheduler )
1432 this.scheduler = scheduler;
1435 public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
1437 this.archivaConfiguration = archivaConfiguration;
1440 public RemoteRepositoryAdmin getRemoteRepositoryAdmin()
1442 return remoteRepositoryAdmin;
1445 public void setRemoteRepositoryAdmin( RemoteRepositoryAdmin remoteRepositoryAdmin )
1447 this.remoteRepositoryAdmin = remoteRepositoryAdmin;
1450 public ManagedRepositoryAdmin getManagedRepositoryAdmin()
1452 return managedRepositoryAdmin;
1455 public void setManagedRepositoryAdmin( ManagedRepositoryAdmin managedRepositoryAdmin )
1457 this.managedRepositoryAdmin = managedRepositoryAdmin;
1460 public RepositoryRegistry getRepositoryRegistry( )
1462 return repositoryRegistry;
1465 public void setRepositoryRegistry( RepositoryRegistry repositoryRegistry )
1467 this.repositoryRegistry = repositoryRegistry;