本文整理汇总了Java中org.lpe.common.util.LpeFileUtils.writeObject方法的典型用法代码示例。如果您正苦于以下问题:Java LpeFileUtils.writeObject方法的具体用法?Java LpeFileUtils.writeObject怎么用?Java LpeFileUtils.writeObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lpe.common.util.LpeFileUtils
的用法示例。
在下文中一共展示了LpeFileUtils.writeObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeResultsContainer
import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
/**
* Writes the container to the given result folder.
*
* @param resultFolder
* the result folder to write to
* @param container
* the container to be written
* @return <code>true</code> on success, <code>false</code> otherwise
*/
public static boolean writeResultsContainer(IFolder resultFolder, ResultsContainer container) {
IFile resFile = resultFolder.getFile(ResultsLocationConstants.RESULTS_SERIALIZATION_FILE_NAME);
File containerFile = new File(resFile.getLocation().toString());
try {
LpeFileUtils.writeObject(containerFile.getAbsolutePath(), container);
} catch (IOException e) {
String message = "Error while writing results container!";
LOGGER.error(message, e);
DialogUtils.handleError(message, e);
return false;
}
return true;
}
示例2: writeJobsContainer
import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
private static boolean writeJobsContainer(IProject project, JobsContainer jobsContainer) {
String fileName = project.getFile(FileManager.JOBS_CONTAINER_FILENAME).getLocation().toString();
try {
LpeFileUtils.writeObject(fileName, jobsContainer);
return true;
} catch (IOException e) {
LOGGER.error("Error while writing JobsContainer.", e);
}
return false;
}
示例3: serializeResults
import org.lpe.common.util.LpeFileUtils; //导入方法依赖的package包/类
/**
* Serializes the results to file.
*
* @param resultsContainer
* container with the collected results to serialize
*/
private void serializeResults(ResultsContainer resultsContainer) {
String outputFile = diagnosisResultFolder + ResultsLocationConstants.RESULTS_SERIALIZATION_FILE_NAME;
try {
LpeFileUtils.writeObject(outputFile, resultsContainer);
LOGGER.info("Serialized results to the following file: {}", outputFile);
} catch (IOException e) {
LOGGER.error("Failed serializing results to file {}! Cause: {}", outputFile, e.getMessage());
}
}