From 266f03b0bfea4184e12fef3e92fcba4df9881d74 Mon Sep 17 00:00:00 2001 From: Younouss Date: Tue, 7 Apr 2015 15:25:26 +0200 Subject: [PATCH 1/3] version finale --- README.TXT | 13 + ngetv1/build.xml | 73 + ngetv1/dist/README.TXT | 32 + ngetv1/dist/ngetv1.jar | Bin 0 -> 5361 bytes ngetv1/manifest.mf | 3 + ngetv1/nbproject/build-impl.xml | 1407 +++++++++++++++++++ ngetv1/nbproject/genfiles.properties | 8 + ngetv1/nbproject/private/private.properties | 2 + ngetv1/nbproject/private/private.xml | 9 + ngetv1/nbproject/project.properties | 73 + ngetv1/nbproject/project.xml | 15 + ngetv1/src/ngetv1/Ngetv1.java | 127 ++ 12 files changed, 1762 insertions(+) create mode 100644 README.TXT create mode 100644 ngetv1/build.xml create mode 100644 ngetv1/dist/README.TXT create mode 100644 ngetv1/dist/ngetv1.jar create mode 100644 ngetv1/manifest.mf create mode 100644 ngetv1/nbproject/build-impl.xml create mode 100644 ngetv1/nbproject/genfiles.properties create mode 100644 ngetv1/nbproject/private/private.properties create mode 100644 ngetv1/nbproject/private/private.xml create mode 100644 ngetv1/nbproject/project.properties create mode 100644 ngetv1/nbproject/project.xml create mode 100644 ngetv1/src/ngetv1/Ngetv1.java diff --git a/README.TXT b/README.TXT new file mode 100644 index 0000000..9d053e1 --- /dev/null +++ b/README.TXT @@ -0,0 +1,13 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + + + +1- Pour lancer l'application, commencer tout d'abord par vous rendre dans votre terminal de commande. + +2- Rendez vous dans C:\...\Students-niang-younouss-nget-v1\ngetv1\dist + +3- Une fois placer dans le dossier, utilisez la commande java -jar ngetv1.jar + +L'application est désormais lancée. \ No newline at end of file diff --git a/ngetv1/build.xml b/ngetv1/build.xml new file mode 100644 index 0000000..cdba3ef --- /dev/null +++ b/ngetv1/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ngetv1. + + + diff --git a/ngetv1/dist/README.TXT b/ngetv1/dist/README.TXT new file mode 100644 index 0000000..b5e594b --- /dev/null +++ b/ngetv1/dist/README.TXT @@ -0,0 +1,32 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "ngetv1.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, these files (folders) +are not copied. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/ngetv1/dist/ngetv1.jar b/ngetv1/dist/ngetv1.jar new file mode 100644 index 0000000000000000000000000000000000000000..6de63db61998d39351c0a9847c6c4a63ef35e4fc GIT binary patch literal 5361 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 literal 0 HcmV?d00001 diff --git a/ngetv1/manifest.mf b/ngetv1/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/ngetv1/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/ngetv1/nbproject/build-impl.xml b/ngetv1/nbproject/build-impl.xml new file mode 100644 index 0000000..a1dc911 --- /dev/null +++ b/ngetv1/nbproject/build-impl.xml @@ -0,0 +1,1407 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ngetv1/nbproject/genfiles.properties b/ngetv1/nbproject/genfiles.properties new file mode 100644 index 0000000..2d168ec --- /dev/null +++ b/ngetv1/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d1f0e7f6 +build.xml.script.CRC32=e289bffa +build.xml.stylesheet.CRC32=8064a381@1.68.1.46 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=d1f0e7f6 +nbproject/build-impl.xml.script.CRC32=388073d2 +nbproject/build-impl.xml.stylesheet.CRC32=5a01deb7@1.68.1.46 diff --git a/ngetv1/nbproject/private/private.properties b/ngetv1/nbproject/private/private.properties new file mode 100644 index 0000000..1a59211 --- /dev/null +++ b/ngetv1/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Younouss\\AppData\\Roaming\\NetBeans\\7.4\\build.properties diff --git a/ngetv1/nbproject/private/private.xml b/ngetv1/nbproject/private/private.xml new file mode 100644 index 0000000..207d6c0 --- /dev/null +++ b/ngetv1/nbproject/private/private.xml @@ -0,0 +1,9 @@ + + + + + + file:/C:/Users/Younouss/Documents/Students-niang-younouss-nget-v1/ngetv1/src/ngetv1/Ngetv1.java + + + diff --git a/ngetv1/nbproject/project.properties b/ngetv1/nbproject/project.properties new file mode 100644 index 0000000..dbeefd4 --- /dev/null +++ b/ngetv1/nbproject/project.properties @@ -0,0 +1,73 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ngetv1.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=ngetv1.Ngetv1 +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/ngetv1/nbproject/project.xml b/ngetv1/nbproject/project.xml new file mode 100644 index 0000000..0084f15 --- /dev/null +++ b/ngetv1/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ngetv1 + + + + + + + + + diff --git a/ngetv1/src/ngetv1/Ngetv1.java b/ngetv1/src/ngetv1/Ngetv1.java new file mode 100644 index 0000000..7717b33 --- /dev/null +++ b/ngetv1/src/ngetv1/Ngetv1.java @@ -0,0 +1,127 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package ngetv1; + +import java.io.BufferedInputStream; +import java.io.BufferedWriter; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Scanner; + +/** + * + * @author Younouss + */ +public class Ngetv1 { + + /** + * @param args the command line arguments + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + @SuppressWarnings("empty-statement") + public static void main(String[] args) throws FileNotFoundException, IOException { + // TODO code application logic here + System.out.println("Veuillez entrer votre ligne de commande"); + + Scanner scan = new Scanner(System.in); + String commande = scan.nextLine(); + String[] commandeSplited = commande.split("\\s+"); + if(commandeSplited[0] !=null && commandeSplited[1] !=null) + { + switch (commandeSplited[1]) { + case "get": + String url = commandeSplited[3].replaceAll("\"",""); + System.out.println(url); + HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); + conn.connect(); + + BufferedInputStream bis = new BufferedInputStream(conn.getInputStream()); + + byte[] bytes = new byte[1024]; + int tmp ; + if(commandeSplited.length<4) + System.out.println("Erreur, la commande doit ĂȘtre du format: nget.exe get -url \"MonUrl\" "); + if(commandeSplited.length==4) + { + while( (tmp = bis.read(bytes) ) != -1 ) + { + String chaine = new String(bytes,0,tmp); + System.out.println(chaine); + } + } + else if(commandeSplited.length>4 && (commandeSplited[4].replaceAll("-","")).equals("save")) + { + String path = commandeSplited[5].replaceAll("\"",""); + try + { + + FileWriter fw = new FileWriter(path, true); + try (BufferedWriter output = new BufferedWriter(fw)) { + while( (tmp = bis.read(bytes) ) != -1 ) + { + String chaine = new String(bytes,0,tmp); + output.write(chaine); + output.write("\r\n"); + } + output.flush(); + } + System.out.println("fichier créé"); + } + catch(IOException ioe){ + System.out.print("Erreur : "); + } + + } + conn.disconnect(); + break; + case "test": + String url2 = commandeSplited[3].replaceAll("\"",""); + HttpURLConnection connect = (HttpURLConnection) new URL(url2).openConnection(); + int timeVal = Integer.valueOf(commandeSplited[5]); + long startTime,moy=0; + if(commandeSplited.length<6) + System.out.println("Erreur, la commande doit ĂȘtre du format: nget.exe test -url \"MonUrl\" -times MaValeur"); + else if(commandeSplited.length==6) + { + if(timeVal > 0) + { + for(int i=0; i< timeVal;++i) + { + startTime = System.currentTimeMillis(); + connect.connect(); + System.out.println("Temps de chargement "+i+": "+ (System.currentTimeMillis() - startTime)); + connect.disconnect(); + } + } + else System.out.println("Erreur, veuillez indiquer un nombre positif"); + } + else if(commandeSplited.length>=7 && (commandeSplited[6].replaceAll("-","")).equals("avg")) + { + if(timeVal > 0) + { + for(int i=0; i< timeVal;++i) + { + startTime = System.currentTimeMillis(); + connect.connect(); + moy = moy+ System.currentTimeMillis() - startTime; + connect.disconnect(); + } + moy = moy/timeVal; + System.out.println("Temps de chargement moyen de chargement: "+ moy); + } + else System.out.println("Erreur, veuillez indiquer un nombre positif"); + } + break; + } + }else System.out.println("Erreur, la commande doit ĂȘtre du format: nget.exe get -url \"MonUrl\" pour un GET et pour un TEST le format est : nget.exe test -url \"MonUrl\" -times MaValeur "); + + } +} From a65c13c2faade54eb8ebf5a4ff391eb1a2522f72 Mon Sep 17 00:00:00 2001 From: Younouss Date: Tue, 7 Apr 2015 15:29:46 +0200 Subject: [PATCH 2/3] ReadMe --- README.TXT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.TXT b/README.TXT index 9d053e1..8327d5b 100644 --- a/README.TXT +++ b/README.TXT @@ -6,7 +6,7 @@ BUILD OUTPUT DESCRIPTION 1- Pour lancer l'application, commencer tout d'abord par vous rendre dans votre terminal de commande. -2- Rendez vous dans C:\...\Students-niang-younouss-nget-v1\ngetv1\dist +2- Rendez vous dans C:\...\ngetv1\dist 3- Une fois placer dans le dossier, utilisez la commande java -jar ngetv1.jar From 2433fe535944f4bcffc30b0caef2d28131d23d0b Mon Sep 17 00:00:00 2001 From: Younouss Date: Tue, 7 Apr 2015 15:32:25 +0200 Subject: [PATCH 3/3] Finale. --- ngetv1/src/ngetv1/Ngetv1.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ngetv1/src/ngetv1/Ngetv1.java b/ngetv1/src/ngetv1/Ngetv1.java index 7717b33..c62bd3c 100644 --- a/ngetv1/src/ngetv1/Ngetv1.java +++ b/ngetv1/src/ngetv1/Ngetv1.java @@ -34,8 +34,7 @@ public static void main(String[] args) throws FileNotFoundException, IOException Scanner scan = new Scanner(System.in); String commande = scan.nextLine(); String[] commandeSplited = commande.split("\\s+"); - if(commandeSplited[0] !=null && commandeSplited[1] !=null) - { + switch (commandeSplited[1]) { case "get": String url = commandeSplited[3].replaceAll("\"",""); @@ -121,7 +120,5 @@ else if(commandeSplited.length>=7 && (commandeSplited[6].replaceAll("-","")).equ } break; } - }else System.out.println("Erreur, la commande doit ĂȘtre du format: nget.exe get -url \"MonUrl\" pour un GET et pour un TEST le format est : nget.exe test -url \"MonUrl\" -times MaValeur "); - } }