Delete() public static méthode

public static Delete ( string path ) : void
path string
Résultat void
Exemple #1
0
        private static async Task DeleteFileCacheAsync(LazyUri url, string cachedir, string extension, bool fileCache)
        {
            if (cachedir == null)
            {
                throw new InvalidOperationException("The cache path is not configured.");
            }
            var path = GetFileSystemName(url, cachedir, extension, false, false);

#if !STANDALONE
            if (fileCache && AzureApi != null)
            {
                await DeleteAzureBlobAsync(url);
            }
            else
#endif
            {
                BlobStore.Delete(path);
                if (path.Contains('\u2194')) // ↔
                {
                    BlobStore.Delete(Path.ChangeExtension(path, ".lng"));
                }

                BlobStore.Delete(Path.ChangeExtension(path, ".err"));
            }
        }
Exemple #2
0
        internal void Release(bool commit = true)
        {
            lock (BlobStore._lock)
            {
                BlobStore.Delete(Path.Combine(directory.path, this.currentFileName));
                if (commit)
                {
                    Commit(true);
                }
                directory.busyPackages.Remove(this);

                if (ms.Length < (directory.packageSize ?? BlobStore.Configuration_PackageSize))
                {
                    directory.availablePackages.Add(this);
                }
                else
                {
                    WriteToFile(false);
                    this.ms = null;
                }
            }
        }