Deletes a temporary file from the OpenCms VFS, needed when exiting an editor.<p>
359540
protected void deleteTempFile() {

        try {
            // switch to the temporary file project
            switchToTempProject();
            // delete the temporary file
            getCms().deleteResource(getParamTempfile(), CmsResource.DELETE_PRESERVE_SIBLINGS);
        } catch (CmsException e) {
            // should usually never happen
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
        } finally {
            try {
                // switch back to the current project
                switchToCurrentProject();
            } catch (CmsException e) {
                // should usually never happen
                if (LOG.isInfoEnabled()) {
                    LOG.info(e);
                }
            }
        }
    }
1232576
def destroy_temp(filename = nil)
      if filename.nil?
        @temp_files.each { |filename, file| file.unlink }
        @temp_files = {}
      else
        return if @temp_files[filename.to_sym].blank?
        @temp_files[filename.to_sym].unlink
        @temp_files.delete(filename.to_sym)
      end
    end
958758
public void deleteTmpFile(String name, JobID jobID) {
		DeleteProcess dp = new DeleteProcess(name, jobID, count.get(new ImmutablePair(jobID,name)));
		executorService.schedule(dp, 5000L, TimeUnit.MILLISECONDS);
	}
927959
protected static void removeInternalFiles(List<CmsResource> resources) {

        Iterator<CmsResource> iter = resources.iterator();
        while (iter.hasNext()) {
            CmsResource resource = iter.next();
            if (resource.isInternal()) {
                iter.remove();
            }
        }
    }
1183637
protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException {

        OpenCms.getMemoryMonitor().uncachePublishJobInHistory(publishJob);
        // delete job from db if necessary
        if (OpenCms.getMemoryMonitor().requiresPersistency()) {
            CmsDbContext dbc = m_publishEngine.getDbContext(null);
            try {
                OpenCms.getPublishManager().getEngine().getDriverManager().deletePublishJob(
                    dbc,
                    publishJob.getPublishHistoryId());
            } catch (CmsException e) {
                dbc.rollback();
                LOG.error(e.getLocalizedMessage(), e);
                throw e;
            } finally {
                dbc.clear();
            }
        }

        m_publishEngine.publishJobRemoved(publishJob);
    }
942708
protected void scrubResource(
        CmsObject cms,
        CmsPublishedResource res,
        Set<String> scrubbedFolders,
        Set<String> scrubbedFiles) {

        long timer = System.currentTimeMillis();
        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_SCRUB_EXPORT_START_RESOURCE_1, res.getRootPath()));
        }
        try {
            // ensure all siblings are scrubbed if the resource has one
            String resPath = cms.getRequestContext().removeSiteRoot(res.getRootPath());
            List<String> siblings = getSiblingsList(cms, resPath);

            for (String vfsName : siblings) {

                // get the link name for the published file
                String rfsName = OpenCms.getStaticExportManager().getRfsName(cms, vfsName);
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_CHECKING_STATIC_EXPORT_2, vfsName, rfsName));
                }
                if (rfsName.startsWith(OpenCms.getStaticExportManager().getRfsPrefix(vfsName))
                    && (!scrubbedFiles.contains(rfsName))
                    && (!scrubbedFolders.contains(CmsResource.getFolderPath(rfsName)))) {

                    if (res.isFolder()) {
                        if (res.getState().isDeleted()) {
                            String exportFolderName = CmsFileUtil.normalizePath(
                                OpenCms.getStaticExportManager().getExportPath(vfsName)
                                    + rfsName.substring(
                                        OpenCms.getStaticExportManager().getRfsPrefix(vfsName).length()));
                            try {
                                File exportFolder = new File(exportFolderName);
                                // check if export folder exists, if so delete it
                                if (exportFolder.exists() && exportFolder.canWrite()) {
                                    CmsFileUtil.purgeDirectory(exportFolder);
                                    // write log message
                                    if (LOG.isInfoEnabled()) {
                                        LOG.info(
                                            Messages.get().getBundle().key(
                                                Messages.LOG_FOLDER_DELETED_1,
                                                exportFolderName));
                                    }
                                    scrubbedFolders.add(rfsName);
                                    continue;
                                }
                            } catch (Throwable t) {
                                // ignore, nothing to do about this
                                if (LOG.isWarnEnabled()) {
                                    LOG.warn(
                                        Messages.get().getBundle().key(
                                            Messages.LOG_FOLDER_DELETION_FAILED_2,
                                            vfsName,
                                            exportFolderName));
                                }
                            }
                        }
                    } else {
                        // check if the file is the default file of the folder
                        try {
                            CmsResource defaultFile = cms.readDefaultFile(CmsResource.getFolderPath(vfsName));
                            if (defaultFile != null) {
                                String defaultfilePath = cms.getRequestContext().removeSiteRoot(
                                    defaultFile.getRootPath());
                                if (vfsName.equals(defaultfilePath)) {
                                    // this is the default file, remove it additionally if present
                                    String rfsNameDefault = CmsResource.getFolderPath(rfsName)
                                        + CmsStaticExportManager.EXPORT_DEFAULT_FILE;
                                    String rfsExportFileName = CmsFileUtil.normalizePath(
                                        OpenCms.getStaticExportManager().getExportPath(vfsName)
                                            + rfsNameDefault.substring(
                                                OpenCms.getStaticExportManager().getRfsPrefix(vfsName).length()));

                                    purgeFile(rfsExportFileName, vfsName);
                                }
                            }
                        } catch (CmsException e) {
                            // failed to determine default file
                        }
                    }

                    // add index_export.html or the index.html to the folder name
                    rfsName = OpenCms.getStaticExportManager().addDefaultFileNameToFolder(rfsName, res.isFolder());
                    if (LOG.isDebugEnabled()) {
                        LOG.debug(Messages.get().getBundle().key(Messages.LOG_RFSNAME_1, rfsName));
                    }
                    String rfsExportFileName = CmsFileUtil.normalizePath(
                        OpenCms.getStaticExportManager().getExportPath(vfsName)
                            + rfsName.substring(OpenCms.getStaticExportManager().getRfsPrefix(vfsName).length()));
                    if (LOG.isDebugEnabled()) {
                        LOG.debug(Messages.get().getBundle().key(Messages.LOG_EXPORT_RFSNAME_1, rfsName));
                    }
                    // purge related files
                    List<File> relFilesToPurge = getRelatedFilesToPurge(rfsExportFileName, vfsName);
                    purgeFiles(relFilesToPurge, vfsName, scrubbedFiles);

                    if (!res.isFolder()) {
                        I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(res.getType());
                        I_CmsResourceLoader resLoader = OpenCms.getResourceManager().getLoader(resType.getLoaderId());
                        if ((resLoader instanceof CmsXmlContentLoader)
                            && !(resLoader instanceof CmsXmlContainerPageLoader)) {

                            // only execute for XML content that are no container pages
                            List<File> detailPageFiles = getDetailPageFiles(cms, res, vfsName);
                            purgeFiles(detailPageFiles, vfsName, scrubbedFiles);
                            if (LOG.isDebugEnabled()) {
                                LOG.debug(Messages.get().getBundle().key(Messages.LOG_PURGED_DETAILPAGES_0));
                            }
                            List<File> referencingContainerPages = getContainerPagesToPurge(cms, res.getStructureId());
                            purgeFiles(referencingContainerPages, vfsName, scrubbedFiles);
                            if (LOG.isDebugEnabled()) {
                                LOG.debug(Messages.get().getBundle().key(Messages.LOG_PURGED_CONTAINERPAGES_0));
                            }
                        }
                    }
                    // purge the file itself
                    purgeFile(rfsExportFileName, vfsName);
                    scrubbedFiles.add(rfsName);
                }
            }
        } catch (Throwable e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug(
                Messages.get().getBundle().key(
                    Messages.LOG_SCRUB_EXPORT_FINISH_RESOURCE_2,
                    res.getRootPath(),
                    (System.currentTimeMillis() - timer) + ""));
        }
    }
