public void removeEntry(final File file) throws IOException {
        synchronized (ksEntries) {
            final File entriesFile = seekEntries(file.getParent());

            // if there is no Entries file we cannot very well remove an Entry
            // from it
            if (entriesFile == null) {
                return;
            }

            processEntriesDotLog(new File(file.getParent(), "CVS")); // NOI18N

            final File directory = entriesFile.getParentFile();
            final File tempFile = new File(directory, "Entries.Backup"); // NOI18N
            tempFile.createNewFile();
            BufferedReader reader = null;
            BufferedWriter writer = null;
            try {
                reader = new BufferedReader(new FileReader(entriesFile));
                writer = new BufferedWriter(new FileWriter(tempFile));
                String line;
                // allows us to determine whether we need to put in a "D" line.
                // We do
                // that if we remove the last directory from the Entries file
                boolean directoriesExist = false;
                while ((line = reader.readLine()) != null) {
                    final Entry currentEntry = new Entry(line);
                    if ((currentEntry.getName() != null) &&

                    !currentEntry.getName().equals(file.getName())) {
                        writer.write(currentEntry.toString());
                        writer.newLine();
                        directoriesExist = directoriesExist || currentEntry.isDirectory();
                    }
                }
                if (!directoriesExist) {
                    writer.write("D"); // NOI18N
                    writer.newLine();
                }
            } finally {
                try {
                    if (writer != null) {
                        writer.close();
                    }
                } finally {
                    if (reader != null) {
                        reader.close();
                    }
                }
            }

            if (t9yBeforeRename != null) {
                t9yBeforeRename.run();
            }
            FileUtils.renameFile(tempFile, entriesFile);
        }
    }