Deletes media url (with possible linked files)
488172
public function deletemedia()
    {
        $soxId = $this->getEditObjectId();
        $sMediaId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("mediaid");
        if ($sMediaId && $soxId) {
            $oMediaUrl = oxNew(\OxidEsales\Eshop\Application\Model\MediaUrl::class);
            $oMediaUrl->load($sMediaId);
            $oMediaUrl->delete();
        }
    }
281518
public function deleteContent()
  {
    $files = glob($this->folderPath . '*');
    foreach ($files as $file) {
      if (is_file($file)) {
        unlink($file);
      }
    }
  }
593582
def delete(self):
        
        key = 'https://plex.tv/devices/%s.xml' % self.id
        self._server.query(key, self._server._session.delete)
353324
public function delete() {
        if ($this->_oldFile != $this->path . $this->name) {
            unlink($this->_oldFile);
        }

        unlink($this->path . $this->name);
    }
846575
def delete_files(self, selections) -> None:
        """"""
        try:
            currentpath = self.currentpath
            for selection in selections:
                name = str(selection)
                if name == 'complete':
                    continue
                if not name.endswith('.py'):
                    name += '.py'
                path = os.path.join(currentpath, name)
                os.remove(path)
        except BaseException:
            objecttools.augment_excmessage(
                f'While trying to remove the network files of '
                f'selections `{selections}`')
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());
          }
        }
      }
    }
  }
1339242
def delete(url, options = {})
      connection(url, options) do |uri, conn|
        conn.delete(uri.request_uri, options)
      end
    end
918587
public function clear()
    {
        if (null !== $this->aSource) {
            $this->aSource->removeMedia($this);
        }
        $this->id = null;
        $this->source_id = null;
        $this->pageid = null;
        $this->title = null;
        $this->url = null;
        $this->mime = null;
        $this->width = null;
        $this->height = null;
        $this->size = null;
        $this->sha1 = null;
        $this->thumburl = null;
        $this->thumbmime = null;
        $this->thumbwidth = null;
        $this->thumbheight = null;
        $this->thumbsize = null;
        $this->descriptionurl = null;
        $this->descriptionurlshort = null;
        $this->imagedescription = null;
        $this->datetimeoriginal = null;
        $this->artist = null;
        $this->licenseshortname = null;
        $this->usageterms = null;
        $this->attributionrequired = null;
        $this->restrictions = null;
        $this->timestamp = null;
        $this->user = null;
        $this->userid = null;
        $this->missing = null;
        $this->known = null;
        $this->imagerepository = null;
        $this->created_at = null;
        $this->updated_at = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
497246
def safe_delete(filename):
  """"""
  try:
    os.unlink(filename)
  except OSError as e:
    if e.errno != errno.ENOENT:
      raise
1189616
public function deleteImageFile()
    {
        if ($this->hasCategory('photo') || $this->hasCategory('thetas')) {
            // Get thumbnail path
            $path = __DIR__."/../../../web/media/cache/thumbnail"
                    .$this->getImage();

            // Delete file if exists
            if (is_file($path)) {
                unlink($path);
            }
        }
    }
920842
protected function deleteTmpDir() {
		// Cleanup temporary directory, if any
		if ( ! empty( $this->tmpDir ) ) {
			\Pressbooks\Utility\rmrdir( $this->tmpDir );
		}
		// Cleanup deprecated junk, if any
		$exports_folder = untrailingslashit( pathinfo( $this->outputPath, PATHINFO_DIRNAME ) );
		if ( ! empty( $exports_folder ) ) {
			\Pressbooks\Utility\rmrdir( "{$exports_folder}/META-INF" );
			\Pressbooks\Utility\rmrdir( "{$exports_folder}/media" );
		}
	}
1025095
private function actionDelete()
    {
        $baseName = substr($this->path, 0, strrpos($this->path, '.'));
        $files = glob($baseName . '.*');
        if (!is_array($files))
        {
            $files = array();
        }
        $files2 = glob($baseName . '-*');
        if (!is_array($files2))
        {
            $files2 = array();
        }

        $files = array_merge($files, $files2);

        foreach ($files as $file)
        {
            @unlink($file);
        }
    }
229773
def remove_if_exists(filename):
    
    try:
        os.unlink(filename)
    except OSError as ex:
        if ex.errno != errno.ENOENT:
            raise
913686
def remove_media(files):
    
    for filename in files:
        os.remove(os.path.join(settings.MEDIA_ROOT, filename))
932557
def clear(self, encoding=Constants.default_codec):
        

        if foundations.strings.is_website(self.__path):
            raise foundations.exceptions.UrlWriteError(
                "!> {0} | '{1}' url is not writable!".format(self.__class__.__name__, self.__path))

        if self.uncache():
            LOGGER.debug("> Clearing '{0}' file content.".format(self.__path))
            return self.write(encoding=encoding)
        else:
            return False
1268973
def delete!(creds = {}, section = "file", reason = "because")
      BlipTV::ApiSpec.check_attributes('videos.delete', creds)
      
      reason = reason.gsub(" ", "%20") # TODO write a method to handle this and other illegalities of URL
      
      if creds[:username] && !creds[:userlogin]
        creds[:userlogin] = creds[:username]
      end
      
      url, path = "www.blip.tv", "/?userlogin=#{creds[:userlogin]}&password=#{creds[:password]}&cmd=delete&s=file&id=#{@id}&reason=#{reason}&skin=api"
      request = Net::HTTP.get(url, path)
      hash = Hash.from_xml(request)
      make_sure_video_was_deleted(hash)
    end
339255
def delete_video_source(id, factory_id, opts = {})
      data, _status_code, _headers = delete_video_source_with_http_info(id, factory_id, opts)
      return data
    end