203071
private void cleanupProject() {

        m_requiresCleanup = false;
        try {
            CmsObject cms = OpenCms.initCmsObject(m_adminCms);
            cms.readProject(getProject().getUuid());
        } catch (CmsException e) {
            return;
        }
        try {
            CmsObject cms = OpenCms.initCmsObject(m_adminCms);
            cms.getRequestContext().setCurrentProject(getProject());
            CmsUUID projectId = getProject().getUuid();
            List<CmsResource> projectResources = cms.readProjectView(projectId, CmsResource.STATE_KEEP);
            if (hasOnlyNewResources(projectResources)) {
                for (CmsResource res : projectResources) {
                    LOG.info("Deleting resource for timed out form session: " + res.getRootPath());
                    deleteResourceFromProject(cms, res);
                }
                LOG.info(
                    "Deleting project for timed out form session: "
                        + getProject().getName()
                        + " ["
                        + getProject().getUuid()
                        + "]");
                cms.deleteProject(projectId);

            }
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
298782
public void delete() {
    try {
      close();
      Files.delete(file.toPath());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
424126
function onDelete( error ) {
			if ( error ) {
				debug( 'Error encountered while attempting to delete a temporary output file %s: %s', outFile, error.message );
				return done( error );
			}
			debug( 'Successfully deleted temporary output file: %s', outFile );
			done( null, file );
		}
811966
public void remove(CmsResource res) {

        remove(res.getStructureId(), res.getRootPath(), res.getTypeId());
    }
609180
@Override
	public void close() throws IOException {
		if (this.in != null) {
			this.in.close();
		}
		if (!this.tempFile.delete()) {
			LOG.warn("Cannot delete tempFile: " + this.tempFile.getAbsolutePath());
			throw new IOException("Cannot delete tempFile: " + this.tempFile.getAbsolutePath());
		}
		;
	}
1096396
protected void removeEditOverlays() {

        CmsInlineEditOverlay.removeAll();
        m_editOverlay = null;
        if (m_resizeHandlerRegistration != null) {
            m_resizeHandlerRegistration.removeHandler();
            m_resizeHandlerRegistration = null;
        }
    }
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
1312257
public static void removeLastOverlay() {

        if (!m_overlays.isEmpty()) {
            CmsInlineEditOverlay last = m_overlays.remove(m_overlays.size() - 1);
            last.removeFromParent();
        }
        if (!m_overlays.isEmpty()) {
            m_overlays.get(m_overlays.size() - 1).setVisible(true);
        }
    }
303767
protected void deleteTempDirectory (final File tempDirectory)
  {
    try
    {
      FileUtils.deleteDirectory (tempDirectory);
    }
    catch (final IOException e)
    {
      getLog ().warn ("Failed to delete temporary directory: " + tempDirectory, e);
    }
  }
1133287
public function deleteTempFiles()
    {
        foreach ($this->_tempFiles as $tmp) {
            if (is_dir($tmp)) {
                FileHelper::removeDirectory($tmp);
            } else {
                @unlink($tmp);
            }
        }

        return true;
    }
242915
public void cleanup() {
        if (file != null && file.exists() && !file.delete()) {
            LOGGER.debug("Failed to delete first temporary file {}", file.toString());
            file.deleteOnExit();
        }
    }