diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..473df07 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,16 @@ +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties + +# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) +!/.mvn/wrapper/maven-wrapper.jar + +/.classpath +/.project +.settings diff --git a/bin/LICENSE b/bin/LICENSE new file mode 100644 index 0000000..2edde68 --- /dev/null +++ b/bin/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Geoffrey Arthaud + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/bin/README.md b/bin/README.md new file mode 100644 index 0000000..33f60ac --- /dev/null +++ b/bin/README.md @@ -0,0 +1,2 @@ +# Quiz n° 3 du cours OpenClassrooms d'installation de Eclipse pour Java +Dépôt pour le quiz du cours OpenClassrooms "Installez votre environnement de développement Java avec Eclipse". Il contient des erreurs de syntaxe et des bugs. Bon courage... diff --git a/bin/pom.xml b/bin/pom.xml new file mode 100644 index 0000000..8882df9 --- /dev/null +++ b/bin/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + com.openclassrooms.ideinstall + quiz-example + 1.0.0-SNAPSHOT + + + net.imagej + ij + 1.52o + + + commons-codec + commons-codec + 1.12 + + + \ No newline at end of file diff --git a/bin/src/main/java/com/openclassrooms/ideinstall/QuizExample.class b/bin/src/main/java/com/openclassrooms/ideinstall/QuizExample.class new file mode 100644 index 0000000..b80b661 Binary files /dev/null and b/bin/src/main/java/com/openclassrooms/ideinstall/QuizExample.class differ diff --git a/bin/src/main/resources/hibou.jpg b/bin/src/main/resources/hibou.jpg new file mode 100644 index 0000000..ac45ec2 Binary files /dev/null and b/bin/src/main/resources/hibou.jpg differ diff --git a/bin/src/main/resources/lama.jpg b/bin/src/main/resources/lama.jpg new file mode 100644 index 0000000..a83e588 Binary files /dev/null and b/bin/src/main/resources/lama.jpg differ diff --git a/bin/src/main/resources/lapin.jpg b/bin/src/main/resources/lapin.jpg new file mode 100644 index 0000000..1123085 Binary files /dev/null and b/bin/src/main/resources/lapin.jpg differ diff --git a/bin/src/main/resources/oiseau.jpg b/bin/src/main/resources/oiseau.jpg new file mode 100644 index 0000000..323ee27 Binary files /dev/null and b/bin/src/main/resources/oiseau.jpg differ diff --git a/bin/src/main/resources/renard.jpg b/bin/src/main/resources/renard.jpg new file mode 100644 index 0000000..445d276 Binary files /dev/null and b/bin/src/main/resources/renard.jpg differ diff --git a/src/main/java/com/openclassrooms/ideinstall/QuizExample.java b/src/main/java/com/openclassrooms/ideinstall/QuizExample.java index 3395ef3..2d33493 100644 --- a/src/main/java/com/openclassrooms/ideinstall/QuizExample.java +++ b/src/main/java/com/openclassrooms/ideinstall/QuizExample.java @@ -7,27 +7,33 @@ import org.apache.commons.codec.binary.Base64; import ij.IJ; +import ij.ImagePlus; public class QuizExample { public static void main(String[] args) throws IOException, InterruptedException { final int compteARebours = 5; - System.out.println("Compte à rebours !") - for (int i = compteARebours; i <= compteARebours; i--) { + System.out.println("Compte à rebours !"); + for (int i = compteARebours; i>0; i--) { System.out.println("--> " + i); Thread.sleep(1000); } final Path cheminImage = cheminFichier(choixSecret()); final ImagePlus imp = IJ.openImage(cheminImage.toString()); - imp.show();Files.delete(cheminImage);Files.delete(cheminImage.getParent()); + imp.show(); + Files.delete(cheminImage); + Files.delete(cheminImage.getParent()); } - public static String choixSecret() {return new String(Base64.decodeBase64("bGFwaW4="));} + public static String choixSecret() { + return new String(Base64.decodeBase64("bGFwaW4=")); + } public static Path cheminFichier(String image) throws IOException { - final String nomImage = image + ".jpg"; - final Path tmpDir = Files.createTempDirectory(image); - final Path cheminFichier = tmpDir.resolve(nomImage); - Files.copy(QuizExample.class.getClassLoader().getResourceAsStream(nomImage), cheminFichier); - return cheminFichier;} + final String nomImage = image + ".jpg"; + final Path tmpDir = Files.createTempDirectory(image); + final Path cheminFichier = tmpDir.resolve(nomImage); + Files.copy(QuizExample.class.getClassLoader().getResourceAsStream(nomImage), cheminFichier); + return cheminFichier; + } }