org.geoserver.util.IOUtils.delete()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(109)

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

IOUtils.delete介绍

[英]Recursively deletes the contents of the specified directory, and finally wipes out the directory itself. For each file that cannot be deleted a warning log will be issued.
[中]

代码示例

代码示例来源:origin: geoserver/geoserver

public void tearDown() throws Exception {
  if (data != null) IOUtils.delete(data);
}

代码示例来源:origin: geoserver/geoserver

public void tearDown() throws Exception {
    if (data != null) {
      IOUtils.delete(data);
    }
  }
}

代码示例来源:origin: geoserver/geoserver

/**
 * Kills the data directory, deleting all the files.
 *
 * @throws IOException
 */
public void tearDown() throws IOException {
  //        IOUtils.delete(templates);
  //        IOUtils.delete(validation);
  //        IOUtils.delete(plugIns);
  //        IOUtils.delete(styles);
  //        IOUtils.delete(featureTypes);
  //        IOUtils.delete(coverages);
  IOUtils.delete(data);
  styles = null;
  featureTypes = null;
  data = null;
}

代码示例来源:origin: geoserver/geoserver

if (file.isDirectory()) {
  allClean &= delete(file);
} else {
  if (!file.delete()) {

代码示例来源:origin: geoserver/geoserver

@After
public void tearDown() throws Exception {
  IOUtils.delete(data);
}

代码示例来源:origin: geoserver/geoserver

@After
public void tearDown() throws Exception {
  IOUtils.delete(data);
}

代码示例来源:origin: geoserver/geoserver

public void removeFeatureType(QName typeName) throws IOException {
  String prefix = typeName.getPrefix();
  String type = typeName.getLocalPart();
  File featureTypeDir = new File(featureTypes, prefix + "_" + type);
  if (!featureTypeDir.exists()) {
    throw new FileNotFoundException(
        "Type directory not found: " + featureTypeDir.getAbsolutePath());
  }
  File info = new File(featureTypeDir, "info.xml");
  if (!info.exists()) {
    throw new FileNotFoundException(
        "FeatureType file not found: " + featureTypeDir.getAbsolutePath());
  }
  if (!IOUtils.delete(featureTypeDir)) {
    throw new IOException(
        "FetureType directory not deleted: " + featureTypeDir.getAbsolutePath());
  }
}

代码示例来源:origin: org.geoserver.importer/gs-importer-core

@Override
public void cleanup() throws IOException {
  File parentFolder = (file.isFile() ? file.getParentFile() : null);
  for (File file : allFiles()) {
    cleanupFile(file);
  }
  if (parentFolder != null && parentFolder.exists() && parentFolder.isDirectory()) {
    IOUtils.delete(parentFolder);
  }
}

代码示例来源:origin: org.geoserver.extension/gs-h2

@AfterClass
public static void tearDown() throws Throwable {
  // check if the root directory was initiated (test may have been skipped)
  if (ROOT_DIRECTORY != null) {
    // remove root tests directory
    IOUtils.delete(ROOT_DIRECTORY);
  }
}

代码示例来源:origin: org.geoserver.importer/gs-importer-core

if (f.isDirectory() && !(new File(f, ".locking")).exists()) {
  try {
    IOUtils.delete(f);
  } catch (IOException e) {
    LOGGER.log(

代码示例来源:origin: org.geoserver.community/gs-jms-geoserver

/** Destroy everything related with this instance. */
  public void destroy() {
    // dispose XSD schema, this is important for WFS schemas
    applicationContext.getBeansOfType(XSD.class).values().forEach(XSD::dispose);
    // destroy Spring application context
    applicationContext.destroy();
    // remove the data directory
    try {
      IOUtils.delete(dataDirectory);
    } catch (Exception exception) {
      throw new RuntimeException(
          String.format(
              "Error deleting test directory '%s'.", dataDirectory.getAbsolutePath()),
          exception);
    }
  }
}

代码示例来源:origin: org.geoserver.community/gs-jms-geoserver

() -> {
  try {
    IOUtils.delete(BASE_TEST_DATA.getDataDirectoryRoot());
  } catch (Exception exception) {
    throw new RuntimeException(

相关文章