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


Java LpeFileUtils.createDir方法代码示例

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


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

示例1: createDynamicSpotterConfiguration

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
/**
 * Creates necessary configuration files for the diagnosis from the given
 * job description.
 * 
 * @param jobId
 *            the job id of the diagnosis
 * @param jobDescription
 *            the job description which holds the configuration information
 * @return the path to the DS configuration file which is required by DS
 */
private String createDynamicSpotterConfiguration(long jobId, JobDescription jobDescription) {
	FileManager fileManager = FileManager.getInstance();
	String location = getRuntimeLocation() + "/" + jobId;
	LpeFileUtils.createDir(location);
	String configurationFile = null;

	try {
		fileManager.writeEnvironmentConfig(location, jobDescription.getMeasurementEnvironment());
		fileManager.writeHierarchyConfig(location, jobDescription.getHierarchy());
		configurationFile = fileManager.writeSpotterConfig(location, jobDescription.getDynamicSpotterConfig());
		LOGGER.info("Storing configuration for diagnosis run #" + jobId + " in " + location);
	} catch (IOException | JAXBException e) {
		String message = "Failed to create DS configuration.";
		LOGGER.error(message, e);
		throw new RuntimeException(message, e);
	}

	return configurationFile;
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:30,代码来源:SpotterServiceWrapper.java

示例2: getAdditionalResourcesPath

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
/**
 * Returns the path for additional resources.
 * 
 * @return directory where additional resources shall be stored
 */
public String getAdditionalResourcesPath() {
	StringBuilder pathBuilder = new StringBuilder();
	if (resourcePath == null) {
		pathBuilder.append(GlobalConfiguration.getInstance().getProperty(ConfigKeys.RESULT_DIR));
		pathBuilder.append(getControllerIdentifier());
		pathBuilder.append(System.getProperty("file.separator"));

		pathBuilder.append(ResultsLocationConstants.RESULT_RESOURCES_SUB_DIR);
		pathBuilder.append(System.getProperty("file.separator"));

		resourcePath = pathBuilder.toString();
		File file = new File(resourcePath);
		if (!file.exists()) {
			LpeFileUtils.createDir(resourcePath);
		}
	} else {
		pathBuilder.append(resourcePath);
	}

	return pathBuilder.toString();
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:27,代码来源:DetectionResultManager.java

示例3: createTempDir

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private static void createTempDir() throws IOException {
	tempDir = new File("tempJUnit");
	if (tempDir.exists()) {
		LpeFileUtils.removeDir(tempDir.getAbsolutePath());
	}
	LpeFileUtils.createDir(tempDir.getAbsolutePath());
	newFileName = tempDir.getAbsolutePath() + System.getProperty("file.separator") + "newFile.txt";
	File newFile = new File(newFileName);
	newFile.createNewFile();

	hierarchyFileName = tempDir.getAbsolutePath() + System.getProperty("file.separator") + "hierarchy.xml";
	newFile = new File(hierarchyFileName);
	newFile.createNewFile();

	mEnvFileName = tempDir.getAbsolutePath() + System.getProperty("file.separator") + "menv.xml";
	newFile = new File(mEnvFileName);
	newFile.createNewFile();

	wrongFileName = tempDir.getAbsolutePath() + System.getProperty("file.separator") + "wrong.xml";
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:21,代码来源:ConfigCheckTest.java

示例4: createTempDir

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private static void createTempDir() throws IOException {
	tempDir = new File("tempJUnit");
	if (tempDir.exists()) {
		LpeFileUtils.removeDir(tempDir.getAbsolutePath());
	}
	LpeFileUtils.createDir(tempDir.getAbsolutePath());
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:8,代码来源:SpotterServiceTest.java

示例5: extractCopy

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private void extractCopy(String targetFile, String scriptStr) {
	String fileName = targetFile.substring(targetFile.lastIndexOf("/") + 1, targetFile.lastIndexOf("."));
	String targetDir = targetFile.substring(0, targetFile.lastIndexOf("/"));

	targetDir = LpeFileUtils.concatFileName(targetDir, "chartData");
	targetDir = LpeFileUtils.concatFileName(targetDir, fileName);
	targetDir = targetDir.replace(System.getProperty("file.separator"), "/");
	LpeFileUtils.createDir(targetDir);
	copyCSVs(targetDir);

	String originalDir = LpeFileUtils.concatFileName(
			LpeFileUtils.concatFileName(LpeSystemUtils.getSystemTempDir(), DYNAMIC_SPOTTER_DIR), "chartTmp")
			.replace(System.getProperty("file.separator"), "/");
	scriptStr = scriptStr.replace(originalDir, targetDir);

	String scriptFile = LpeFileUtils.concatFileName(targetDir, "script-" + seriesCounter + ".r");
	try {
		FileWriter fWriter = new FileWriter(scriptFile, false);
		fWriter.append(scriptStr);
		fWriter.flush();

		fWriter.close();
	} catch (IOException e1) {
		// TODO Auto-generated catch block
		e1.printStackTrace();
	}

}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:29,代码来源:RChartBuilder.java

示例6: copyCSVs

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private void copyCSVs(String target) {
	LpeFileUtils.createDir(target);

	String dir = LpeFileUtils.concatFileName(LpeSystemUtils.getSystemTempDir(), DYNAMIC_SPOTTER_DIR);
	dir = LpeFileUtils.concatFileName(dir, "chartTmp");
	try {
		LpeFileUtils.copyDirectory(dir, target);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:13,代码来源:RChartBuilder.java

示例7: storeCSV

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private String storeCSV(NumericPairList<? extends Number, ? extends Number> valuePairs) {
	String file = LpeFileUtils.concatFileName(LpeSystemUtils.getSystemTempDir(), DYNAMIC_SPOTTER_DIR);
	file = LpeFileUtils.concatFileName(file, "chartTmp");
	LpeFileUtils.createDir(file);
	file = LpeFileUtils.concatFileName(file, "data-" + seriesCounter + ".csv");
	LpeNumericUtils.exportAsCSV(valuePairs, file, "Col1", "Col2");

	return file.replace(System.getProperty("file.separator"), "/");
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:10,代码来源:RChartBuilder.java

示例8: creeateTempDir

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private static String creeateTempDir() throws IOException {
	tempDir = new File("tempJUnit");
	if (tempDir.exists()) {
		LpeFileUtils.removeDir(tempDir.getAbsolutePath());
	}
	LpeFileUtils.createDir(tempDir.getAbsolutePath());
	return tempDir.getAbsolutePath();
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:9,代码来源:SpotterTest.java

示例9: createTempDir

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
@Before
public void createTempDir() throws IOException {
	tempDir = new File("tempJUnit");
	if (tempDir.exists()) {
		LpeFileUtils.removeDir(tempDir.getAbsolutePath());
	}
	LpeFileUtils.createDir(tempDir.getAbsolutePath());
	baseDir = tempDir.getAbsolutePath();
	GlobalConfiguration.getInstance().putProperty(ConfigKeys.RESULT_DIR,
			tempDir + System.getProperty("file.separator"));
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:12,代码来源:DetectionResultManagerTest.java

示例10: creeateTempDir

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private String creeateTempDir() throws IOException {
	tempDir = new File("tempJUnit");
	if (tempDir.exists()) {
		LpeFileUtils.removeDir(tempDir.getAbsolutePath());
	}
	LpeFileUtils.createDir(tempDir.getAbsolutePath());
	return tempDir.getAbsolutePath();
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:9,代码来源:AbstractDetectionControllerTest.java

示例11: checkResultDirConf

import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private static void checkResultDirConf() {
	String resultDir = GlobalConfiguration.getInstance().getProperty(ConfigKeys.RESULT_DIR);

	if (resultDir == null) {
		throw new IllegalStateException("Configuration Error: "
				+ "Spotter result direcotry has not been specified!");
	}
	resultDir = correctFileSeparator(ConfigKeys.RESULT_DIR, true);

	File resultDirFile = new File(resultDir);
	if (resultDirFile.exists() && !resultDirFile.isDirectory()) {
		throw new IllegalStateException("Configuration Error: "
				+ "The specified Spotter result direcotry points not to a directory!");
	}

	String runName = GlobalConfiguration.getInstance().getProperty(ConfigKeys.SPOTTER_RUN_NAME);

	if (runName == null || runName.isEmpty()) {
		String subDir = LpeStringUtils.getDetailedTimeStamp(new Date(GlobalConfiguration.getInstance()
				.getPropertyAsLong(ConfigKeys.PPD_RUN_TIMESTAMP, System.currentTimeMillis())));
		subDir = subDir.replace(" - ", "_");
		subDir = subDir.replace(".", "-");
		subDir = subDir.replace(":", "-");
		resultDir += subDir + System.getProperty("file.separator");
	} else {
		resultDir += runName + System.getProperty("file.separator");
	}

	resultDirFile = new File(resultDir);
	if (!resultDirFile.exists()) {
		LpeFileUtils.createDir(resultDir);
	}

	GlobalConfiguration.getInstance().putProperty(ConfigKeys.RESULT_DIR, resultDir);
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:36,代码来源:ConfigCheck.java


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