buf.append( "\n Repository Layout : " ).append( repo.getLayout() );
private String getLogicalResource( ArchivaDavResourceLocator archivaLocator, org.apache.archiva.repository.ManagedRepository managedRepository, boolean useOrigResourcePath ) { // FIXME remove this hack // but currently managedRepository can be null in case of group String layout = managedRepository == null ? "default" : managedRepository.getLayout(); RepositoryStorage repositoryStorage = this.applicationContext.getBean( "repositoryStorage#" + layout, RepositoryStorage.class ); String path = repositoryStorage.getFilePath( useOrigResourcePath ? archivaLocator.getOrigResourcePath() : archivaLocator.getResourcePath(), managedRepository ); log.debug( "found path {} for resourcePath: '{}' with managedRepo '{}' and layout '{}'", path, archivaLocator.getResourcePath(), managedRepository == null ? "null" : managedRepository.getId(), layout ); return path; }
@Override public ManagedRepositoryContent createManagedContent( ManagedRepository repository ) throws RepositoryException { if (!supports( repository.getType() )) { throw new RepositoryException( "Repository type "+repository.getType()+" is not supported by this implementation." ); } if (!supportsLayout( repository.getLayout() )) { throw new RepositoryException( "Repository layout "+repository.getLayout()+" is not supported by this implementation." ); } ManagedDefaultRepositoryContent content = new ManagedDefaultRepositoryContent(artifactMappingProviders, filetypes); content.setRepository( repository ); return content; }
public ManagedRepositoryContent getManagedRepositoryContent( org.apache.archiva.repository.ManagedRepository mRepo ) throws RepositoryException { final String id = mRepo.getId(); ManagedRepositoryContent content = managedContentMap.get( id ); if ( content != null && content.getRepository()==mRepo) { return content; } RepositoryContentProvider contentProvider = getProvider( mRepo.getLayout( ), mRepo.getType( ) ); content = contentProvider.createManagedContent( mRepo ); if (content==null) { throw new RepositoryException( "Could not create repository content instance for "+mRepo.getId() ); } ManagedRepositoryContent previousContent = managedContentMap.put( id, content ); if (previousContent!=null) { previousContent.setRepository( null ); } return content; }
private String evaluatePathWithVersion( ArchivaDavResourceLocator archivaLocator, // ManagedRepositoryContent managedRepositoryContent, // String contextPath ) throws DavException { String layout = managedRepositoryContent.getRepository() == null ? "default" : managedRepositoryContent.getRepository().getLayout(); RepositoryStorage repositoryStorage = this.applicationContext.getBean( "repositoryStorage#" + layout, RepositoryStorage.class ); try { return repositoryStorage.getFilePathWithVersion( archivaLocator.getResourcePath(), // managedRepositoryContent ); } catch ( RelocationException e ) { String path = e.getPath(); log.debug( "Relocation to {}", path ); throw new BrowserRedirectException( addHrefPrefix( contextPath, path ), e.getRelocationType() ); } catch ( XMLException e ) { log.error( e.getMessage(), e ); throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e ); } }
String repositoryLayout = managedRepository.getRepository().getLayout();
cfg.setDescription(managedRepository.getDescription()); cfg.setLocation(convertUriToPath(managedRepository.getLocation())); cfg.setLayout(managedRepository.getLayout()); cfg.setRefreshCronExpression(managedRepository.getSchedulingDefinition()); cfg.setScanned(managedRepository.isScanned());
@Override public ManagedRepositoryConfiguration getManagedConfiguration( ManagedRepository managedRepository ) { ManagedRepositoryConfiguration configuration = new ManagedRepositoryConfiguration( ); configuration.setId( managedRepository.getId( ) ); configuration.setName(managedRepository.getName()); configuration.setLocation( managedRepository.getLocation( ) == null ? "" : managedRepository.getLocation().toString( ) ); configuration.setBlockRedeployments( managedRepository.blocksRedeployments( ) ); configuration.setDescription( managedRepository.getDescription( ) ); configuration.setScanned( managedRepository.isScanned( ) ); configuration.setRefreshCronExpression( managedRepository.getSchedulingDefinition( ) ); configuration.setReleases( managedRepository.getActiveReleaseSchemes().contains(ReleaseScheme.RELEASE) ); configuration.setSnapshots( managedRepository.getActiveReleaseSchemes().contains(ReleaseScheme.SNAPSHOT) ); configuration.setLayout( managedRepository.getLayout() ); ArtifactCleanupFeature acf = managedRepository.getFeature( ArtifactCleanupFeature.class ).get( ); configuration.setRetentionPeriod( acf.getRetentionPeriod( ).getDays( ) ); configuration.setDeleteReleasedSnapshots( acf.isDeleteReleasedSnapshots( ) ); configuration.setRetentionCount( acf.getRetentionCount( ) ); IndexCreationFeature icf = managedRepository.getFeature( IndexCreationFeature.class ).get( ); configuration.setSkipPackedIndexCreation( icf.isSkipPackedIndexCreation( ) ); configuration.setIndexDir( icf.getIndexPath( ) == null ? "" : icf.getIndexPath().toString( ) ); StagingRepositoryFeature srf = managedRepository.getFeature( StagingRepositoryFeature.class ).get( ); configuration.setStageRepoNeeded( srf.isStageRepoNeeded( ) ); return configuration; }