diff options
Diffstat (limited to 'src/com')
3 files changed, 23 insertions, 5 deletions
diff --git a/src/com/isode/stroke/filetransfer/FileTransfer.java b/src/com/isode/stroke/filetransfer/FileTransfer.java index e12b07d..f3e7bba 100644 --- a/src/com/isode/stroke/filetransfer/FileTransfer.java +++ b/src/com/isode/stroke/filetransfer/FileTransfer.java | |||
| @@ -63,8 +63,10 @@ public interface FileTransfer { | |||
| 63 | 63 | ||
| 64 | public long getFileSizeInBytes(); | 64 | public long getFileSizeInBytes(); |
| 65 | 65 | ||
| 66 | public void setFileInfo(final String name, long size); | 66 | public void setFileInfo(final String name, long size, String description); |
| 67 | 67 | ||
| 68 | public State getState(); | 68 | public State getState(); |
| 69 | 69 | ||
| 70 | public String getDescription(); | ||
| 71 | |||
| 70 | } | 72 | } |
diff --git a/src/com/isode/stroke/filetransfer/IncomingJingleFileTransfer.java b/src/com/isode/stroke/filetransfer/IncomingJingleFileTransfer.java index f7f9c70..60cde19 100644 --- a/src/com/isode/stroke/filetransfer/IncomingJingleFileTransfer.java +++ b/src/com/isode/stroke/filetransfer/IncomingJingleFileTransfer.java | |||
| @@ -32,6 +32,7 @@ import com.isode.stroke.jingle.JingleContentID; | |||
| 32 | import com.isode.stroke.signals.SignalConnection; | 32 | import com.isode.stroke.signals.SignalConnection; |
| 33 | import com.isode.stroke.signals.Slot1; | 33 | import com.isode.stroke.signals.Slot1; |
| 34 | import com.isode.stroke.signals.Slot; | 34 | import com.isode.stroke.signals.Slot; |
| 35 | |||
| 35 | import java.util.logging.Logger; | 36 | import java.util.logging.Logger; |
| 36 | import java.util.Vector; | 37 | import java.util.Vector; |
| 37 | import java.util.Map; | 38 | import java.util.Map; |
| @@ -41,6 +42,7 @@ public class IncomingJingleFileTransfer extends JingleFileTransfer implements In | |||
| 41 | 42 | ||
| 42 | private long fileSizeInBytes = 0; //FileTransferVariables | 43 | private long fileSizeInBytes = 0; //FileTransferVariables |
| 43 | private String filename = ""; //FileTransferVariables | 44 | private String filename = ""; //FileTransferVariables |
| 45 | private String ft_description = ""; //FileTransferVariables | ||
| 44 | 46 | ||
| 45 | /** | 47 | /** |
| 46 | * FileTransferMethod. | 48 | * FileTransferMethod. |
| @@ -62,9 +64,10 @@ public class IncomingJingleFileTransfer extends JingleFileTransfer implements In | |||
| 62 | * FileTransferMethod. | 64 | * FileTransferMethod. |
| 63 | */ | 65 | */ |
| 64 | @Override | 66 | @Override |
| 65 | public void setFileInfo(final String name, long size) { | 67 | public void setFileInfo(final String name, long size, String description) { |
| 66 | this.filename = name; | 68 | this.filename = name; |
| 67 | this.fileSizeInBytes = size; | 69 | this.fileSizeInBytes = size; |
| 70 | this.ft_description = description; | ||
| 68 | } | 71 | } |
| 69 | 72 | ||
| 70 | private JingleContentPayload initialContent; | 73 | private JingleContentPayload initialContent; |
| @@ -99,7 +102,7 @@ public class IncomingJingleFileTransfer extends JingleFileTransfer implements In | |||
| 99 | this.description = initialContent.getDescription(new JingleFileTransferDescription()); | 102 | this.description = initialContent.getDescription(new JingleFileTransferDescription()); |
| 100 | assert(description != null); | 103 | assert(description != null); |
| 101 | JingleFileTransferFileInfo fileInfo = description.getFileInfo(); | 104 | JingleFileTransferFileInfo fileInfo = description.getFileInfo(); |
| 102 | setFileInfo(fileInfo.getName(), fileInfo.getSize()); | 105 | setFileInfo(fileInfo.getName(), fileInfo.getSize(), fileInfo.getDescription()); |
| 103 | hashes = fileInfo.getHashes(); | 106 | hashes = fileInfo.getHashes(); |
| 104 | 107 | ||
| 105 | waitOnHashTimer = timerFactory.createTimer(5000); | 108 | waitOnHashTimer = timerFactory.createTimer(5000); |
| @@ -501,4 +504,9 @@ public class IncomingJingleFileTransfer extends JingleFileTransfer implements In | |||
| 501 | terminate(JinglePayload.Reason.Type.MediaError); | 504 | terminate(JinglePayload.Reason.Type.MediaError); |
| 502 | } | 505 | } |
| 503 | } | 506 | } |
| 507 | |||
| 508 | @Override | ||
| 509 | public String getDescription() { | ||
| 510 | return ft_description; | ||
| 511 | } | ||
| 504 | } \ No newline at end of file | 512 | } \ No newline at end of file |
diff --git a/src/com/isode/stroke/filetransfer/OutgoingJingleFileTransfer.java b/src/com/isode/stroke/filetransfer/OutgoingJingleFileTransfer.java index 63a11e8..f32821b 100644 --- a/src/com/isode/stroke/filetransfer/OutgoingJingleFileTransfer.java +++ b/src/com/isode/stroke/filetransfer/OutgoingJingleFileTransfer.java | |||
| @@ -37,6 +37,7 @@ import com.isode.stroke.jingle.JingleContentID; | |||
| 37 | import com.isode.stroke.signals.SignalConnection; | 37 | import com.isode.stroke.signals.SignalConnection; |
| 38 | import com.isode.stroke.signals.Slot1; | 38 | import com.isode.stroke.signals.Slot1; |
| 39 | import com.isode.stroke.signals.Slot; | 39 | import com.isode.stroke.signals.Slot; |
| 40 | |||
| 40 | import java.util.logging.Logger; | 41 | import java.util.logging.Logger; |
| 41 | import java.util.Vector; | 42 | import java.util.Vector; |
| 42 | 43 | ||
| @@ -44,6 +45,7 @@ public class OutgoingJingleFileTransfer extends JingleFileTransfer implements Ou | |||
| 44 | 45 | ||
| 45 | private long fileSizeInBytes = 0; //FileTransferVariables | 46 | private long fileSizeInBytes = 0; //FileTransferVariables |
| 46 | private String filename = ""; //FileTransferVariables | 47 | private String filename = ""; //FileTransferVariables |
| 48 | private String ft_description = ""; // FileTransferVariables | ||
| 47 | 49 | ||
| 48 | /** | 50 | /** |
| 49 | * FileTransferMethod. | 51 | * FileTransferMethod. |
| @@ -65,9 +67,10 @@ public class OutgoingJingleFileTransfer extends JingleFileTransfer implements Ou | |||
| 65 | * FileTransferMethod. | 67 | * FileTransferMethod. |
| 66 | */ | 68 | */ |
| 67 | @Override | 69 | @Override |
| 68 | public void setFileInfo(final String name, long size) { | 70 | public void setFileInfo(final String name, long size, String description) { |
| 69 | this.filename = name; | 71 | this.filename = name; |
| 70 | this.fileSizeInBytes = size; | 72 | this.fileSizeInBytes = size; |
| 73 | this.ft_description = description; | ||
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | public static final int DEFAULT_BLOCK_SIZE = 4096; | 76 | public static final int DEFAULT_BLOCK_SIZE = 4096; |
| @@ -105,7 +108,7 @@ public class OutgoingJingleFileTransfer extends JingleFileTransfer implements Ou | |||
| 105 | this.contentID = new JingleContentID(idGenerator.generateID(), JingleContentPayload.Creator.InitiatorCreator); | 108 | this.contentID = new JingleContentID(idGenerator.generateID(), JingleContentPayload.Creator.InitiatorCreator); |
| 106 | this.internalState = State.Initial; | 109 | this.internalState = State.Initial; |
| 107 | this.candidateAcknowledged = false; | 110 | this.candidateAcknowledged = false; |
| 108 | setFileInfo(fileInfo.getName(), fileInfo.getSize()); | 111 | setFileInfo(fileInfo.getName(), fileInfo.getSize(), fileInfo.getDescription()); |
| 109 | 112 | ||
| 110 | // calculate both, MD5 and SHA-1 since we don't know which one the other side supports | 113 | // calculate both, MD5 and SHA-1 since we don't know which one the other side supports |
| 111 | hashCalculator = new IncrementalBytestreamHashCalculator(true, true, crypto); | 114 | hashCalculator = new IncrementalBytestreamHashCalculator(true, true, crypto); |
| @@ -449,4 +452,9 @@ public class OutgoingJingleFileTransfer extends JingleFileTransfer implements Ou | |||
| 449 | return FileTransfer.State.Type.Initial; | 452 | return FileTransfer.State.Type.Initial; |
| 450 | } | 453 | } |
| 451 | 454 | ||
| 455 | @Override | ||
| 456 | public String getDescription() { | ||
| 457 | return ft_description; | ||
| 458 | } | ||
| 459 | |||
| 452 | } \ No newline at end of file | 460 | } \ No newline at end of file |
Swift