org.mule.runtime.core.api.util.FileUtils.cleanDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.mule.runtime.core.api.util.FileUtils.cleanDirectory()方法的一些代码示例,展示了FileUtils.cleanDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.cleanDirectory()方法的具体详情如下:
包路径:org.mule.runtime.core.api.util.FileUtils
类名称:FileUtils
方法名:cleanDirectory

FileUtils.cleanDirectory介绍

[英]Cleans a directory without deleting it.
[中]清除目录而不删除它。

代码示例

代码示例来源:origin: mulesoft/mule

/**
 * {@inheritDoc}
 */
@Override
public void stop() throws MuleException {
 if (toolingServiceAppsFolder != null) {
  try {
   cleanDirectory(toolingServiceAppsFolder);
  } catch (Exception e) {
   logger.warn("Couldn't clean up tooling service resources folder located at: " + toolingServiceAppsFolder);
  }
 }
}

代码示例来源:origin: mulesoft/mule

/**
 * Creates a folder for this service to upload tooling applications.
 *
 * @return {@link File} working folder.
 * @throws InitialisationException if there was an error while creating the folder.
 */
private File createToolingServiceAppsFolder() throws InitialisationException {
 File toolingServiceAppsFolder = new File(getToolingWorkingDir(), TOOLING_APPS_FOLDER);
 if (!toolingServiceAppsFolder.exists()) {
  boolean folderCreated = toolingServiceAppsFolder.mkdirs();
  if (!folderCreated) {
   throw new InitialisationException(createStaticMessage("Couldn't start up the service"),
                    new IOException("Couldn't create tooling service resources folder: "
                      + toolingServiceAppsFolder),
                    this);
  }
  if (logger.isDebugEnabled()) {
   logger.debug("Created tooling service resources folder at: " + toolingServiceAppsFolder);
  }
 } else {
  try {
   cleanDirectory(toolingServiceAppsFolder);
  } catch (IOException e) {
   logger.warn("Could not clean up tooling service resources folder at: " + toolingServiceAppsFolder);
  }
 }
 return toolingServiceAppsFolder;
}

代码示例来源:origin: org.mule.runtime/mule-module-tooling-support

/**
 * {@inheritDoc}
 */
@Override
public void stop() throws MuleException {
 if (toolingServiceAppsFolder != null) {
  try {
   cleanDirectory(toolingServiceAppsFolder);
  } catch (Exception e) {
   logger.warn("Couldn't clean up tooling service resources folder located at: " + toolingServiceAppsFolder);
  }
 }
}

代码示例来源:origin: org.mule.runtime/mule-module-tooling-support

/**
 * Creates a folder for this service to upload tooling applications.
 *
 * @return {@link File} working folder.
 * @throws InitialisationException if there was an error while creating the folder.
 */
private File createToolingServiceAppsFolder() throws InitialisationException {
 File toolingServiceAppsFolder = new File(new File(getMuleBaseFolder(), MULE_TMP_FILENAME), TOOLING_APPS_FOLDER);
 if (!toolingServiceAppsFolder.exists()) {
  boolean folderCreated = toolingServiceAppsFolder.mkdirs();
  if (!folderCreated) {
   throw new InitialisationException(createStaticMessage("Couldn't start up the service"),
                    new IOException("Couldn't create tooling service resources folder: "
                      + toolingServiceAppsFolder),
                    this);
  }
  if (logger.isDebugEnabled()) {
   logger.debug("Create tooling service resources folder at: " + toolingServiceAppsFolder);
  }
 } else {
  try {
   cleanDirectory(toolingServiceAppsFolder);
  } catch (IOException e) {
   logger.warn("Could not clean up tooling service resources folder at: " + toolingServiceAppsFolder);
  }
 }
 return toolingServiceAppsFolder;
}

代码示例来源:origin: org.mule.runtime/mule-core

@Override
public void clear() throws ObjectStoreException {
 synchronized (realKeyToUUIDIndex) {
  try {
   cleanDirectory(this.partitionDirectory);
  } catch (IOException e) {
   throw new ObjectStoreException(createStaticMessage("Could not clear ObjectStore"), e);
  }
  realKeyToUUIDIndex.clear();
 }
}

相关文章