aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/musichub/business
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/musichub/business/PathValidation.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/musichub/business/PathValidation.java b/src/main/java/musichub/business/PathValidation.java
new file mode 100644
index 0000000..b0281ba
--- /dev/null
+++ b/src/main/java/musichub/business/PathValidation.java
@@ -0,0 +1,39 @@
+package musichub.business;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * Class offering a path validation method.
+ *
+ * @author Aimeric ADJUTOR
+ * @version 1.0
+ */
+
+public final class PathValidation {
+
+ /**
+ * Method that just throws an AssertionError if the class is called
+ *
+ * @throws AssertionError you can't instantiate this class
+ * @author Aimeric ADJUTOR
+ */
+
+ public PathValidation() {
+ throw new AssertionError("You just can't instantiate this class.");
+ }
+
+ /**
+ * Method that checks the validity of a given path
+ *
+ * @param inputPath the path given by the user
+ * @return a boolean
+ */
+
+ public static boolean isPathValid(String inputPath) {
+ Path path = Paths.get(inputPath);
+ return Files.exists(path);
+ }
+
+} \ No newline at end of file
ckages for controllersClyhtsuriva8-8/+8 etting serialization working with a songClyhtsuriva3-7/+36 2020-12-11adding Serialization interface and methodsClyhtsuriva6-59/+63 2020-12-07Big updateMasfehico6-16/+99 2020-12-07cleaning and adding stuff in playlistMasfehico3-2/+20 2020-12-07Updating song and audiobook accordingly to the last commitMasfehico2-8/+8 2020-12-07Adding the enum classesMasfehico3-0/+9 2020-12-07Updating song, audiobook and musical elements's sets and getsMasfehico3-5/+23 2020-12-07Finishing MusicalElement.javaMasfehico1-6/+11 2020-11-23Cleaning upMasfehico2-30/+0 2020-11-23Deleting the CSVSMasfehico5-3669/+0 2020-11-23Minor testing changesMasfehico7-43/+63 2020-11-23Musical elements updated and jMusicHub basic creationMasfehico2-0/+0 2020-11-23Musical elements updated and jMusicHub basic creationMasfehico4-3/+74 2020-11-21README.md updatedMasfehico1-3/+1 2020-11-19Started Song and MusicalElementMasfehico5-0/+190 2020-11-18Added CSVsMasfehico9-102/+3756 2020-11-18Firs filesMasfehico8-0/+103 2020-11-17LICENSE updatedMasfehico1-68/+81