Deletes the bucket and all of its contents.

@return true if all files of the bucket and the bucket itself was deleted successfully, false otherwise.
774099
public boolean delete() {
        boolean deleted = false;
        for (File child : file.listFiles()) {
            deleted = child.delete() || deleted;
        }
        deleted = file.delete() || deleted;
        return deleted;
    }
1051691
@Override
   public synchronized boolean delete()
   {
      if (users != null && users.size() <= 0)
      {
         // make unusable
         users.clear();
         users = null;

         final SpoolFile sf = this;

         PrivilegedAction<Boolean> action = new PrivilegedAction<Boolean>()
         {
            public Boolean run()
            {
               return sf.exists() ? SpoolFile.super.delete() : true;
            }
         };
         return SecurityHelper.doPrivilegedAction(action);

      }

      return false;
   }
1296949
public function flush()
    {

        $files = $this->getFileSystem()->files($this->getFolder());
        foreach($files as $file)
        {
            $this->delete($file);
        }

        return true;
    }
368432
public function deleteAll()
	{
	    if (!$this->namespace) {
	        return $this->clear();
        }

		$namespaceCacheKey = $this->getNamespaceCacheKey();
		$namespaceVersion = $this->getNamespaceVersion() + 1;

		if ($this->doSet($namespaceCacheKey, [true, $namespaceVersion, [], 0])) {
			$this->namespaceVersion = $namespaceVersion;

			return true;
		}

		return false;
	}
1126664
public boolean deleteProfile() {
    String[] profileDirs = {smallPrefsFolder, largePrefsFolder, cachePrefsFolder};

    // Assuming if any of those are main profile, skip the whole delete
    for (String profileDir : profileDirs) {
      if (isMainProfile(profileDir)) {
        logger.finer("Skipping profile deletion since '" + profileDir + "' is the main profile.");
        return false;
      }
    }

    for (String profileDir : profileDirs) {
      File currentDirHandle = new File(profileDir);

      if (!currentDirHandle.exists()) {
        logger.finer("Skipping profile deletion for '" + profileDir + "' since it doesn't exist.");
        continue;
      }

      boolean deleted = deleteFolder(profileDir);
      if (!deleted) {
        final int retryIntervalMs = 500;
        final int retryMaxCount = 10;
        int retryCount = 0;
        boolean ok = false;

        logger.warning("Profile could not be deleted, retrying...");

        do {
          try {
            Thread.sleep(retryIntervalMs);
          } catch (InterruptedException e) {
            // fall through
          }

          ok = deleteFolder(profileDir);
          retryCount++;
          if (retryCount > retryMaxCount) {
            break;
          }

        } while (!ok);

        if (!ok) {
          logger.severe(
              "Could not delete profile in '" + profileDir + "'. Skipping further deletion.");
          return false;
        } else {
          logger.warning("Deleted profile, retry count = " + retryCount);
        }
      } else {
        logger.finer("Deleted profile in '" + profileDir + "'");
      }
    }
    return true;
  }
492957
public function delete()
    {
        if ($this->beforeDelete()) {
            if (!Yii::$app->storage->fileSystemDeleteFile($this->name_new_compound)) {
                Logger::error("Unable to remove file from filesystem: " . $this->name_new_compound);
            }
            
            $this->updateAttributes(['is_deleted' => true]);
            
            $this->afterDelete();
            return true;
        }
    }
