*/
public Path getRemoteRepositoryBaseDir();
+ /**
+ * Returns the base directory for repository group files.
+ * @return
+ */
+ public Path getRepositoryGroupBaseDir();
+
/**
* Returns the data directory where repositories and metadata reside
* @return
*/
private String remoteRepositoryBaseDirectory;
+ /**
+ * The base directory for local storage of repository group files.
+ * If not set, it's ${dataDirectory}/groups
+ */
+ private String repositoryGroupBaseDirectory;
+
/**
* The default language used for setting internationalized
* strings.
return this.repositoryBaseDirectory;
} //-- String getRepositoryBaseDirectory()
+ /**
+ * Get the base directory for local storage of repository group data.
+ * If not set it's ${dataDirectory}/groups
+ *
+ * @return The path to the directory. Either a absolute path, or a path
+ * relative to ${dataDirectory}
+ */
+ public String getRepositoryGroupBaseDirectory() {
+ return this.repositoryGroupBaseDirectory;
+ }
+
/**
* Get the url failure cache configuration.
*
this.repositoryBaseDirectory = repositoryBaseDirectory;
} //-- void setRepositoryBaseDirectory( String )
+
+ public void setRepositoryGroupBaseDirectory(String repositoryGroupBaseDirectory) {
+ this.repositoryGroupBaseDirectory = repositoryGroupBaseDirectory;
+ }
+
/**
* Set the url failure cache configuration.
*
private volatile Path dataDirectory;
private volatile Path repositoryBaseDirectory;
private volatile Path remoteRepositoryBaseDirectory;
+ private volatile Path repositoryGroupBaseDirectory;
@PostConstruct
private void init() {
dataDirectory.resolve(tmpRepoBaseDir);
}
}
+
String remoteRepoBaseDir = config.getArchivaRuntimeConfiguration().getRemoteRepositoryBaseDirectory();
if (StringUtils.isEmpty(remoteRepoBaseDir)) {
remoteRepositoryBaseDirectory = dataDirectory.resolve("remotes");
}
}
+ String repositoryGroupBaseDir = config.getArchivaRuntimeConfiguration().getRepositoryGroupBaseDirectory();
+ if (StringUtils.isEmpty(repositoryGroupBaseDir)) {
+ repositoryGroupBaseDirectory = dataDirectory.resolve("groups");
+ } else {
+ Path tmpGroupDir = Paths.get(repositoryGroupBaseDir);
+ if (tmpGroupDir.isAbsolute()) {
+ repositoryGroupBaseDirectory = tmpGroupDir;
+ } else {
+ dataDirectory.resolve(tmpGroupDir);
+ }
+ }
+
config.getRepositoryGroups();
config.getRepositoryGroupsAsMap();
return remoteRepositoryBaseDirectory;
}
+ @Override
+ public Path getRepositoryGroupBaseDir() {
+ if (repositoryGroupBaseDirectory == null) {
+ getConfiguration();
+ }
+ return repositoryGroupBaseDirectory;
+ }
+
@Override
public Path getDataDirectory() {
if (dataDirectory == null) {
* under the License.
*/
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Class RepositoryGroupConfiguration.
*
*/
@SuppressWarnings( "all" )
public class RepositoryGroupConfiguration
- implements java.io.Serializable
+ implements Serializable
{
//--------------------------/
*/
private String id;
+ /**
+ * The name of the repository group
+ */
+ private String name;
+
/**
* The path of the merged index.
*/
/**
* Field repositories.
*/
- private java.util.List<String> repositories;
+ private List<String> repositories;
//-----------/
*
* @return List
*/
- public java.util.List<String> getRepositories()
+ public List<String> getRepositories()
{
if ( this.repositories == null )
{
- this.repositories = new java.util.ArrayList<String>();
+ this.repositories = new ArrayList<String>();
}
return this.repositories;
*
* @param repositories
*/
- public void setRepositories( java.util.List<String> repositories )
+ public void setRepositories( List<String> repositories )
{
this.repositories = repositories;
} //-- void setRepositories( java.util.List )
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
}
}
value.setId(id);
+
+ value.setName(registry.getString(prefix + "name"));
+
//String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
List<String> mergedIndexPathList = registry.getList(prefix + "mergedIndexPath");
value.setRemoteRepositoryBaseDirectory(remoteRepositoryBaseDirectory);
//String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() );
+
+ List<String> repositoryGroupBaseDirectoryList = registry.getList(prefix + "repositoryGroupBaseDirectory");
+ String repositoryGroupBaseDirectory = value.getRepositoryGroupBaseDirectory();
+ if (repositoryGroupBaseDirectoryList != null && !repositoryGroupBaseDirectoryList.isEmpty()) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0, size = repositoryGroupBaseDirectoryList.size(); i < size; i++) {
+ sb.append(repositoryGroupBaseDirectoryList.get(i));
+ if (i < size - 1) {
+ sb.append(',');
+ }
+ }
+ repositoryGroupBaseDirectory = sb.toString();
+ }
+
+ value.setRepositoryGroupBaseDirectory(repositoryGroupBaseDirectory);
+
List<String> defaultLanguageList = registry.getList(prefix + "defaultLanguage");
String defaultLanguage = value.getDefaultLanguage();
if (defaultLanguageList != null && !defaultLanguageList.isEmpty()) {
String id = "id";
registry.setString(prefix + id, value.getId());
}
+ if (value.getName() != null) {
+ registry.setString(prefix + "name", value.getName());
+ }
if (value.getMergedIndexPath() != null && !value.getMergedIndexPath().equals(".indexer")
) {
String mergedIndexPath = "mergedIndexPath";
String remoteRepositoryBaseDirectory = "remoteRepositoryBaseDirectory";
registry.setString(prefix + remoteRepositoryBaseDirectory, value.getRemoteRepositoryBaseDirectory());
}
+ if (value.getRepositoryGroupBaseDirectory() != null
+ ) {
+ String repositoryGroupBaseDirectory = "repositoryGroupBaseDirectory";
+ registry.setString(prefix + repositoryGroupBaseDirectory, value.getRepositoryGroupBaseDirectory());
+ }
+
if (value.getDefaultLanguage() != null && !value.getDefaultLanguage().equals("en-US")
) {
String defaultLanguage = "defaultLanguage";