当前位置: 首页>>代码示例>>Java>>正文


Java FileUtils.forceMkdir方法代码示例

本文整理汇总了Java中org.codehaus.plexus.util.FileUtils.forceMkdir方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.forceMkdir方法的具体用法?Java FileUtils.forceMkdir怎么用?Java FileUtils.forceMkdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.plexus.util.FileUtils的用法示例。


在下文中一共展示了FileUtils.forceMkdir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeBuildConfigToFile

import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
 * Creates a file that can be used as input to the ajc compiler using the -argdfile flag.
 * Each line in these files should contain one option or filename.
 * Comments, as in Java, start with // and extend to the end of the line.
 *
 * @param arguments All arguments passed to ajc in this run
 * @param fileName the filename of the argfile
 * @param outputDir the build output area.
 * @throws IOException
 */
public static void writeBuildConfigToFile( List<String> arguments, String fileName, File outputDir )
    throws IOException
{
    FileUtils.forceMkdir( outputDir );
    File argFile = new File( outputDir, fileName );
    argFile.getParentFile().mkdirs();
    argFile.createNewFile();
    BufferedWriter writer = new BufferedWriter( new FileWriter( argFile ) );
    for ( String argument : arguments )
    {
        writer.write( argument );
        writer.newLine();
    }
    writer.flush();
    writer.close();
}
 
开发者ID:mojohaus,项目名称:aspectj-maven-plugin,代码行数:27,代码来源:AjcHelper.java

示例2: simpleKeyStore

import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
public File simpleKeyStore( boolean copy )
    throws IOException
{
    File keyStore = simpleKeyStore( "keystore.jks", copy );
    FileUtils.forceMkdir( keyStore.getParentFile() );
    return keyStore;
}
 
开发者ID:mojohaus,项目名称:keytool,代码行数:8,代码来源:ResourceFixtures.java

示例3: mkDir

import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
protected void mkDir( String dirPath )
    throws IOException
{
    FileUtils.forceMkdir( new File( dirPath ) );
}
 
开发者ID:mojohaus,项目名称:maven-native,代码行数:6,代码来源:AbstractDependencyTest.java

示例4: runTest

import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
public void runTest( String generatorId, String pom, String descriptor, String outputPath )
    throws Exception
{
    File outputDir = getTestFile( outputPath );

    DaemonGenerator generator = (DaemonGenerator) lookup( DaemonGenerator.ROLE, generatorId );

    // -----------------------------------------------------------------------
    // Build the MavenProject instance
    // -----------------------------------------------------------------------

    MavenProjectBuilder projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );

    MavenSettingsBuilder settingsBuilder = (MavenSettingsBuilder) lookup( MavenSettingsBuilder.ROLE );
    Settings settings = settingsBuilder.buildSettings();

    ArtifactRepositoryFactory artifactRepositoryFactory =
        (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE );

    String localRepoUrl = new File( settings.getLocalRepository() ).toURL().toExternalForm();

    ArtifactRepository localRepository =
        artifactRepositoryFactory.createDeploymentArtifactRepository( "local", localRepoUrl,
                                                                      new DefaultRepositoryLayout(), false );

    ProfileManager profileManager = new DefaultProfileManager( getContainer() );

    File tempPom = createFilteredFile( pom );

    MavenProject project = projectBuilder.buildWithDependencies( tempPom, localRepository, profileManager );

    // -----------------------------------------------------------------------
    // Clean the output directory
    // -----------------------------------------------------------------------

    FileUtils.deleteDirectory( outputDir );
    FileUtils.forceMkdir( outputDir );

    // -----------------------------------------------------------------------
    //
    // -----------------------------------------------------------------------

    DaemonGeneratorService daemonGeneratorService = (DaemonGeneratorService) lookup( DaemonGeneratorService.ROLE );

    Daemon model = daemonGeneratorService.loadModel( getTestFile( descriptor ) );

    generator.generate( new DaemonGenerationRequest( model, project, localRepository, outputDir, "bin" ) );
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:49,代码来源:AbstractDaemonGeneratorTest.java


注:本文中的org.codehaus.plexus.util.FileUtils.forceMkdir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。