]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/internal/IndexChangedWriter.java
Merge branch 'feature/funcwrite'
[simantics/platform.git] / bundles / org.simantics.db.indexing / src / org / simantics / db / indexing / internal / IndexChangedWriter.java
1 /*******************************************************************************
2  * Copyright (c) 2017 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.indexing.internal;
13
14 import java.io.File;
15 import java.io.IOException;
16 import java.util.HashSet;
17 import java.util.Set;
18
19 /**
20  * An internal in-memory container for telling whether a certain index has been
21  * changed since the platform was last started up. 
22  * 
23  * @author Jussi Koskela
24  * @since 1.28.0
25  */
26 public class IndexChangedWriter {
27         private Set<String> dirtyFiles = new HashSet<>();
28
29         public synchronized boolean markDirty(File dirtyFile) throws IOException {
30                 return dirtyFiles.add(dirtyFile.getAbsolutePath());
31         }
32 }