org.codehaus.plexus.util.FileUtils.rename()方法的使用及代码示例

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

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

FileUtils.rename介绍

[英]Renames a file, even if that involves crossing file system boundaries.

This will remove to (if it exists), ensure that to's parent directory exists and move from, which involves deleting from as well.
[中]重命名文件,即使这涉及跨越文件系统边界。
这将删除to(如果存在),确保to的父目录存在,并移动from,这也涉及删除from

代码示例

代码示例来源:origin: simpligility/android-maven-plugin

FileUtils.rename( new File( outputApk ),  new File( parsedInputApk ) );

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

@Override
protected boolean revert( StringBuffer messageBuffer )
{
  int initLength = messageBuffer.length();
  // delete a bogus ZIP file (but only if it's not the original one)
  if ( ( !doUpdate || renamedFile != null ) && !zipFile.delete() )
  {
    messageBuffer.append( " (and the archive is probably corrupt but I could not delete it)" );
  }
  if ( doUpdate && renamedFile != null )
  {
    try
    {
      FileUtils.rename( renamedFile, zipFile );
    }
    catch ( IOException e )
    {
      messageBuffer.append( " (and I couldn't rename the temporary file " );
      messageBuffer.append( renamedFile.getName() );
      messageBuffer.append( " back)" );
    }
  }
  return messageBuffer.length() == initLength;
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

FileUtils.rename( zipFile, renamedFile );

代码示例来源:origin: de.saumya.mojo/gem-maven-plugin

private void movePom() throws IOException {
  //pom.delete();
  FileUtils.rename( tmpPom, pom );
  rubyMavenHelper();
  if (this.jrubyVerbose)
  {
   getLog().info( "moved " +
           tmpPom.getAbsolutePath().replace( this.project.getBasedir().getAbsolutePath() + "/", "" ) + 
           " to " + 
           pom.getAbsolutePath().replace( this.project.getBasedir().getAbsolutePath() + "/", "" ) );
  }
}

代码示例来源:origin: torquebox/jruby-maven-plugins

private void movePom() throws IOException {
  //pom.delete();
  FileUtils.rename( tmpPom, pom );
  rubyMavenHelper();
  if (this.jrubyVerbose)
  {
   getLog().info( "moved " +
           tmpPom.getAbsolutePath().replace( this.project.getBasedir().getAbsolutePath() + "/", "" ) + 
           " to " + 
           pom.getAbsolutePath().replace( this.project.getBasedir().getAbsolutePath() + "/", "" ) );
  }
}

代码示例来源:origin: org.apache.felix/maven-bundle-plugin

FileUtils.rename( file, outputFile );

代码示例来源:origin: org.codehaus.mojo/emma-maven-plugin

try
  FileUtils.rename( src, dst );

代码示例来源:origin: org.apache.felix/maven-bundle-plugin

flux.close();
FileUtils.rename( fichier, new File( outputFilename ) );

代码示例来源:origin: org.kathrynhuxtable.maven.plugins/htmlfilter-site-maven-plugin

FileUtils.rename(targetFile, sourceFile);
} catch (IOException e) {
  e.printStackTrace();

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

FileUtils.rename( hiddenTarget, target );

代码示例来源:origin: org.zkoss.maven/yuicompressor-maven-plugin-zk

getLog().debug("rename outFile from: " + outFileTmp.getAbsolutePath() + " to: " + outFile.getAbsolutePath());
FileUtils.rename(outFileTmp, outFile);

代码示例来源:origin: org.sonatype.plugins/jarjar-maven-plugin

FileUtils.rename( outputFile, backupFile );

代码示例来源:origin: org.sonatype.nexus/nexus-configuration

FileUtils.rename( tasksFile, new File( tasksFile.getParentFile(), "tasks.xml.old" ) );

相关文章