Note: for delete operation we don't need to know if it's from legacy file transfer (V2) or not, because gzip is not involved here
325276
public void deleteInternal(String filePath, boolean recursive) {
        //Process and validate path
        final String processedPath = processAndValidateFilePath(filePath, false);

        boolean deleted;
        if (recursive) {
            File fileToDelete = new File(processedPath);
            if (FileUtils.fileIsDirectory(fileToDelete)) {
                recursiveDelete(fileToDelete);
            } else {
                FileUtils.fileDelete(fileToDelete);
            }
            deleted = FileUtils.fileExists(fileToDelete) == false;
        } else {
            deleted = deleteLocalFile(processedPath);
        }

        if (!deleted) {
            IOException ioe = new IOException(TraceNLS.getFormattedMessage(this.getClass(),
                                                                           APIConstants.TRACE_BUNDLE_FILE_TRANSFER,
                                                                           "DELETE_REQUEST_ERROR",
                                                                           null,
                                                                           "CWWKX0126E: Delete request for file " + processedPath + " could not be completed."));
            throw ErrorHelper.createRESTHandlerJsonException(ioe, null, APIConstants.STATUS_BAD_REQUEST);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isInfoEnabled()) {
            Tr.info(tc, "DELETE_REQUEST_COMPLETE_INFO", processedPath);
        }
    }
705498
def delete_attachments(self, volumeID, attachmentsID):
        '''  '''
        log.debug("deleting attachments from volume '{}': {}".format(volumeID, attachmentsID))
        rawVolume = self._req_raw_volume(volumeID)
        insID = [a['id'] for a in rawVolume['_source']['_attachments']]
        # check that all requested file are present
        for id in attachmentsID:
            if id not in insID:
                raise NotFoundException("could not found attachment '{}' of the volume '{}'".format(id, volumeID))
        for index, id in enumerate(attachmentsID):
            rawVolume['_source']['_attachments'].pop(insID.index(id))
        self._db.modify_book(volumeID, rawVolume['_source'], version=rawVolume['_version'])
231347
def delete_files():
    

    session_token = request.headers['session_token']
    repository    = request.headers['repository']

    #===
    current_user = have_authenticated_user(request.environ['REMOTE_ADDR'], repository, session_token)
    if current_user is False: return fail(user_auth_fail_msg)

    #===
    repository_path = config['repositories'][repository]['path']
    body_data = request.get_json()

    def with_exclusive_lock():
        if not varify_user_lock(repository_path, session_token): return fail(lock_fail_msg)

        try:
            data_store = versioned_storage(repository_path)
            if not data_store.have_active_commit(): return fail(no_active_commit_msg)

            #-------------
            for fle in json.loads(body_data['files']):
                data_store.fs_delete(fle)

            # updates the user lock expiry
            update_user_lock(repository_path, session_token)
            return success()
        except Exception: return fail() # pylint: disable=broad-except
    return lock_access(repository_path, with_exclusive_lock)
1100382
def _removeLru(self):
        
        (dataFile, handle) = self._cache.pop()
        handle.close()
        return dataFile
1007074
public static backup_file delete(nitro_service client, backup_file resource) throws Exception
	{
		resource.validate("delete");
		return ((backup_file[]) resource.delete_resource(client))[0];
	}
725083
def unzip_file_if_necessary(self, source_file):
        
        if source_file.endswith(".gz"):
            self.print_message("Decompressing '%s'" % source_file)
            subprocess.check_call(["gunzip", "--force", source_file])
            source_file = source_file[:-len(".gz")]
        return source_file
147124
def delete(filething):
    

    t = OggTheora(filething)
    filething.fileobj.seek(0)
    t.delete(filething)
