org.apache.maven.shared.utils.io.FileUtils.forceDelete()方法的使用及代码示例

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

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

FileUtils.forceDelete介绍

[英]Delete a file. If file is directory delete it and all sub-directories.
[中]删除一个文件。如果文件是目录,则删除它和所有子目录。

代码示例

代码示例来源:origin: org.apache.maven.shared/file-management

/**
 * Delete a file
 *
 * @param f a file
 */
private boolean delete( File f )
{
  try
  {
    FileUtils.forceDelete( f );
  }
  catch ( IOException e )
  {
    return false;
  }
  return true;
}

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

/**
 * Delete a file. If file is directory delete it and all sub-directories.
 *
 * @param file the file path
 * @throws IOException if any
 */
public static void forceDelete( @Nonnull final String file )
  throws IOException
{
  forceDelete( new File( file ) );
}

代码示例来源:origin: org.apache.maven.shared/maven-verifier

public void deleteArtifact( String org, String name, String version, String ext )
  throws IOException
{
  List<String> files = getArtifactFileNameList( org, name, version, ext );
  for ( String fileName : files )
  {
    FileUtils.forceDelete( new File( fileName ) );
  }
}

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

forceDelete( file );

相关文章