public void setBaseDirectory(File baseDirectory)
{
ValidationUtils.assertNotNull(baseDirectory, "baseDirectory cannot be null");
if (!baseDirectory.exists())
throw new ContentServiceConfigException("baseDirectory does not exist: " + baseDirectory.getAbsolutePath());
if (!baseDirectory.isDirectory())
throw new ContentServiceConfigException("baseDirectory is not a directory: " + baseDirectory.getAbsolutePath());
if (!baseDirectory.canWrite())
throw new ContentServiceConfigException("baseDirectory is not writable: " + baseDirectory.getAbsolutePath());
if (!this.baseDirectory.compareAndSet(null, baseDirectory))
throw new ContentServiceConfigException("cannot change baseDirectory");
}