diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-05-06 18:11:08 +0100 |
|---|---|---|
| committer | Ronca <alessandro.a.ronca@gmail.com> | 2015-05-06 18:20:58 +0100 |
| commit | f2909a748a300f94cf6067fc84416e408d3e6de8 (patch) | |
| tree | 02962a710fe27ea1c7a2704a356b7f663a42cb52 /src/uk | |
| parent | 58e6d87cb604702e7b307bad73c4fd42a694c3ec (diff) | |
| download | ACQuA-f2909a748a300f94cf6067fc84416e408d3e6de8.tar.gz ACQuA-f2909a748a300f94cf6067fc84416e408d3e6de8.zip | |
Switch from JUnit to TestNG.
Plus minor fixes.
Diffstat (limited to 'src/uk')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/util/Utility.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/util/Utility.java b/src/uk/ac/ox/cs/pagoda/util/Utility.java index cb05de4..7138ca9 100644 --- a/src/uk/ac/ox/cs/pagoda/util/Utility.java +++ b/src/uk/ac/ox/cs/pagoda/util/Utility.java | |||
| @@ -10,6 +10,8 @@ import java.io.IOException; | |||
| 10 | import java.io.InputStreamReader; | 10 | import java.io.InputStreamReader; |
| 11 | import java.io.OutputStreamWriter; | 11 | import java.io.OutputStreamWriter; |
| 12 | import java.io.PrintStream; | 12 | import java.io.PrintStream; |
| 13 | import java.nio.file.Files; | ||
| 14 | import java.nio.file.Paths; | ||
| 13 | import java.text.SimpleDateFormat; | 15 | import java.text.SimpleDateFormat; |
| 14 | import java.time.LocalDateTime; | 16 | import java.time.LocalDateTime; |
| 15 | import java.time.format.DateTimeFormatter; | 17 | import java.time.format.DateTimeFormatter; |
| @@ -24,9 +26,11 @@ import java.util.Stack; | |||
| 24 | import org.apache.log4j.Logger; | 26 | import org.apache.log4j.Logger; |
| 25 | import org.semanticweb.HermiT.model.Atom; | 27 | import org.semanticweb.HermiT.model.Atom; |
| 26 | 28 | ||
| 29 | import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; | ||
| 30 | |||
| 27 | public class Utility { | 31 | public class Utility { |
| 28 | 32 | ||
| 29 | private static final Logger LOGS = null; // Logger.getLogger(""); | 33 | private static final Logger LOGS = Logger.getLogger("PAGOdA"); |
| 30 | 34 | ||
| 31 | public static final String JAVA_FILE_SEPARATOR = "/"; | 35 | public static final String JAVA_FILE_SEPARATOR = "/"; |
| 32 | public static final String FILE_SEPARATOR = System.getProperty("file.separator"); | 36 | public static final String FILE_SEPARATOR = System.getProperty("file.separator"); |
| @@ -255,4 +259,14 @@ public class Utility { | |||
| 255 | return iri.replace(FILE_SEPARATOR, JAVA_FILE_SEPARATOR).replace(" ", "%20"); | 259 | return iri.replace(FILE_SEPARATOR, JAVA_FILE_SEPARATOR).replace(" ", "%20"); |
| 256 | } | 260 | } |
| 257 | 261 | ||
| 262 | public static String combinePaths(String path1, String path2) { | ||
| 263 | File file1 = new File(path1); | ||
| 264 | File file2 = new File(file1, path2); | ||
| 265 | return file2.getPath(); | ||
| 266 | } | ||
| 267 | |||
| 268 | public static void copyFile(String src, String dst) throws IOException { | ||
| 269 | Files.copy(Paths.get(src), Paths.get(dst), REPLACE_EXISTING); | ||
| 270 | } | ||
| 271 | |||
| 258 | } | 272 | } |