164937
public static boolean deleteDirContents(final File dir) {
        if (dir.isDirectory()) {
            final String[] children = dir.list();
            for (final String aChildren : children) {
                final File child = new File(dir, aChildren);
                if (child.isDirectory()) {
                    // Delete the sub directories
                    if (!deleteDir(child)) {
                        return false;
                    }
                } else {
                    // Delete a single file in the directory
                    if (!child.delete()) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
669087
def clean_all_buckets(self):
        
        bucket_keys = self.redis_object.keys(pattern='nearpy_*')
        if len(bucket_keys) > 0:
            self.redis_object.delete(*bucket_keys)
5510
public boolean restoreLastMapFromArchive() {
		boolean success = false;
		List<Map<Object, Object>> object = null;
		if (oldBlockHierarchy.size() > 0) {
			object = oldBlockHierarchy.remove(oldBlockHierarchy.size() - 1);
			if (object != null) {
				working = object;
				success = true;
			}
		}
		return success;
	}
12281
public function clear()
    {
        $list = glob($this->cacheDir . '/*.*');
        if (empty($list)) return true;
        $all_deleted = true;
        foreach ($list as $path) {
            $deleted = unlink($path);
            if (!$deleted) {
                $all_deleted = false;
            }
        }
        return $all_deleted;
    }
215244
public boolean deleteBlob(String bucketName, String blobName) {
    // [START deleteBlob]
    BlobId blobId = BlobId.of(bucketName, blobName);
    boolean deleted = storage.delete(blobId);
    if (deleted) {
      // the blob was deleted
    } else {
      // the blob was not found
    }
    // [END deleteBlob]
    return deleted;
  }
667894
private boolean deleteFile(File fileToDelete) {
        boolean deleted = false;

        try {
            deleted = fileToDelete.delete();

            if (!deleted) {
                Logger.error(LOG_TAG, "Unable to delete: "
                        + fileToDelete.getAbsolutePath());
            } else {
                Logger.info(LOG_TAG, "Successfully deleted: "
                        + fileToDelete.getAbsolutePath());
            }

        } catch (Exception exc) {
            Logger.error(LOG_TAG,
                    "Error while deleting: " + fileToDelete.getAbsolutePath() +
                            " Check if you granted: android.permission.WRITE_EXTERNAL_STORAGE", exc);
        }

        return deleted;
    }
1006227
public function removeAll()
    {
        $this->initializeOnDemand();

        if ($this->configMapper->truncate()) {
            $this->arrayConfig->clear();
            return true;

        } else {
            return false;
        }
    }
377320
public function deleteAll()
    {
        if ($this->isAbsolute()) {
            if ($this->isFile() || $this->isLink()) {
                // delete file and symlink
                return unlink($this->getPathname());
            } elseif ($this->isDir()) {
                // delete directories and its content
                return $this->deleteAction($this->getPathname(), true);
            }
            return false;
        } else {
            throw new FileException('Given file path is not a absolute path.');
        }
    }
69652
@Trivial
    private boolean deleteAll(File rootFile) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) {
            Tr.debug(tc, "Delete [ " + rootFile.getAbsolutePath() + " ]");
        }

        if ( FileUtils.fileIsFile(rootFile) ) {
            boolean didDelete = FileUtils.fileDelete(rootFile);
            if ( !didDelete ) {
                Tr.error(tc, "Could not delete file [ " + rootFile.getAbsolutePath() + " ]");
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) {
                    Tr.debug(tc, "Deleted");
                }
            }
            return didDelete;

        } else {
            boolean didDeleteAll = true;
            int deleteCount = 0;

            File childFiles[] = FileUtils.listFiles(rootFile);
            int childCount;
            if ( childFiles != null ) {
                childCount = childFiles.length;
                for ( File childFile : childFiles ) {
                    // Keep iterating even if one of the deletes fails.
                    // Delete as much as possible.
                    if ( !deleteAll(childFile) ) {
                        didDeleteAll = false;
                    } else {
                        deleteCount++;
                    }
                }
            } else {
                childCount = 0;
                deleteCount = 0;
            }

            if ( didDeleteAll ) {
                didDeleteAll = FileUtils.fileDelete(rootFile);
            }
            if ( !didDeleteAll ) {
                Tr.error(tc, "Could not delete directory [ " + rootFile.getAbsolutePath() + " ]");
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) {
                Tr.debug(tc, "Deleted [ " + Integer.valueOf(deleteCount) + " ]" +
                             " of [ " + Integer.valueOf(childCount) + " ]");
            }

            return didDeleteAll;
        }
    }
1262007
public function Delete ()
	{
		
		// If there is a file and path
		
		if ($this->path && $this->filename)
		{
			
			// Delete file
			
			return self::_Delete ($this->path . $this->filename);
			
		}
		
		// Return TRUE
		
		return TRUE;
		
	}
636073
def delete(self, key=None):
        """"""

        # Delete the whole bucket.
        if key is None:
            # Delete everything in the bucket.
            for key in self.all():
                key.delete()

            # Delete the bucket.
            return self._boto_bucket.delete()

        # If a key was passed, delete they key.
        k = self.key(key)
        return k.delete()