Beispiel #1
0
        /// <inheritdoc />
        /// <exception cref="InvalidNameException">Throws if name is invalid.</exception>
        /// <exception cref="EntryNotFoundException">If there is no entry with such name.</exception>
        public bool IsDirectory(string name)
        {
            _transactionWrapper.BeginTransaction();

            var result = _storageOperationLocker.LockEntry(name, () =>
            {
                if (!NameValid(name))
                {
                    throw new InvalidNameException(name);
                }

                if (!ExistsInternal(name))
                {
                    throw new EntryNotFoundException(name);
                }

                return(_directoryRepository.Exists(name));
            });

            _transactionWrapper.EndTransaction();

            return(result);
        }