public function deleteDeliveryDirectory(core_kernel_classes_Resource $assembly)
    {
        $success = true;
        $deleted = 0;
        $directories = $assembly->getPropertyValues(new core_kernel_classes_Property(self::PROPERTY_DELIVERY_DIRECTORY));

        foreach ($directories as $directory) {
            $instances = $this->getRootClass()->getInstances(true, array(self::PROPERTY_DELIVERY_DIRECTORY => $directory));
            unset($instances[$assembly->getUri()]);
            if (empty($instances)) {
                $success = $this->getFileStorage()->deleteDirectoryById($directory) ? $success : false;
                $deleted++;
            }
        }
        \common_Logger::i('(' . (int) $deleted. ') deletions for delivery assembly: ' . $assembly->getUri());
        return $success;
    }