/*
 * Copyright 2011-2015 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.b2international.snowowl.datastore.server.index;

import static com.google.common.base.Preconditions.checkNotNull;

import java.io.File;

import com.b2international.snowowl.core.api.index.IIndexEntry;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;

/**
 * File system backed index server service.
 */
public abstract class FSIndexServerService<E extends IIndexEntry> extends IndexServerService<E> {

	private final Supplier<IDirectoryManager> directorySupplier = Suppliers.memoize(new Supplier<IDirectoryManager>() {
		@Override public IDirectoryManager get() {
			return new FSDirectoryManager(getRepositoryUuid(), indexPath);
		}
	});

	private final File indexPath;	
	
	protected FSIndexServerService(final File indexPath) {
		this.indexPath = checkNotNull(indexPath, "indexPath");
	}
	
	@Override
	protected IDirectoryManager getDirectoryManager() {
		return directorySupplier.get();
	}


}
@@ -769,16 +769,103 @@
 o.File;%0A
+import java.nio.file.Path;%0A%0Aimport com.b2international.snowowl.core.SnowOwlApplication;
 %0Aimport 
@@ -1369,25 +1369,38 @@
 Uuid(), 
-indexPath
+getAbsoluteIndexRoot()
 );%0A%09%09%7D%0A%09
@@ -1415,28 +1415,28 @@
 ivate final 
-File
+Path
  indexPath;%09
@@ -1549,16 +1549,249 @@
 exPath%22)
+.toPath();%0A%09%7D%0A%09%0A%09private File getAbsoluteIndexRoot() %7B%0A%09%09// %22.../resources/indexes/snomed%22%0A%09%09return SnowOwlApplication.INSTANCE.getEnviroment().getDataDirectory().toPath()%0A%09%09%09%09.resolve(%22indexes%22)%0A%09%09%09%09.resolve(indexPath)%0A%09%09%09%09.toFile()
 ;%0A%09%7D%0A%09%0A%09
@@ -1894,7 +1894,6 @@
 %0A%09%7D%0A
-%0A%0A
 %7D
+%0A

Add back absolute part of index folder locations