if (indexDirectory.canWrite()) {
writeLock = new File(indexDirectory, "write.lock");
if (writeLock.createNewFile()) {
weWroteTheWriteLock = true;
} else {
throw new LockedIndexException(
new Exception("the write lock file already exists in the index."));
}
//set to read only so the index jobs will not delete it.
writeLock.setReadOnly();
response.setContentType("application/x-compressed, application/x-tar");