Close and delete the journal file
967173
public void closeAndDelete() throws JournalException
    {
    	close();
    	if (!file.delete())
    	    if (file.exists())
    	        throw new JournalException("Cannot delete journal file : "+file.getAbsolutePath());
    }
1012024
def close(self):
        """"""
        for tif in self._files.values():
            tif.filehandle.close()
        self._files = {}
907947
def close(self):
        """"""

        self._close_proc()
        super(PipeReader, self).close()

        if self._tempfile:
            try:
                os.unlink(self._tempfile)
            except OSError:
                pass
            self._tempfile = None
1200791
@Override
    public void shutdown() throws JournalException {
        try {
            if (fileHasHeader) {
                super.writeDocumentTrailer(writer);
            }
            writer.close();
            out.close();
        } catch (XMLStreamException e) {
            throw new JournalException(e);
        } catch (IOException e) {
            throw new JournalException(e);
        }
    }
10708
@Override
    public synchronized void shutdown() {
        try {
            if (open) {
                open = false;
                writer.close();
            }
        } catch (IOException e) {
            logger.error("Error shutting down journal log", e);
        }
    }
1063196
@Override
    public void closeFile() throws JournalException {
        try {
            super.testStateChange(State.FILE_CLOSED);
            parent.writeDocumentTrailer(xmlWriter);
            xmlWriter.close();

            /*
             * SOME implementations of XMLWriter do not close all resources, so
             * we need to close the rmi manually just in case.
             */
            try {
                writer.close();
            } catch (IOException e) {
                throw new JournalException(e);
            }
            super.setState(State.FILE_CLOSED);
        } catch (XMLStreamException e) {
            throw new JournalException(e);
        }
    }
880307
def close(self):
        
        if self.file:
            self.file.close()
            self.file = None

        # If temp_file is a folder, we do not remove it because we may
        # still need it after the unpickler is disposed
        if self.tmp_file and _os.path.isfile(self.tmp_file):
            _os.remove(self.tmp_file)
            self.tmp_file = None
427797
private void closeFile() throws JournalException {
        synchronized (JournalWriter.SYNCHRONIZER) {
            // check to be sure that another thread didn't close the file while
            // we were waiting for the lock.
            if (state == FILE_OPEN) {
                sendRequestToAllTransports(new CloseFileRequest());
                currentSize = 0;
                state = FILE_CLOSED;
            }

            // turn off the timer that is checking the age of this file.
            if (timer != null) {
                timer.cancel();
            }
        }
    }
472268
def close(self):
        ''''''
        if self._log_temp_file:
            self._log_handler.flush()

            logger = logging.getLogger()
            logger.removeHandler(self._log_handler)
            self._log_handler.stream.close()

            log_record = WARCRecord()
            log_record.block_file = gzip.GzipFile(
                filename=self._log_temp_file.name
            )
            log_record.set_common_fields('resource', 'text/plain')

            log_record.fields['WARC-Target-URI'] = \
                'urn:X-wpull:log'

            if self._params.max_size is not None:
                if self._params.move_to is not None:
                    self._move_file_to_dest_dir(self._warc_filename)

                self._start_new_warc_file(meta=True)

            self.set_length_and_maybe_checksums(log_record)
            self.write_record(log_record)

            log_record.block_file.close()

            try:
                os.remove(self._log_temp_file.name)
            except OSError:
                _logger.exception('Could not close log temp file.')

            self._log_temp_file = None

            self._log_handler.close()
            self._log_handler = None

            if self._params.move_to is not None:
                self._move_file_to_dest_dir(self._warc_filename)

        if self._cdx_filename and self._params.move_to is not None:
            self._move_file_to_dest_dir(self._cdx_filename)
911627
def close(self):
        
        if callable(getattr(self._file, 'close', None)):
            self._iterator.close()
        self._iterator = None
        self._unconsumed = None
        self.closed = True
835254
def _Close(self):
    """"""
    self._tsk_attribute = None
    self._tsk_file = None

    self._file_system.Close()
    self._file_system = None
999853
@Override
	public void close()
    {
    	// Close journal first
    	try
    	{
    		commitChanges();
    		journal.close();
    	}
    	catch (DataStoreException e)
    	{
    		log.error("["+descriptor.getName()+"] Could not properly close store journal",e);
    	}
    	
    	super.close();
    }
1171317
public synchronized void truncate() throws OpenJournalException, IOException {
        if (!opened) {
            for (DataFile file : dataFiles.values()) {
                removeDataFile(file);
            }
        } else {
            throw new OpenJournalException("The journal is open! The journal must be closed to be truncated.");
        }
    }
1684
def delete(self):
        """"""
        if self.isfile:
            os.remove(self.fn)
        elif self.isdir:
            shutil.rmtree(self.fn)
939010
def Close(self):
    
    if self._connection:
      self._cursor = None
      self._connection.close()
      self._connection = None

    # TODO: move this to a central temp file manager and have it track errors.
    # https://github.com/log2timeline/dfvfs/issues/92
    try:
      os.remove(self._temp_file_path)
    except (IOError, OSError):
      pass

    self._temp_file_path = ''
1193282
def close(self):
        ''''''
        if self._save_filename:
            self._cookie_jar.save(
                self._save_filename,
                ignore_discard=self._keep_session_cookies
            )
26878
def delete_file(self, filename):
        """"""
        log.info("deleting %s", filename)
        if not self.dry_run:
            os.unlink(filename)