Skip to content
Snippets Groups Projects
Commit 3545461f authored by Ferhat Hocine's avatar Ferhat Hocine
Browse files

premier rendu

parent df3fc378
No related branches found
No related tags found
No related merge requests found
Showing
with 287 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>serveurFTP</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sr.projet2</groupId>
<artifactId>serveurFTP</artifactId>
<version>1.0-SNAPSHOT</version>
<name>serveurFTP</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
package sr.projet2;
import java.io.IOException;
import sr.projet2.Server.ConnectionServer;
public class Main {
public static void main(String[] args) throws IOException{
ConnectionServer server=new ConnectionServer(2000);
server.serverConnect();
}
}
package sr.projet2.Server;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class ConnectionServer {
private int PORT;
private ServerSocket srvSckt;
public ConnectionServer (int PORT) throws IOException {
this.PORT=PORT;
server();
}
public void server() throws IOException {
try {
this.srvSckt=new ServerSocket(this.PORT);
}
catch (IOException e) {
throw new IOException("Connexion failed");
}
}
public void serverConnect() throws IOException {
try {
Socket socket=this.srvSckt.accept();
BufferedReader bfR =new BufferedReader(new InputStreamReader(socket.getInputStream()));
BufferedWriter bfW = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
bfW.write("220 FTP SERVER\r\n");
bfW.flush();
}
catch(IOException e){
e.printStackTrace();
}
}
}
package sr.projet2;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
File added
File added
#Created by Apache Maven 3.6.3
groupId=sr.projet2
artifactId=serveurFTP
version=1.0-SNAPSHOT
/home/hocine/eclipse-workspace/serveurFTP/src/main/java/sr/projet2/Server/ConnectionServer.java
/home/hocine/eclipse-workspace/serveurFTP/src/main/java/sr/projet2/Main.java
/home/hocine/eclipse-workspace/serveurFTP/src/test/java/sr/projet2/AppTest.java
File added
<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="sr.projet2.AppTest" time="0.033" tests="1" errors="0" skipped="0" failures="0">
<properties>
<property name="sun.desktop" value="gnome"/>
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
<property name="java.specification.version" value="11"/>
<property name="sun.cpu.isalist" value=""/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.class.path" value="/home/hocine/eclipse-workspace/serveurFTP/target/test-classes:/home/hocine/eclipse-workspace/serveurFTP/target/classes:/home/hocine/.m2/repository/junit/junit/4.11/junit-4.11.jar:/home/hocine/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:"/>
<property name="java.vm.vendor" value="Ubuntu"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.vendor.url" value="https://ubuntu.com/"/>
<property name="user.timezone" value=""/>
<property name="java.vm.specification.version" value="11"/>
<property name="os.name" value="Linux"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="user.country" value="FR"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-11-openjdk-amd64/lib"/>
<property name="sun.java.command" value="/home/hocine/eclipse-workspace/serveurFTP/target/surefire/surefirebooter14701359487179658639.jar /home/hocine/eclipse-workspace/serveurFTP/target/surefire 2021-02-11T00-09-40_142-jvmRun1 surefire2274530294192485131tmp surefire_017171065220829500292tmp"/>
<property name="jdk.debug" value="release"/>
<property name="surefire.test.class.path" value="/home/hocine/eclipse-workspace/serveurFTP/target/test-classes:/home/hocine/eclipse-workspace/serveurFTP/target/classes:/home/hocine/.m2/repository/junit/junit/4.11/junit-4.11.jar:/home/hocine/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:"/>
<property name="sun.cpu.endian" value="little"/>
<property name="user.home" value="/home/hocine"/>
<property name="user.language" value="fr"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.version.date" value="2021-01-19"/>
<property name="java.home" value="/usr/lib/jvm/java-11-openjdk-amd64"/>
<property name="file.separator" value="/"/>
<property name="basedir" value="/home/hocine/eclipse-workspace/serveurFTP"/>
<property name="java.vm.compressedOopsMode" value="32-bit"/>
<property name="line.separator" value="&#10;"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
<property name="surefire.real.class.path" value="/home/hocine/eclipse-workspace/serveurFTP/target/surefire/surefirebooter14701359487179658639.jar"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="java.runtime.version" value="11.0.10+9-Ubuntu-0ubuntu1.20.04"/>
<property name="user.name" value="hocine"/>
<property name="path.separator" value=":"/>
<property name="os.version" value="5.4.0-65-generic"/>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="localRepository" value="/home/hocine/.m2/repository"/>
<property name="java.vendor.url.bug" value="https://bugs.launchpad.net/ubuntu/+source/openjdk-lts"/>
<property name="java.io.tmpdir" value="/tmp"/>
<property name="java.version" value="11.0.10"/>
<property name="user.dir" value="/home/hocine/eclipse-workspace/serveurFTP"/>
<property name="os.arch" value="amd64"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
<property name="sun.os.patch.level" value="unknown"/>
<property name="java.library.path" value="/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="java.vendor" value="Ubuntu"/>
<property name="java.vm.version" value="11.0.10+9-Ubuntu-0ubuntu1.20.04"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="java.class.version" value="55.0"/>
</properties>
<testcase name="shouldAnswerWithTrue" classname="sr.projet2.AppTest" time="0.001"/>
</testsuite>
\ No newline at end of file
-------------------------------------------------------------------------------
Test set: sr.projet2.AppTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 s - in sr.projet2.AppTest
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment