本文整理汇总了Java中org.codehaus.plexus.util.FileUtils.mkdir方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.mkdir方法的具体用法?Java FileUtils.mkdir怎么用?Java FileUtils.mkdir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.plexus.util.FileUtils
的用法示例。
在下文中一共展示了FileUtils.mkdir方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateConfdArtefacts
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
public static void generateConfdArtefacts(
PrepareContext context,
List<TemplateConfig> templates,
boolean forceDestToLocalFileSystemType,
Log log
) throws IOException {
File workingDirectory = context.getWorkingDirectory();
File templatesDirectory = new File(workingDirectory, TEMPLATES_DIRECTORY);
File tomlDirectory = new File(workingDirectory, CONF_D_DIRECTORY);
if (workingDirectory.exists()) {
FileUtils.deleteDirectory(workingDirectory);
}
FileUtils.mkdir(templatesDirectory.getAbsolutePath());
FileUtils.mkdir(tomlDirectory.getAbsolutePath());
for (TemplateConfig tc : templates) {
String tomlBaseName = FileUtils.basename(tc.getSrc().getAbsolutePath()) + TOML_FILE_EXT;
File tomlFile = new File(tomlDirectory, tomlBaseName);
writeToml(tomlFile, tc, forceDestToLocalFileSystemType);
FileUtils.copyFileToDirectory(tc.getSrc(), templatesDirectory);
warnAboutKeysExcludedByNamespace(tc, context, log);
}
}
示例2: copyURLToFile
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
protected void copyURLToFile( URL url, File dest )
throws IOException
{
FileUtils.mkdir( dest.getParentFile().getAbsolutePath() );
InputStream inputStream = url.openStream();
try
{
OutputStream outputStream = new FileOutputStream( dest );
try
{
IOUtil.copy( inputStream, outputStream );
}
finally
{
IOUtil.close( outputStream );
}
}
finally
{
IOUtil.close( inputStream );
}
}
示例3: setUp
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
resourcesDir = new File(getBaseDir(), "src/test/resources/unit/java-processor-test");
testDir = temporaryFolder.newFolder();
dictionaryFile = new File(testDir, "dictionaries/env01.dict");
FileUtils.mkdir(new File(testDir, "conf.d").getAbsolutePath());
FileUtils.copyDirectoryStructure(resourcesDir, testDir);
}
示例4: setUp
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
resourcesDir = new File(getBaseDir(), "src/test/resources/unit/java-processor-test");
testDir = temporaryFolder.newFolder();
dictionaryFile = new File(testDir, "dictionaries/env01.dict");
FileUtils.mkdir(new File(testDir, "conf.d").getAbsolutePath());
FileUtils.copyDirectoryStructure(resourcesDir, testDir);
}
示例5: execute
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
public void execute()
throws MojoExecutionException
{
if ( !this.resourceCompilerOutputDirectory.exists() )
{
this.resourceCompilerOutputDirectory.mkdirs();
}
FileUtils.mkdir( project.getBuild().getDirectory() );
ResourceCompiler compiler = this.getResourceCompiler();
ResourceCompilerConfiguration config = new ResourceCompilerConfiguration();
config.setExecutable( this.resourceCompilerExecutable );
config.setWorkingDirectory( this.workingDirectory );
config.setOptions( NativeMojoUtils.trimParams( this.resourceCompilerOptions ) );
config.setOutputDirectory( this.resourceCompilerOutputDirectory );
config.setEnvFactory( this.getEnvFactory() );
try
{
List resourceOutputFiles;
resourceOutputFiles = compiler.compile( config, this.resources );
this.saveCompilerOutputFilePaths( resourceOutputFiles );
}
catch ( NativeBuildException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例6: execute
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
*
*/
public void execute() throws MojoExecutionException, MojoFailureException
{
if ( puXMLFile == null || !FileUtils.fileExists( puXMLFile ) )
{
throw new MojoExecutionException( "missing pu.xml file" );
}
if ( warFile == null || !FileUtils.fileExists( warFile ) )
{
throw new MojoExecutionException( "missing war file" );
}
try
{
String puTargetDir = serverDirectory + File.separator + "META-INF" + File.separator + "spring";
String libTargetDir = serverDirectory + File.separator + "lib";
FileUtils.mkdir( serverDirectory );
FileUtils.mkdir( puTargetDir );
FileUtils.mkdir( libTargetDir );
FileUtils.copyFileToDirectory( new File( puXMLFile ), new File( puTargetDir ) );
FileUtils.copyFileToDirectory( new File( warFile ), new File( serverDirectory ) );
for (Iterator artifactIterator = pluginArtifacts.iterator(); artifactIterator.hasNext();)
{
Artifact artifact = (Artifact) artifactIterator.next();
if (artifact.getGroupId().equals("org.mortbay.jetty") )
{
FileUtils.copyFileToDirectory( artifact.getFile().getPath(), libTargetDir );
}
}
jarArchiver.addDirectory( new File(serverDirectory) );
jarArchiver.setDestFile( new File(artifactName) );
jarArchiver.createArchive();
}
catch ( IOException ioe )
{
throw new MojoExecutionException( "unable to assemble",ioe );
}
catch ( ArchiverException ae )
{
throw new MojoExecutionException( "unable to assembly jar", ae );
}
}
示例7: setup
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
* Setup.
*
* @throws Exception the exception
*/
@Before
public void setup() throws Exception {
processService = new ProcessServiceJpa();
contentService = new ContentServiceJpa();
// load the project (should be only one)
ProjectList projects = processService.getProjects();
assertTrue(projects.size() > 0);
project = projects.getObjects().get(0);
// Create a dummy process execution, to store some information the algorithm
// needs (specifically input Path)
processExecution = new ProcessExecutionJpa();
processExecution.setProject(project);
processExecution.setTerminology(project.getTerminology());
processExecution.setVersion(project.getVersion());
processExecution.setInputPath("terminologies/NCI_INSERT/src"); // <- Set
// this to
// the standard
// folder
// location
// Create the /temp subdirectory
final File tempSrcDir = new File(
ConfigUtility.getConfigProperties().getProperty("source.data.dir")
+ "/" + processExecution.getInputPath() + "/temp");
FileUtils.mkdir(tempSrcDir.toString());
// Reset the processExecution input path to /src/temp
processExecution.setInputPath(
processExecution.getInputPath() + "/temp");
// Create and populate an attributes.src document in the /temp
// temporary subfolder
outputFile = new File(tempSrcDir, "mergefacts.src");
PrintWriter out = new PrintWriter(new FileWriter(outputFile));
out.println(
"362166237|SY|362166238|SRC||N|N|NCI-SRC|SRC_ATOM_ID||SRC_ATOM_ID||");
out.println(
"362249700|SY|362281363|NCI_2016_05E||Y|N|NCI-SY|SRC_ATOM_ID||SRC_ATOM_ID||");
out.close();
// Create and configure the algorithm
algo = new PrecomputedMergeAlgorithm();
// Configure the algorithm
algo.setLastModifiedBy("admin");
algo.setLastModifiedFlag(true);
algo.setProcess(processExecution);
algo.setProject(processExecution.getProject());
algo.setTerminology(processExecution.getTerminology());
algo.setVersion(processExecution.getVersion());
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:62,代码来源:PrecomputedMergeAlgorithmTest.java
示例8: setup
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
* Setup.
*
* @throws Exception the exception
*/
@Before
public void setup() throws Exception {
service = new ProcessServiceJpa();
// load the project (should be only one)
ProjectList projects = service.getProjects();
assertTrue(projects.size() > 0);
project = projects.getObjects().get(0);
// Create a dummy process execution, to store some information the algorithm
// needs (specifically input Path)
processExecution = new ProcessExecutionJpa();
processExecution.setProject(project);
processExecution.setTerminology(project.getTerminology());
processExecution.setVersion(project.getVersion());
processExecution.setInputPath("mr");// <- Set this
// to
// the standard
// folder
// location
// Create the /temp subdirectory
final File tempSrcDir = new File(
ConfigUtility.getConfigProperties().getProperty("source.data.dir") + "/"
+ processExecution.getInputPath() + "/temp");
FileUtils.mkdir(tempSrcDir.toString());
// Reset the processExecution input path to /src/temp
processExecution.setInputPath(processExecution.getInputPath() + "/temp");
// Create and populate a MRCUI.RRF document in the /temp
// temporary subfolder
outputFile = new File(tempSrcDir, "MRCUI.RRF");
// Create and configure the algorithm
algo = new ReloadConceptHistoryAlgorithm();
// Configure the algorithm (need to do either way)
algo.setLastModifiedBy("admin");
algo.setLastModifiedFlag(true);
algo.setProcess(processExecution);
algo.setProject(processExecution.getProject());
algo.setTerminology(processExecution.getTerminology());
algo.setVersion(processExecution.getVersion());
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:52,代码来源:ReloadComponentHistoryAlgorithmTest.java
示例9: setup
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
* Setup.
*
* @throws Exception the exception
*/
@Before
public void setup() throws Exception {
processService = new ProcessServiceJpa();
contentService = new ContentServiceJpa();
// load the project (should be only one)
ProjectList projects = processService.getProjects();
assertTrue(projects.size() > 0);
project = projects.getObjects().get(0);
// Create a dummy process execution, to store some information the algorithm
// needs (specifically input Path)
processExecution = new ProcessExecutionJpa();
processExecution.setProject(project);
processExecution.setTerminology(project.getTerminology());
processExecution.setVersion(project.getVersion());
processExecution.setInputPath("terminologies/NCI_INSERT/src"); // <- Set
// this to
// the standard
// folder
// location
// Create the /temp subdirectory
final File tempSrcDir = new File(
ConfigUtility.getConfigProperties().getProperty("source.data.dir") + "/"
+ processExecution.getInputPath() + "/temp");
FileUtils.mkdir(tempSrcDir.toString());
// Reset the processExecution input path to /src/temp
processExecution.setInputPath(processExecution.getInputPath() + "/temp");
// Create and populate an attributes.src document in the /temp
// temporary subfolder
outputFile = new File(tempSrcDir, "attributes.src");
PrintWriter out = new PrintWriter(new FileWriter(outputFile));
out.println(
"1|362166237|C|SEMANTIC_TYPE|Intellectual Product|SRC|R|Y|N|N|SRC_ATOM_ID|||3d9e88091cf4ebbab774e90c8f6d4052|");
out.println(
"34|C98033|S|FDA_UNII_Code|ODN00F2SJG|NCI_2016_05E|R|Y|N|N|SOURCE_CUI|NCI_2016_05E||634eb9dd2339a0f372a5f0b3c7b58fed|");
out.println(
"43|C118465|C|SEMANTIC_TYPE|Diagnostic Procedure|E-NCI_2016_05E|R|Y|N|N|SOURCE_CUI|NCI_2016_05E||5186070c98e613d1e688b45c983caea2|");
out.close();
// Create and configure the algorithm
algo = new SemanticTypeLoaderAlgorithm();
// Configure the algorithm
algo.setLastModifiedBy("admin");
algo.setLastModifiedFlag(true);
algo.setProcess(processExecution);
algo.setProject(processExecution.getProject());
algo.setTerminology(processExecution.getTerminology());
algo.setVersion(processExecution.getVersion());
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:62,代码来源:SemanticTypeLoaderAlgorithmTest.java
示例10: setup
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
* Setup.
*
* @throws Exception the exception
*/
@Before
public void setup() throws Exception {
processService = new ProcessServiceJpa();
contentService = new ContentServiceJpa();
// load the project (should be only one)
ProjectList projects = processService.getProjects();
assertTrue(projects.size() > 0);
project = projects.getObjects().get(0);
// Create a dummy process execution, to store some information the algorithm
// needs (specifically input Path)
processExecution = new ProcessExecutionJpa();
processExecution.setProject(project);
processExecution.setTerminology(project.getTerminology());
processExecution.setVersion(project.getVersion());
processExecution.setInputPath("terminologies/NCI_INSERT/src"); // <- Set
// this to
// the standard
// folder
// location
// Create the /temp subdirectory
final File tempSrcDir = new File(
ConfigUtility.getConfigProperties().getProperty("source.data.dir") + "/"
+ processExecution.getInputPath() + "/temp");
FileUtils.mkdir(tempSrcDir.toString());
// Reset the processExecution input path to /src/temp
processExecution.setInputPath(processExecution.getInputPath() + "/temp");
// Create and populate an attributes.src document in the /temp
// temporary subfolder
outputFile = new File(tempSrcDir, "attributes.src");
PrintWriter out = new PrintWriter(new FileWriter(outputFile));
out.println(
"1|362166237|C|SEMANTIC_TYPE|Intellectual Product|SRC|R|Y|N|N|SRC_ATOM_ID|||3d9e88091cf4ebbab774e90c8f6d4052|");
out.println(
"32|C93028|S|DEFINITION|The region on either side of the body that extends from the last rib to the hip.|NCI_2016_05E|R|Y|N|N|SOURCE_CUI|NCI_2016_05E||e5ad416a6556a0dcb279c124a6acc83a|");
out.println(
"34|C98033|S|FDA_UNII_Code|ODN00F2SJG|NCI_2016_05E|R|Y|N|N|SOURCE_CUI|NCI_2016_05E||634eb9dd2339a0f372a5f0b3c7b58fed|");
out.println(
"13340556|381548367|S|MAPSETSID|447562003|NCI_2016_05E|R|Y|N|N|SRC_ATOM_ID|||c1bb150020d064227a154e6a6fceaeea|");
out.close();
// Create and configure the algorithm
algo = new AttributeLoaderAlgorithm();
// Configure the algorithm
algo.setLastModifiedBy("admin");
algo.setLastModifiedFlag(true);
algo.setProcess(processExecution);
algo.setProject(processExecution.getProject());
algo.setTerminology(processExecution.getTerminology());
algo.setVersion(processExecution.getVersion());
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:64,代码来源:AttributeLoaderAlgorithmTest.java
示例11: setup
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
* Setup.
*
* @throws Exception the exception
*/
@Before
public void setup() throws Exception {
processService = new ProcessServiceJpa();
contentService = new ContentServiceJpa();
// load the project (should be only one)
ProjectList projects = processService.getProjects();
assertTrue(projects.size() > 0);
project = projects.getObjects().get(0);
// Create a dummy process execution, to store some information the algorithm
// needs (specifically input Path)
processExecution = new ProcessExecutionJpa();
processExecution.setProject(project);
processExecution.setTerminology(project.getTerminology());
processExecution.setVersion(project.getVersion());
processExecution.setInputPath("terminologies/NCI_INSERT/src"); // <- Set
// this to
// the standard
// folder
// location
// Create the /temp subdirectory
final File tempSrcDir = new File(
ConfigUtility.getConfigProperties().getProperty("source.data.dir") + "/"
+ processExecution.getInputPath() + "/temp");
FileUtils.mkdir(tempSrcDir.toString());
// Reset the processExecution input path to /src/temp
processExecution.setInputPath(
processExecution.getInputPath() + "/temp");
// Create and populate a contexts.src document in the /temp
// temporary subfolder
outputFile = new File(tempSrcDir, "contexts.src");
PrintWriter out = new PrintWriter(new FileWriter(outputFile));
out.println(
"362168904|PAR|isa|362174335|NCI_2016_05E|NCI_2016_05E||31926003.362204588.362250568.362175233.362174339.362174335|00|||C37447|SOURCE_CUI|NCI_2016_05E|C1971|SOURCE_CUI|NCI_2016_05E|");
out.println(
"362199564|PAR|isa|362199578|NCI_2016_05E|NCI_2016_05E||31926003.362214991.362254908.362254885.362207285.362246398.362199581.362199578|00|||C25948|SOURCE_CUI|NCI_2016_05E|C16484|SOURCE_CUI|NCI_2016_05E|");
out.close();
// Create and configure the algorithm
algo = new ContextLoaderAlgorithm();
// Configure the algorithm
algo.setLastModifiedBy("admin");
algo.setLastModifiedFlag(true);
algo.setProcess(processExecution);
algo.setProject(processExecution.getProject());
algo.setTerminology(processExecution.getTerminology());
algo.setVersion(processExecution.getVersion());
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:62,代码来源:ContextLoaderAlgorithmTest.java
示例12: setup
import org.codehaus.plexus.util.FileUtils; //导入方法依赖的package包/类
/**
* Setup.
*
* @throws Exception the exception
*/
@Before
public void setup() throws Exception {
processService = new ProcessServiceJpa();
contentService = new ContentServiceJpa();
// load the project (should be only one)
ProjectList projects = processService.getProjects();
assertTrue(projects.size() > 0);
project = projects.getObjects().get(0);
// Create a dummy process execution, to store some information the algorithm
// needs (specifically input Path)
processExecution = new ProcessExecutionJpa();
processExecution.setProject(project);
processExecution.setTerminology(project.getTerminology());
processExecution.setVersion(project.getVersion());
processExecution.setInputPath("terminologies/NCI_INSERT/src"); // <- Set
// this to
// the standard
// folder
// location
// Create the /temp subdirectory
final File tempSrcDir = new File(
ConfigUtility.getConfigProperties().getProperty("source.data.dir") + "/"
+ processExecution.getInputPath() + "/temp");
FileUtils.mkdir(tempSrcDir.toString());
// Reset the processExecution input path to /src/temp
processExecution.setInputPath(processExecution.getInputPath() + "/temp");
// Create and populate a relationships.src document in the /temp
// temporary subfolder
outputFile = new File(tempSrcDir, "relationships.src");
PrintWriter out = new PrintWriter(new FileWriter(outputFile));
out.println(
"259973|S|386835005|RT|has_active_ingredient|1039008|SNOMEDCT_US_2016_09_01|SNOMEDCT_US_2016_09_01|R|Y|N|N|SOURCE_CUI|SNOMEDCT_US_2016_09_01|SOURCE_CUI|SNOMEDCT_US_2016_09_01|1910721029|0|");
out.println(
"1|S|V-NCI_2016_05E|BT|has_version|V-NCI|SRC|SRC|R|Y|N|N|CODE_SOURCE|SRC|CODE_SOURCE|SRC|||");
out.println(
"31|S|C63923|RT|Concept_In_Subset|C98033|NCI_2016_05E|NCI_2016_05E|R|Y|N|N|SOURCE_CUI|NCI_2016_05E|SOURCE_CUI|NCI_2016_05E|||");
out.close();
// Also create and populate a contexts.src document in the /temp
// temporary subfolder
outputFile = new File(tempSrcDir, "contexts.src");
out = new PrintWriter(new FileWriter(outputFile));
out.println(
"362168904|PAR|isa|362174335|NCI_2016_05E|NCI_2016_05E||31926003.362204588.362250568.362175233.362174339.362174335|00|||C37447|SOURCE_CUI|NCI_2016_05E|C1971|SOURCE_CUI|NCI_2016_05E|");
out.println(
"362199564|PAR|isa|362199578|NCI_2016_05E|NCI_2016_05E||31926003.362214991.362254908.362254885.362207285.362246398.362199581.362199578|00|||C25948|SOURCE_CUI|NCI_2016_05E|C16484|SOURCE_CUI|NCI_2016_05E|");
out.close();
// Create and configure the algorithm
algo = new RelationshipLoaderAlgorithm();
// Configure the algorithm
algo.setLastModifiedBy("admin");
algo.setLastModifiedFlag(true);
algo.setProcess(processExecution);
algo.setProject(processExecution.getProject());
algo.setTerminology(processExecution.getTerminology());
algo.setVersion(processExecution.getVersion());
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:73,代码来源:RelationshipLoaderAlgorithmTest.java