610757
def delete_file(self, path, prefixed_path, source_storage):
        
        if isinstance(self.storage, CumulusStorage):
            if self.storage.exists(prefixed_path):
                try:
                    etag = self.storage._get_object(prefixed_path).etag
                    digest = "{0}".format(hashlib.md5(source_storage.open(path).read()).hexdigest())
                    if etag == digest:
                        self.log(u"Skipping '{0}' (not modified based on file hash)".format(path))
                        return False
                except:
                    raise
        return super(Command, self).delete_file(path, prefixed_path, source_storage)
503282
def delete_volume(target, stop=True):
    '''
    
    '''
    volinfo = info()
    if target not in volinfo:
        log.error('Cannot delete non-existing volume %s', target)
        return False

    # Stop volume if requested to and it is running
    running = (volinfo[target]['status'] == '1')

    if not stop and running:
        # Fail if volume is running if stop is not requested
        log.error('Volume %s must be stopped before deletion', target)
        return False

    if running:
        if not stop_volume(target, force=True):
            return False

    cmd = 'volume delete {0}'.format(target)
    return _gluster(cmd)
1046166
def versionable_delete(self, instance, timestamp):
        
        instance._delete_at(timestamp, using=self.using)
98885
def remove_expired_multipartobjects():
    """"""
    delta = current_app.config['FILES_REST_MULTIPART_EXPIRES']
    expired_dt = datetime.utcnow() - delta

    file_ids = []
    for mp in MultipartObject.query_expired(expired_dt):
        file_ids.append(str(mp.file_id))
        mp.delete()

    for fid in file_ids:
        remove_file_data.delay(fid)
680291
def delete(expnum, ccd, version, ext, prefix=None):
    
    uri = get_uri(expnum, ccd=ccd, version=version, ext=ext, prefix=prefix)
    remove(uri)
1149214
def fast_sync_snapshot_decompress( snapshot_path, output_dir ):
    
    if not tarfile.is_tarfile(snapshot_path):
        return {'error': 'Not a tarfile-compatible archive: {}'.format(snapshot_path)}

    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    with tarfile.TarFile.bz2open(snapshot_path, 'r') as f:
        tarfile.TarFile.extractall(f, path=output_dir)

    return {'status': True}
987617
def _pre_md5_skip_on_check(self, lpath, rfile):
        # type: (Downloader, pathlib.Path,
        #        blobxfer.models.azure.StorageEntity) -> None
        
        md5 = blobxfer.models.metadata.get_md5_from_metadata(rfile)
        key = blobxfer.operations.download.Downloader.\
            create_unique_transfer_operation_id(rfile)
        with self._md5_meta_lock:
            self._md5_map[key] = rfile
        slpath = str(lpath)
        # temporarily create a download descriptor view for vectored io
        if rfile.vectored_io is not None:
            view, _ = blobxfer.models.download.Descriptor.generate_view(rfile)
            fpath = str(
                blobxfer.models.download.Descriptor.
                convert_vectored_io_slice_to_final_path_name(lpath, rfile)
            )
        else:
            view = None
            fpath = slpath
        self._md5_offload.add_localfile_for_md5_check(
            key, slpath, fpath, md5, rfile.mode, view)
554904
def delete(filething):
    

    t = OggOpus(filething)
    filething.fileobj.seek(0)
    t.delete(filething)
443587
public function deleteOutdated(): bool
    {
        //TODO: check the need to call
        clearstatcache();
        
        $dh = @opendir($this->cacheDir);
        if (false === $dh) {
            return false;
        }
        
        while (false !== ($entry = readdir($dh))) {
            $filePath = $this->cacheDir . '/' . $entry;
            
            //exclude '.', '..', '.htaccess'
            if (!is_file($filePath) || 0 === strpos($entry, '.')) {
                continue;
            }
            
            try {
                $packet = $this->getPacketFromFile($filePath);
                if ($packet->outdated()) {
                    unlink($filePath);
                }
            } catch (BadPacketException $e) {
                unlink($filePath);
            }
        }
        
        closedir($dh);
        
        return true;
    }
543447
def delete(filething):
    

    t = OggVorbis(filething)
    filething.fileobj.seek(0)
    t.delete(filething)