X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fruntime%2Fio%2FFileIO.java;h=cbbe87f0bf639fa142671a1f868c80f21425923b;hb=dacda910a146ee8dec7e163e35ffae9a72e2b794;hp=2798726e001a577fad5ad67db4261ddfe385f326;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/io/FileIO.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/io/FileIO.java index 2798726e0..cbbe87f0b 100644 --- a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/io/FileIO.java +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/io/FileIO.java @@ -1,32 +1,32 @@ -package org.simantics.scl.runtime.io; - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; - -public class FileIO { - - public static void moveFile(File source, File target) throws IOException { - Files.move(source.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING); - } - - public static void copyFile(File source, File target) throws IOException { - Files.copy(source.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING); - } - - public static void syncFile(File file) throws IOException { - try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { - raf.getFD().sync(); - } - } - - public static File createTempDirectory(String prefix, File parent) throws IOException { - if (parent != null) { - return Files.createTempDirectory(parent.toPath(), prefix).toFile(); - } else { - return Files.createTempDirectory(prefix).toFile(); - } - } -} +package org.simantics.scl.runtime.io; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; + +public class FileIO { + + public static void moveFile(File source, File target) throws IOException { + Files.move(source.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + + public static void copyFile(File source, File target) throws IOException { + Files.copy(source.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + + public static void syncFile(File file) throws IOException { + try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { + raf.getFD().sync(); + } + } + + public static File createTempDirectory(String prefix, File parent) throws IOException { + if (parent != null) { + return Files.createTempDirectory(parent.toPath(), prefix).toFile(); + } else { + return Files.createTempDirectory(prefix).toFile(); + } + } +}