mirror of https://github.com/apache/archiva.git
take of relative path in configuration file
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1400162 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b85e828155
commit
f34d32f93c
|
@ -556,6 +556,22 @@ public class DefaultManagedRepositoryAdmin
|
||||||
public IndexingContext createIndexContext( ManagedRepository repository )
|
public IndexingContext createIndexContext( ManagedRepository repository )
|
||||||
throws RepositoryAdminException
|
throws RepositoryAdminException
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// take care first about repository location as can be relative
|
||||||
|
File repositoryDirectory = new File( repository.getLocation() );
|
||||||
|
|
||||||
|
if ( !repositoryDirectory.isAbsolute() )
|
||||||
|
{
|
||||||
|
repositoryDirectory =
|
||||||
|
new File( getRegistry().getString( "appserver.base" ) + File.separatorChar + "repositories",
|
||||||
|
repository.getLocation() );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !repositoryDirectory.exists() )
|
||||||
|
{
|
||||||
|
repositoryDirectory.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -585,10 +601,7 @@ public class DefaultManagedRepositoryAdmin
|
||||||
indexDirectory = new File( managedRepository, ".indexer" );
|
indexDirectory = new File( managedRepository, ".indexer" );
|
||||||
if ( !managedRepository.isAbsolute() )
|
if ( !managedRepository.isAbsolute() )
|
||||||
{
|
{
|
||||||
indexDirectory = new File(
|
indexDirectory = new File( repositoryDirectory, ".indexer" );
|
||||||
getRegistry().getString( "appserver.base" ) + File.separatorChar + "repositories"
|
|
||||||
+ File.separatorChar +
|
|
||||||
repository.getLocation(), ".indexer" );
|
|
||||||
repository.setIndexDirectory( indexDirectory.getAbsolutePath() );
|
repository.setIndexDirectory( indexDirectory.getAbsolutePath() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue