Cleanup all the files already downloaded within the same JVM process. Automatically called internally.
163565
static void cleanup() {
        LOGGER.entering();

        for (String temp : files) {
            new File(temp).delete();
        }

        // Cleaning up the files list
        files.clear();
        LOGGER.exiting();
    }
1269129
def cleanup_files_on_ev3():
    """"""

    list = get_base_ev3dev_cmd() + ['cleanup']

    env = os.environ.copy()
    env["PYTHONUSERBASE"] = THONNY_USER_BASE
    proc = subprocess.Popen(list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                            universal_newlines=True, env=env)
    dlg = MySubprocessDialog(get_workbench(), proc, "Delete files in homedir on EV3", autoclose=False)
    dlg.wait_window()
1252304
def Clean():
  """"""
  # Find all the compiled proto files and unlink them.
  for (root, _, files) in os.walk(ROOT):
    for filename in files:
      full_filename = os.path.join(root, filename)
      if full_filename.endswith("_pb2.py") or full_filename.endswith(
          "_pb2.pyc"):
        os.unlink(full_filename)
1090803
def cleanup(self):
        """"""
        shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1]))
        if os.path.exists(self.name):
            raise IOError(17, "File exists: '{}'".format(self.name))
415867
protected function cleanup(): void
    {
        $this->output->writeln('');
        $this->output->write('Cleaning up... ');
        $this->output->writeln('');
        $this->output->writeln('');

        $projectDir = $this->getContainer()->getParameter('kernel.project_dir');

        try {
            $fileSystem = $this->getContainer()->get('filesystem');

            if (
                $fileSystem->exists($projectDir . '/.git') &&
                $this->questionHelper->ask(
                    $this->input,
                    $this->output,
                    $this->getConfirmationQuestion(
                        'Do you want to delete the <comment>.git</comment> folder?',
                        true
                    )
                )
            ) {
                $fileSystem->remove($projectDir . '/.git');
            }
        } catch (Exception $e) {
            // Do nothing
        }
    }
252671
public function cleanup() {
    $this->say("Removing deprecated files and directories...");
    $this->taskFilesystemStack()
      ->remove([
        "build",
        "docroot/sites/default/settings/apcu_fix.yml",
        "docroot/sites/default/settings/base.settings.php",
        "docroot/sites/default/settings/blt.settings.php",
        "docroot/sites/default/settings/cache.settings.php",
        "docroot/sites/default/settings/filesystem.settings.php",
        "docroot/sites/default/settings/logging.settings.php",
        "docroot/sites/default/settings/travis.settings.php",
        "docroot/sites/default/settings/pipelines.settings.php",
        "docroot/sites/default/settings/tugboat.settings.php",
        "docroot/sites/settings/global.settings.default.php",
        "tests/phpunit/blt",
        "tests/phpunit/Bolt",
        "scripts/blt",
        "scripts/drupal",
        "scripts/drupal-vm",
        "scripts/git-hooks",
        "scripts/release-notes",
        "scripts/tugboat",
        "blt.sh",
        "project.yml",
        "project.local.yml",
        "example.project.local.yml",
        "readme/acsf-setup.md",
        "readme/architecture.md",
        "readme/best-practices.md",
        "readme/deploy.md",
        "readme/dev-workflow.md",
        "readme/features-workflow.md",
        "readme/local-development.md",
        "readme/onboarding.md",
        "readme/project-tasks.md",
        "readme/release-process.md",
        "readme/repo-architecture.md",
        "readme/views.md",
        "drush/policy.drush.inc",
      ])
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->run();
  }
786055
private function cleanup()
	{
		foreach ($this->installationMap as $path => $packages) {
			if ($path == '__CHECKSUMS__') {
				continue;
			}

			if (count($packages)) {
				sort($this->installationMap[$path]);
				continue;
			}

			$installation_path = ltrim($path, '/\\' . DIRECTORY_SEPARATOR);
			$installation_path = getcwd() . DIRECTORY_SEPARATOR . $installation_path;

			if (is_dir($installation_path)) {

				//
				// Here's what to do with a directory
				//

				$children = array_merge(
					glob($installation_path . DIRECTORY_SEPARATOR . '/*'),
					glob($installation_path . DIRECTORY_SEPARATOR . '/.*')
				);

				//
				// Children should be at least two (one entry for current dir and another)
				// for parent dir.  Our install map is sorted by the length of the path
				// so we should only be trying to remove directories which have already had
				// other opus related/created children removed.
				//

				if (count($children) > 2) {
					continue;
				}

				if (!@rmdir($installation_path)) {
					switch ($this->integrity) {
						case 'low':
							break;

						case 'medium':
							$this->io->write(sprintf(
								self::TAB . 'Warning: unable to remove empty directory %s',
								$path
							));
							break;

						case 'high':
							throw new \Exception(sprintf(
								'Error removing empty directory %s',
								$path
							));
					}
				}

			} else {

				//
				// Here's what to do with a file
				//

				if (!@unlink($installation_path)) {
					switch ($this->integrity) {
						case 'low':
							break;

						case 'medium':
							$this->io->write(sprintf(
								self::TAB . 'Warning: unable to remove unused file %s; remove manually',
								$path
							));
							break;

						case 'high':
							throw new \Exception(sprintf(
								'Error removing unused file %s, restore file or check permissions and try again',
								$path
							));
					}
				}
			}

			unset($this->installationMap[$path]);
			unset($this->installationMap['__CHECKSUMS__'][$path]);
		}

		//
		// Sort our paths by length
		//

		uksort($this->installationMap, function($a, $b) {
			if (strlen($a) == strlen($b)) {
				return 0;
			}

			if (strlen($a) > strlen($b)) {
				return -1;
			}

			return 1;
		});
	}
