[Zerofile-svn] SF.net SVN: zerofile: [74] trunk/src
Status: Pre-Alpha
Brought to you by:
karl-bengtsson
|
From: <kar...@us...> - 2007-12-04 15:46:48
|
Revision: 74
http://zerofile.svn.sourceforge.net/zerofile/?rev=74&view=rev
Author: karl-bengtsson
Date: 2007-12-04 07:46:53 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
added skeleton http server without any functionality
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Added Paths:
-----------
trunk/src/HttpServer.java
Added: trunk/src/HttpServer.java
===================================================================
--- trunk/src/HttpServer.java (rev 0)
+++ trunk/src/HttpServer.java 2007-12-04 15:46:53 UTC (rev 74)
@@ -0,0 +1,41 @@
+import java.net.*;
+import java.io.*;
+import java.util.*;
+import java.lang.*;
+
+public class HttpServer {
+ private int _portNr;
+ private File[] _files;
+ private XMPPLinkLocalChatSession _session;
+ private Boolean _running;
+ public void start()
+ {
+ _running = true;
+ }
+ public void stop()
+ {
+ _running = false;
+ }
+ HttpServer(XMPPLinkLocalChatSession session)
+ {
+ _session = session;
+ if (!_running)
+ start();
+ }
+ public void addFile(File filen)
+ {
+
+ }
+ public void removeFile(File filen)
+ {
+
+ }
+ public int getPort()
+ {
+ return _portNr;
+ }
+ public Boolean isRunnin()
+ {
+ return _running;
+ }
+}
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 15:32:18 UTC (rev 73)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 15:46:53 UTC (rev 74)
@@ -15,6 +15,7 @@
private PrintWriter _toRemoteHost;
private ZeroFileChatWindow _chatWindow;
private XMPPLinkLocalHost _chatPartner;
+ private HttpServer _httpServer = new HttpServer(this);
private Thread _remoteHostReadingThread = new Thread() {
public void run() {
@@ -52,6 +53,7 @@
public void offerFileTransfer(String localFileNameAndPath)
{
File filen = new File(localFileNameAndPath);
+ _httpServer.addFile(filen);
long sizeOfFile = filen.length();
String filnamn = filen.getName();
String fileTransferStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body></body>";
@@ -176,6 +178,7 @@
public XMPPLinkLocalChatSession(Socket s)
{
_s = s;
+
try
{
_fromRemoteHost = new InputStreamReader(_s.getInputStream());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|