Thread: [Zerofile-svn] SF.net SVN: zerofile: [64] trunk/src/XMPPLinkLocalChatSession.java
Status: Pre-Alpha
Brought to you by:
karl-bengtsson
|
From: <kar...@us...> - 2007-12-04 13:49:01
|
Revision: 64
http://zerofile.svn.sourceforge.net/zerofile/?rev=64&view=rev
Author: karl-bengtsson
Date: 2007-12-04 05:49:00 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 13:47:54 UTC (rev 63)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 13:49:00 UTC (rev 64)
@@ -120,6 +120,7 @@
if (stanza.contains("<x xmlns=\"jabber:x:oob\">"))
{
System.out.println(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
+ ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
// This is a file
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-04 14:13:12
|
Revision: 66
http://zerofile.svn.sourceforge.net/zerofile/?rev=66&view=rev
Author: karl-bengtsson
Date: 2007-12-04 06:11:48 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
Tjosan.
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:00:29 UTC (rev 65)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:11:48 UTC (rev 66)
@@ -1,5 +1,6 @@
import java.io.*;
import java.net.*;
+import javax.swing.*;
/*
* Class for handling chat sessions.
@@ -123,12 +124,15 @@
if (ZeroFileSettings.getCheckBox().equals("true"))
{
ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
- _chatWindow.printText("Downloading file from chat partner");
+ _chatWindow.printText("Downloaded file from chat partner");
}
else
{
- ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
- _chatWindow.printText("Downloading file from chat partner");
+ if (JOptionPane.showConfirmDialog(null, "Ta emot?", "Ta emot fil?", JOptionPane.YES_NO_OPTION) == 1)
+ {
+ ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
+ _chatWindow.printText("Downloaded file from chat partner");
+ }
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-04 14:25:37
|
Revision: 67
http://zerofile.svn.sourceforge.net/zerofile/?rev=67&view=rev
Author: karl-bengtsson
Date: 2007-12-04 06:25:40 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
We can now recieve files offered by iChat. Great success! Jagshemash!
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:11:48 UTC (rev 66)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:25:40 UTC (rev 67)
@@ -120,7 +120,6 @@
{
if (stanza.contains("<x xmlns=\"jabber:x:oob\">"))
{
- System.out.println(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
if (ZeroFileSettings.getCheckBox().equals("true"))
{
ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
@@ -133,6 +132,10 @@
ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
_chatWindow.printText("Downloaded file from chat partner");
}
+ else
+ {
+ // Skicka "jag vill inte ha din j\x8Avla fil-meddelande"
+ }
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-04 14:50:44
|
Revision: 70
http://zerofile.svn.sourceforge.net/zerofile/?rev=70&view=rev
Author: karl-bengtsson
Date: 2007-12-04 06:50:49 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
buggfix
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:50:04 UTC (rev 69)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:50:49 UTC (rev 70)
@@ -64,7 +64,7 @@
String fileTransferStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body></body></message>";
fileTransferStanza += "<x xmlns=\"jabber:x:oob\">";
fileTransferStanza += "<url type=\"file\" size=\""+String.valueOf(sizeOfFile)+"\">";
- fileTransferStanza += "http://10.100.46.243:5297/25E8656B83FBA3A2/"+localFileNameAndPath+"</url></x></message>";
+ fileTransferStanza += "http://10.100.46.243:5297/25E8656B83FBA3A2/"+filnamn+"</url></x></message>";
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-04 14:52:14
|
Revision: 71
http://zerofile.svn.sourceforge.net/zerofile/?rev=71&view=rev
Author: karl-bengtsson
Date: 2007-12-04 06:52:16 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
test2
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:50:49 UTC (rev 70)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:52:16 UTC (rev 71)
@@ -51,6 +51,7 @@
public void offerFileTransfer(String localFileNameAndPath)
{
+ System.out.println(localFileNameAndPath);
int lastSlashIndex = localFileNameAndPath.lastIndexOf('/');
if (!(lastSlashIndex >= 0 && lastSlashIndex < localFileNameAndPath.length() - 1))
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-04 15:19:08
|
Revision: 72
http://zerofile.svn.sourceforge.net/zerofile/?rev=72&view=rev
Author: karl-bengtsson
Date: 2007-12-04 07:19:07 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
now we try to send the file transfer stanza
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 14:52:16 UTC (rev 71)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 15:19:07 UTC (rev 72)
@@ -51,22 +51,15 @@
public void offerFileTransfer(String localFileNameAndPath)
{
- System.out.println(localFileNameAndPath);
- int lastSlashIndex = localFileNameAndPath.lastIndexOf('/');
- if (!(lastSlashIndex >= 0 && lastSlashIndex < localFileNameAndPath.length() - 1))
- {
- System.out.println("blaaargh, felaktigt filnamn");
- }
- else
- {
- File filen = new File(localFileNameAndPath);
- long sizeOfFile = filen.length();
- String filnamn = localFileNameAndPath.substring(lastSlashIndex + 1);
- String fileTransferStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body></body></message>";
- fileTransferStanza += "<x xmlns=\"jabber:x:oob\">";
- fileTransferStanza += "<url type=\"file\" size=\""+String.valueOf(sizeOfFile)+"\">";
- fileTransferStanza += "http://10.100.46.243:5297/25E8656B83FBA3A2/"+filnamn+"</url></x></message>";
- }
+ File filen = new File(localFileNameAndPath);
+ long sizeOfFile = filen.length();
+ String filnamn = filen.getName();
+ String fileTransferStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body></body></message>";
+ fileTransferStanza += "<x xmlns=\"jabber:x:oob\">";
+ fileTransferStanza += "<url type=\"file\" size=\""+String.valueOf(sizeOfFile)+"\">";
+ fileTransferStanza += "http://10.100.46.243:5297/25E8656B83FBA3A2/"+filnamn+"</url></x></message>";
+ _toRemoteHost.print(fileTransferStanza);
+ _toRemoteHost.flush();
}
public XMPPLinkLocalChatSession(XMPPLinkLocalHost hostToChatWith)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-04 15:32:19
|
Revision: 73
http://zerofile.svn.sourceforge.net/zerofile/?rev=73&view=rev
Author: karl-bengtsson
Date: 2007-12-04 07:32:18 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
We can now offer files workingly. sort of.
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 15:19:07 UTC (rev 72)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-04 15:32:18 UTC (rev 73)
@@ -54,7 +54,7 @@
File filen = new File(localFileNameAndPath);
long sizeOfFile = filen.length();
String filnamn = filen.getName();
- String fileTransferStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body></body></message>";
+ String fileTransferStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body></body>";
fileTransferStanza += "<x xmlns=\"jabber:x:oob\">";
fileTransferStanza += "<url type=\"file\" size=\""+String.valueOf(sizeOfFile)+"\">";
fileTransferStanza += "http://10.100.46.243:5297/25E8656B83FBA3A2/"+filnamn+"</url></x></message>";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-13 13:47:50
|
Revision: 79
http://zerofile.svn.sourceforge.net/zerofile/?rev=79&view=rev
Author: karl-bengtsson
Date: 2007-12-13 05:47:52 -0800 (Thu, 13 Dec 2007)
Log Message:
-----------
bugfix
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 13:42:14 UTC (rev 78)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 13:47:52 UTC (rev 79)
@@ -68,7 +68,7 @@
fileTransferStanza += "<url type=\"file\" size=\""+String.valueOf(sizeOfFile)+"\">";
fileTransferStanza += "http://"+InetAddress.getLocalHost().getHostAddress()+":"+_httpServer.getPort()+"/"+filnamn+"</url></x></message>";
ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(fileTransferStanza));
- _toRemoteHost.print(bbuf);
+ _toRemoteHost.print(bbuf.toString());
_toRemoteHost.flush();
}
catch (Exception e)
@@ -102,6 +102,7 @@
private void RecievedStanza(String stanza)
{
+ System.out.println(stanza);
if (stanza.contains("<?xml"))
// Stanza is a handshake
{
@@ -211,7 +212,7 @@
{
String messageStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body>"+m+"</body></message>";
ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(messageStanza));
- _toRemoteHost.print(bbuf);
+ _toRemoteHost.print(bbuf.toString());
_toRemoteHost.flush();
}
catch (Exception e)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-13 13:49:36
|
Revision: 80
http://zerofile.svn.sourceforge.net/zerofile/?rev=80&view=rev
Author: karl-bengtsson
Date: 2007-12-13 05:49:41 -0800 (Thu, 13 Dec 2007)
Log Message:
-----------
bugfix
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 13:47:52 UTC (rev 79)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 13:49:41 UTC (rev 80)
@@ -68,7 +68,7 @@
fileTransferStanza += "<url type=\"file\" size=\""+String.valueOf(sizeOfFile)+"\">";
fileTransferStanza += "http://"+InetAddress.getLocalHost().getHostAddress()+":"+_httpServer.getPort()+"/"+filnamn+"</url></x></message>";
ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(fileTransferStanza));
- _toRemoteHost.print(bbuf.toString());
+ _toRemoteHost.print(bbuf.asCharBuffer().toString());
_toRemoteHost.flush();
}
catch (Exception e)
@@ -212,7 +212,7 @@
{
String messageStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body>"+m+"</body></message>";
ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(messageStanza));
- _toRemoteHost.print(bbuf.toString());
+ _toRemoteHost.print(bbuf.asCharBuffer().toString());
_toRemoteHost.flush();
}
catch (Exception e)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-13 13:57:46
|
Revision: 81
http://zerofile.svn.sourceforge.net/zerofile/?rev=81&view=rev
Author: karl-bengtsson
Date: 2007-12-13 05:57:51 -0800 (Thu, 13 Dec 2007)
Log Message:
-----------
thrown out old code
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 13:49:41 UTC (rev 80)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 13:57:51 UTC (rev 81)
@@ -67,8 +67,7 @@
fileTransferStanza += "<x xmlns=\"jabber:x:oob\">";
fileTransferStanza += "<url type=\"file\" size=\""+String.valueOf(sizeOfFile)+"\">";
fileTransferStanza += "http://"+InetAddress.getLocalHost().getHostAddress()+":"+_httpServer.getPort()+"/"+filnamn+"</url></x></message>";
- ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(fileTransferStanza));
- _toRemoteHost.print(bbuf.asCharBuffer().toString());
+ _toRemoteHost.print(fileTransferStanza);
_toRemoteHost.flush();
}
catch (Exception e)
@@ -85,7 +84,7 @@
{
_s = new Socket(hostToChatWith.getHost(),hostToChatWith.getPort());
_toRemoteHost = new PrintWriter(_s.getOutputStream());
- _fromRemoteHost = new InputStreamReader(_s.getInputStream(),"UTF-8");
+ _fromRemoteHost = new InputStreamReader(_s.getInputStream());
_remoteHostReadingThread.start();
sendHandshake();
}
@@ -211,8 +210,7 @@
try
{
String messageStanza = "<message to=\""+_chatPartner.getServiceName()+"\" from=\""+ZeroconfRegistration.getMyServiceName()+"\"><body>"+m+"</body></message>";
- ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(messageStanza));
- _toRemoteHost.print(bbuf.asCharBuffer().toString());
+ _toRemoteHost.print(messageStanza);
_toRemoteHost.flush();
}
catch (Exception e)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-12-13 14:51:31
|
Revision: 85
http://zerofile.svn.sourceforge.net/zerofile/?rev=85&view=rev
Author: karl-bengtsson
Date: 2007-12-13 06:51:29 -0800 (Thu, 13 Dec 2007)
Log Message:
-----------
More status text updates on file transfer
Modified Paths:
--------------
trunk/src/XMPPLinkLocalChatSession.java
Modified: trunk/src/XMPPLinkLocalChatSession.java
===================================================================
--- trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 14:47:19 UTC (rev 84)
+++ trunk/src/XMPPLinkLocalChatSession.java 2007-12-13 14:51:29 UTC (rev 85)
@@ -147,6 +147,7 @@
String fileName = urlToFile.substring(urlToFile.lastIndexOf("/")+1).replace("%20"," ");
if (ZeroFileSettings.getCheckBox().equals("true"))
{
+ _chatWindow.printText("Now downloading file \"" + fileName + "\" from chat partner");
ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
_chatWindow.printText("Downloaded file \""+ fileName + "\" from chat partner");
}
@@ -154,6 +155,7 @@
{
if (JOptionPane.showConfirmDialog(null, _chatPartner.toString() + "is sending you the file \""+fileName+"\". Do you wish to accept this file transfer?","Ta emot?", JOptionPane.YES_NO_OPTION) == 0)
{
+ _chatWindow.printText("Now downloading file \"" + fileName + "\" from chat partner");
ZeroFile.downloadFileFromHTTP(XMPPDOMParser.getUrlFromFileTransferStanza(stanza));
_chatWindow.printText("Downloaded file \""+ fileName + "\" from chat partner");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|