Author: dieppe
Date: 2008-02-26 02:31:04 +0000 (Tue, 26 Feb 2008)
New Revision: 18154
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Client.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientHello.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPut.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutComplexDir.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutDir.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Connection.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DirectFileEntry.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DiskFileEntry.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Message.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/RedirectFileEntry.java
trunk/apps/thingamablog/src/net/sf/thingamablog/util/io/ReplacingOutputStream.java
Log:
1.4 compatibility
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Client.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Client.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Client.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -36,10 +36,10 @@
private final Connection connection;
/** The identifiers the client filters messages for. */
- private List<String> identifiers = new ArrayList<String>();
+ private List identifiers = new ArrayList();
/** The queued messages. */
- private final List<Message> messageQueue = new ArrayList<Message>();
+ private final List messageQueue = new ArrayList();
/** Whether the client was disconnected. */
private boolean disconnected = false;
@@ -173,7 +173,7 @@
}
}
if (messageQueue.size() > 0) {
- return messageQueue.remove(0);
+ return (Message) messageQueue.remove(0);
}
}
return null;
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientHello.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientHello.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientHello.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -92,7 +92,6 @@
/**
* {@inheritDoc}
*/
- @Override
protected void write(Writer writer) throws IOException {
writer.write("Name=" + name + LINEFEED);
writer.write("ExpectedVersion=" + expectedVersion + LINEFEED);
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPut.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPut.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPut.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -195,7 +195,6 @@
/**
* {@inheritDoc}
*/
- @Override
protected void write(Writer writer) throws IOException {
super.write(writer);
writer.write("URI=" + uri + LINEFEED);
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutComplexDir.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutComplexDir.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutComplexDir.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -27,6 +27,7 @@
import java.io.InputStream;
import java.io.Writer;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import src.net.sf.thingamablog.util.io.Closer;
@@ -41,7 +42,7 @@
public class ClientPutComplexDir extends ClientPutDir {
/** The file entries of this directory. */
- private List<FileEntry> fileEntries = new ArrayList<FileEntry>();
+ private List fileEntries = new ArrayList();
/** Whether this request has payload. */
private boolean hasPayload = false;
@@ -101,11 +102,12 @@
/**
* {@inheritDoc}
*/
- @Override
protected void write(Writer writer) throws IOException {
super.write(writer);
int fileIndex = 0;
- for (FileEntry fileEntry: fileEntries) {
+ Iterator it = fileEntries.iterator();
+ while (it.hasNext()) {
+ FileEntry fileEntry = (FileEntry) it.next();
writer.write("Files." + fileIndex + ".Name=" +
fileEntry.getFilename() + LINEFEED);
if (fileEntry.getContentType() != null) {
writer.write("Files." + fileIndex +
".Metadata.ContentType=" + fileEntry.getContentType() + LINEFEED);
@@ -127,7 +129,6 @@
/**
* {@inheritDoc}
*/
- @Override
protected boolean hasPayload() {
return hasPayload;
}
@@ -135,7 +136,6 @@
/**
* {@inheritDoc}
*/
- @Override
protected long getPayloadLength() {
return payloadLength;
}
@@ -143,7 +143,6 @@
/**
* {@inheritDoc}
*/
- @Override
protected InputStream getPayload() {
if (payloadFile != null) {
try {
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutDir.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutDir.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/ClientPutDir.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -73,7 +73,6 @@
/**
* {@inheritDoc}
*/
- @Override
protected void write(Writer writer) throws IOException {
super.write(writer);
if (defaultName != null)
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Connection.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Connection.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Connection.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -29,6 +29,7 @@
import java.net.Socket;
import java.nio.charset.Charset;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import src.net.sf.thingamablog.util.io.Closer;
@@ -45,7 +46,7 @@
public class Connection {
/** The listeners that receive events from this connection. */
- private List<ConnectionListener> connectionListeners = new
ArrayList<ConnectionListener>();
+ private List connectionListeners = new ArrayList();
/** The node this connection is connected to. */
private final Node node;
@@ -113,7 +114,9 @@
* The received message
*/
protected void fireMessageReceived(Message message) {
- for (ConnectionListener connectionListener:
connectionListeners) {
+ Iterator it = connectionListeners.iterator();
+ while(it.hasNext()) {
+ ConnectionListener connectionListener =
(ConnectionListener) it.next();
connectionListener.messageReceived(this, message);
}
}
@@ -122,7 +125,9 @@
* Notifies listeners about the loss of the connection.
*/
protected void fireConnectionTerminated() {
- for (ConnectionListener connectionListener:
connectionListeners) {
+ Iterator it = connectionListeners.iterator();
+ while(it.hasNext()) {
+ ConnectionListener connectionListener =
(ConnectionListener) it.next();
connectionListener.connectionTerminated(this);
}
}
@@ -276,7 +281,6 @@
private class NodeReader implements Runnable {
/** The input stream to read from. */
- @SuppressWarnings("hiding")
private InputStream nodeInputStream;
/**
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DirectFileEntry.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DirectFileEntry.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DirectFileEntry.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -74,7 +74,6 @@
/**
* {@inheritDoc}
*/
- @Override
public String getName() {
return "direct";
}
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DiskFileEntry.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DiskFileEntry.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/DiskFileEntry.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -50,7 +50,6 @@
/**
* {@inheritDoc}
*/
- @Override
public String getName() {
return "disk";
}
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Message.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Message.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/Message.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -44,7 +44,7 @@
private String identifier = "";
/** The parameters of this message. */
- private Map<String, String> parameters = new HashMap<String, String>();
+ private Map parameters = new HashMap();
/** The payload. */
private InputStream payloadInputStream;
@@ -107,7 +107,7 @@
*
* @return All parameters of this message
*/
- public Set<Entry<String, String>> entrySet() {
+ public Set entrySet() {
return parameters.entrySet();
}
@@ -120,7 +120,7 @@
* @return The value of the parameter
*/
public String get(String key) {
- return parameters.get(key.toLowerCase());
+ return (String) parameters.get(key.toLowerCase());
}
/**
@@ -135,7 +135,7 @@
* previous value
*/
public String put(String key, String value) {
- return parameters.put(key.toLowerCase(), value);
+ return (String) parameters.put(key.toLowerCase(), value);
}
/**
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/RedirectFileEntry.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/RedirectFileEntry.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/freenet/fcp/RedirectFileEntry.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -31,7 +31,6 @@
/**
* {@inheritDoc}
*/
- @Override
public String getName() {
return "redirect";
}
Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/util/io/ReplacingOutputStream.java
===================================================================
---
trunk/apps/thingamablog/src/net/sf/thingamablog/util/io/ReplacingOutputStream.java
2008-02-26 02:01:21 UTC (rev 18153)
+++
trunk/apps/thingamablog/src/net/sf/thingamablog/util/io/ReplacingOutputStream.java
2008-02-26 02:31:04 UTC (rev 18154)
@@ -26,6 +26,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
/**
@@ -34,7 +35,7 @@
*/
public class ReplacingOutputStream extends FilterOutputStream {
- private Map<String, String> replacements = new HashMap<String,
String>();
+ private Map replacements = new HashMap();
private StringBuffer ringBuffer = new StringBuffer();
/**
@@ -51,15 +52,15 @@
/**
* {@inheritDoc}
*/
- @Override
public void write(int b) throws IOException {
ringBuffer.append((char) b);
- Iterator<Entry<String, String>> entries =
replacements.entrySet().iterator();
+ Set entrySet = replacements.entrySet();
+ Iterator entries = entrySet.iterator();
boolean found = false;
- Entry<String, String> entry = null;
+ Entry entry = null;
while (!found && entries.hasNext()) {
- entry = entries.next();
- if (entry.getKey().startsWith(ringBuffer.toString())) {
+ entry = (Entry) entries.next();
+ if (((String)
entry.getKey()).startsWith(ringBuffer.toString())) {
found = true;
}
}
@@ -71,7 +72,7 @@
ringBuffer.setLength(0);
} else {
if (entry.getKey().equals(ringBuffer.toString())) {
- String buffer = entry.getValue();
+ String buffer = (String) entry.getValue();
for (int index = 0, size = buffer.length();
index < size; index++) {
super.write(buffer.charAt(index));
}