Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2009-05-20 18:12:47 +0000
committerVictor Roldan Betancort2009-05-20 18:12:47 +0000
commite87578beb3393762ec4175a6ec8eb1a1aab9ee17 (patch)
tree4f55f0df32833b47483bd835b8e82958418a884b /plugins/org.eclipse.net4j.http.common
parent0a979565f2cce67cf15709444f0a93e189a5194b (diff)
downloadcdo-e87578beb3393762ec4175a6ec8eb1a1aab9ee17.tar.gz
cdo-e87578beb3393762ec4175a6ec8eb1a1aab9ee17.tar.xz
cdo-e87578beb3393762ec4175a6ec8eb1a1aab9ee17.zip
[272193] [UI] Externalize Strings (Net4j)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=272193
Diffstat (limited to 'plugins/org.eclipse.net4j.http.common')
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java11
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/Messages.java41
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/messages.properties11
3 files changed, 58 insertions, 5 deletions
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
index 25bc85dbac..8e9bd76aae 100644
--- a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
@@ -15,6 +15,7 @@ import org.eclipse.net4j.channel.ChannelException;
import org.eclipse.net4j.connector.ConnectorException;
import org.eclipse.net4j.http.common.IHTTPConnector;
import org.eclipse.net4j.http.internal.common.bundle.OM;
+import org.eclipse.net4j.http.internal.common.messages.Messages;
import org.eclipse.net4j.protocol.IProtocol;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
@@ -105,7 +106,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
if (TRACER.isEnabled())
{
- TRACER.format("Multiplexing {0} (count={1})", buffer.formatContent(true), outputOperationCount);
+ TRACER.format("Multiplexing {0} (count={1})", buffer.formatContent(true), outputOperationCount); //$NON-NLS-1$
}
outputOperations.add(new BufferChannelOperation(httpChannel.getID(), outputOperationCount, buffer));
@@ -168,7 +169,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
return;
default:
- throw new IOException("Invalid operation code: " + code);
+ throw new IOException("Invalid operation code: " + code); //$NON-NLS-1$
}
markLastTraffic();
@@ -353,7 +354,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
HTTPChannel channel = (HTTPChannel)inverseOpenChannel(getChannelID(), protocolID);
if (channel == null)
{
- throw new ConnectorException("Could not open channel");
+ throw new ConnectorException(Messages.getString("HTTPConnector.0")); //$NON-NLS-1$
}
channel.increaseInputOperationCount();
@@ -456,7 +457,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
int length = in.readShort();
if (TRACER.isEnabled())
{
- TRACER.format("Receiving Buffer operation: operationID={0}, length={1}", getOperationCount(), length);
+ TRACER.format("Receiving Buffer operation: operationID={0}, length={1}", getOperationCount(), length); //$NON-NLS-1$
}
buffer = getConfig().getBufferProvider().provideBuffer();
@@ -483,7 +484,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
out.writeShort(length);
if (TRACER.isEnabled())
{
- TRACER.format("Transmitting Buffer operation: operationID={0}, length={1}", getOperationCount(), length);
+ TRACER.format("Transmitting Buffer operation: operationID={0}, length={1}", getOperationCount(), length); //$NON-NLS-1$
}
for (int i = 0; i < length; i++)
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/Messages.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/Messages.java
new file mode 100644
index 0000000000..9d6becd868
--- /dev/null
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/Messages.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.net4j.http.internal.common.messages;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class Messages
+{
+ private static final String BUNDLE_NAME = "org.eclipse.net4j.http.internal.common.messages.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/messages.properties b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/messages.properties
new file mode 100644
index 0000000000..dca19eaf4f
--- /dev/null
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/messages/messages.properties
@@ -0,0 +1,11 @@
+# Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Victor Roldan Betancort - initial API and implementation
+# Eike Stepper - maintenance
+
+HTTPConnector.0=Could not open channel

Back to the top