Hi,
To create new Repository I used the following way:
RepositoryAccessor repositoryAccessor = new RepositoryAccessorImplementation();
RepositoryManager repositoryManager = RepositoryManager.getInstance(repositoryAccessor);
File root = new File("Files/");
if (!(new File("Files/Repository").exists())){
System.out.println("*************************");
LocalRepository localRepository = new LocalRepository("Repository", root);
repositoryManager.addRepository(localRepository);
File[] files = root.listFiles();
for (File file : files){
copyFile(file, new File("Files/Repository/"+file.getName()));//copy files from directory to another
}
}
repositoryManager.save();
If I run the program twice and display the repositories, I got:
First run
Before creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
*************************
After creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
Repository
Second run (immediately after the first run)
Before creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
Repository
*************************
After creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
Repository
Repository
Even if the folder of repository exists, it keep creating the the repository and ignoring the condition,
So, I checked the path where the repository should exist, and I found NO folder called "Repository" after creating the repository. However, the strange thing is I got the new repository in the list returned by getRepositories() method! (shown in the output above)
If I restart Netbeans and RapidMiner, I found the new repositories exist in RapidMiner studio but not in my file system!!!
My question is: how can I save the changes of creating repository (or even delete repository) without closing Netbeans and RapidMiner?
I tried to use save() and load() mothods as they load and save xml configuration files, but it didn't make sense!