Package jetbrains.buildServer.util
Class FilePersisterUtil
- java.lang.Object
-
- jetbrains.buildServer.util.FilePersisterUtil
-
public class FilePersisterUtil extends Object
- Author:
- vbedrosova
-
-
Constructor Summary
Constructors Constructor Description FilePersisterUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
processXmlFile(File file, FileUtil.Processor p)
Same asFileUtil.processXmlFile(File, FileUtil.Processor)
, but saves result via temp file.static void
saveDocument(org.jdom.Document document, File targetFile)
Saves the specified document to the target file via the temp filestatic void
saveDocument(org.jdom.Document document, File targetFile, FileUtil.IOAction beforeWriteAction)
Saves the specified document to the target file via the temp file
-
-
-
Method Detail
-
processXmlFile
public static void processXmlFile(@NotNull File file, @NotNull FileUtil.Processor p)
Same asFileUtil.processXmlFile(File, FileUtil.Processor)
, but saves result via temp file.- Parameters:
file
- file to processp
- processor
-
saveDocument
public static void saveDocument(@NotNull org.jdom.Document document, @NotNull File targetFile) throws IOException
Saves the specified document to the target file via the temp file- Parameters:
document
- document to savetargetFile
- file where document should be saved- Throws:
IOException
- in case of IO error- See Also:
saveDocument(Document, File, FileUtil.IOAction)
-
saveDocument
public static void saveDocument(@NotNull org.jdom.Document document, @NotNull File targetFile, @NotNull FileUtil.IOAction beforeWriteAction) throws IOException
Saves the specified document to the target file via the temp file- Parameters:
document
- document to savetargetFile
- file where document should be savedbeforeWriteAction
- action to run before renaming temp file to the targetFile- Throws:
IOException
- in case of IO error- See Also:
FileUtil.writeViaTmpFile(File, InputStream, FileUtil.IOAction)
-
-