Example usage for org.eclipse.jdt.internal.core.index IndexLocation toString

List of usage examples for org.eclipse.jdt.internal.core.index IndexLocation toString

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.index IndexLocation toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.search.indexing.IndexManager.java

License:Open Source License

private void writeIndexMapFile() {
    BufferedWriter writer = null;
    try {/* ww  w  . j  a  va 2s .co  m*/
        writer = new BufferedWriter(new FileWriter(this.indexNamesMapFile));
        writer.write(DiskIndex.SIGNATURE);
        writer.write('\n');
        Object[] keys = this.indexStates.keyTable;
        Object[] states = this.indexStates.valueTable;
        for (int i = 0, l = states.length; i < l; i++) {
            IndexLocation location = (IndexLocation) keys[i];
            if (location != null && states[i] == REUSE_STATE) {
                IPath container = (IPath) this.indexLocations.keyForValue(location);
                if (container != null) {
                    writer.write(location.toString());
                    writer.write('\n');
                    writer.write(container.toOSString());
                    writer.write('\n');
                }
            }
        }
    } catch (IOException ignored) {
        if (VERBOSE)
            Util.verbose("Failed to write saved index file names", System.err); //$NON-NLS-1$
    } finally {
        if (writer != null) {
            try {
                writer.close();
            } catch (IOException e) {
                // ignore
            }
        }
    }
}