public bool IsRoomFor(VolumePath path, FileContent fileContent)
{
VolumeItem existing = Open(path);
if (existing is VolumeDirectory)
{
throw new KOSPersistenceException("'" + path + "' is a directory");
}
VolumeFile existingFile = existing as VolumeFile;
int usedByThisFile = 0;
if (existingFile != null)
{
usedByThisFile = existingFile.ReadAll().Size;
}
return INFINITE_CAPACITY == FreeSpace || FreeSpace + usedByThisFile >= fileContent.Size;
}