本文整理汇总了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();
}
示例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;
}
示例3: mkDir
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
protected void mkDir( String dirPath )
throws IOException
{
FileUtils.forceMkdir( new File( dirPath ) );
}
示例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" ) );
}