261390
public synchronized void cleanup() {
        for (Enumeration e = jarFiles.elements(); e.hasMoreElements();) {
            JarFile jarFile = (JarFile) e.nextElement();
            try {
                jarFile.close();
            } catch (IOException ioe) {
                // ignore
            }
        }
        jarFiles = new Hashtable();
        if (project != null) {
            project.removeBuildListener(this);
        }
        project = null;
    }
968410
@Transactional(readOnly = true)
  public void cleanupData()
  {

    List<String> allFilesInDatabaseList = getJdbcTemplate().queryForList(
      "SELECT filename FROM media_files AS m", String.class);

    File dataDir = getRealDataDir();

    Set<File> allFilesInDatabase = new HashSet<>();
    for (String singleFileName : allFilesInDatabaseList)
    {
      allFilesInDatabase.add(new File(dataDir, singleFileName));
    }

    log.info("Cleaning up the data directory");
    // go through each file of the folder and check if it is not included
    File[] childFiles = dataDir.listFiles();
    if (childFiles != null)
    {
      for (File f : childFiles)
      {
        if (f.isFile() && !allFilesInDatabase.contains(f))
        {
          if (!f.delete())
          {
            log.warn("Could not delete {}", f.getAbsolutePath());
          }
        }
      }
    }
  }
360618
def cleanup():
        """"""
        for install_dir in linters.INSTALL_DIRS:
            try:
                shutil.rmtree(install_dir, ignore_errors=True)
            except Exception:
                print(
                    "{0}\nFailed to delete {1}".format(
                        traceback.format_exc(), install_dir
                    )
                )
                sys.stdout.flush()
443861
protected function cleanup()
    {
        $this->filesystem->remove($this->tmpFolder);
        $this->root = null;
        $this->urlsets = array();
    }
1305758
public void cleanup() {
    htDictionary.clear();
    memoryEstimate.decrementTotalMemory(byteArray.getSizeInBytes());
    memoryEstimate.decrementTotalMemory(getSizeOfIntArrays());
    memoryEstimate.decrementDictionaryMemory(byteArray.size());
  }
719177
private void cleanupDirectories() throws IOException {
		ShutdownHookUtil.removeShutdownHook(shutDownHook, getClass().getSimpleName(), LOG);

		final String webTmpDir = configuration.getString(WebOptions.TMP_DIR);

		FileUtils.deleteDirectory(new File(webTmpDir));
	}
592042
protected function cleanup()
    {
        // if $this->fs is an object, the Filesystem has been used, clean it up.
        if (is_object($this->fs)) {
            if ($this->fs->isDirectory($this->tempPath)) {
                $this->fs->deleteDirectory($this->tempPath, false);
            }
        }
    }
1301652
static function cleanupGeneratingFiles()
    {
        if ( count( self::$generatingFiles ) === 0 )
        {
            return false;
        }
        else
        {
            eZDebug::writeWarning( "Execution was stopped while one or more files were generating. This should not happen.", __METHOD__ );
            foreach( self::$generatingFiles as $generatingFile )
            {
                $generatingFile->abortCacheGeneration();
                self::removeGeneratingFile( $generatingFile );
            }
            return true;
        }
    }
347237
protected function cleanupOldChunks()
    {
        if ($this->useChunks === false) {
            // We have no write access. Do nothing.
            return;
        }

        static $beenHere = false;

        // We only do this once.
        if ($beenHere === true) {
            return;
        }

        $beenHere = true;
        // Clean up leftover files.
        $chunkList = glob($this->chunkDir . '*.Krexx.tmp');
        if (empty($chunkList) === false) {
            $now = time();
            foreach ($chunkList as $file) {
                // We delete everything that is older than 15 minutes.
                if (($this->pool->fileService->filetime($file) + 900) < $now) {
                    $this->pool->fileService->deleteFile($file);
                }
            }
        }
    }
182661
def _cleanup(path: str) -> None:
    """"""
    if os.path.isdir(path):
        shutil.rmtree(path)