diff options
author | slewis | 2010-09-09 17:57:28 +0000 |
---|---|---|
committer | slewis | 2010-09-09 17:57:28 +0000 |
commit | f7a7ef896f94d4f85e98f22d9ffd04c7b05ed883 (patch) | |
tree | d0e92dcedb81e3410792ca1963d903be60a9b75c /providers/bundles | |
parent | 59296defb9b433adf06993c5c43b88d9b32ac3ab (diff) | |
download | org.eclipse.ecf-f7a7ef896f94d4f85e98f22d9ffd04c7b05ed883.tar.gz org.eclipse.ecf-f7a7ef896f94d4f85e98f22d9ffd04c7b05ed883.tar.xz org.eclipse.ecf-f7a7ef896f94d4f85e98f22d9ffd04c7b05ed883.zip |
Removed NLS references.
Diffstat (limited to 'providers/bundles')
5 files changed, 15 insertions, 79 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.bittorrent/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.bittorrent/META-INF/MANIFEST.MF index c2c3c6997..8a3879f5c 100644 --- a/providers/bundles/org.eclipse.ecf.provider.bittorrent/META-INF/MANIFEST.MF +++ b/providers/bundles/org.eclipse.ecf.provider.bittorrent/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.ecf.provider.bittorrent;singleton:=true -Bundle-Version: 0.3.100.qualifier +Bundle-Version: 0.3.200.qualifier Bundle-Activator: org.eclipse.ecf.internal.provider.bittorrent.BitTorrentProviderPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -16,7 +16,6 @@ Require-Bundle: org.eclipse.ecf, org.eclipse.ecf.provider.filetransfer, org.eclipse.equinox.common Import-Package: org.eclipse.osgi.service.datalocation;version="1.0.0", - org.eclipse.osgi.util, org.osgi.framework, org.osgi.service.url, org.osgi.util.tracker diff --git a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentContainer.java b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentContainer.java index f954bf4c2..dc86af634 100644 --- a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentContainer.java +++ b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentContainer.java @@ -42,7 +42,6 @@ import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransfer; import org.eclipse.ecf.protocol.bittorrent.Torrent; import org.eclipse.ecf.protocol.bittorrent.TorrentFactory; import org.eclipse.ecf.protocol.bittorrent.TorrentFile; -import org.eclipse.osgi.util.NLS; public final class BitTorrentContainer implements IContainer, IRetrieveFileTransfer { @@ -108,9 +107,9 @@ public final class BitTorrentContainer implements IContainer, IRetrieveFileTrans } public void sendRetrieveRequest(final IFileID remoteFileReference, final IFileTransferListener transferListener, Map options) throws IncomingFileTransferException { - Assert.isNotNull(remoteFileReference, NLS.bind(BitTorrentMessages.BitTorrentContainer_NullParameter, "remoteFileReference")); //$NON-NLS-1$ - Assert.isLegal(remoteFileReference instanceof TorrentID, NLS.bind(BitTorrentMessages.BitTorrentContainer_ReferenceNotTorrentID, "remoteFileReference")); //$NON-NLS-1$ - Assert.isNotNull(transferListener, NLS.bind(BitTorrentMessages.BitTorrentContainer_NullParameter, "transferListener")); //$NON-NLS-1$ + Assert.isNotNull(remoteFileReference, "remoteFileReference cannot be null"); //$NON-NLS-1$ + Assert.isLegal(remoteFileReference instanceof TorrentID, "remoteFileReference must be instanceof TorrentID"); //$NON-NLS-1$ + Assert.isNotNull(transferListener, "transferListener cannot be null"); //$NON-NLS-1$ transferListener.handleTransferEvent(new IIncomingFileTransferReceiveStartEvent() { @@ -125,10 +124,10 @@ public final class BitTorrentContainer implements IContainer, IRetrieveFileTrans throw new RuntimeException(new UserCancelledException()); } - Assert.isNotNull(localFileToSave, NLS.bind(BitTorrentMessages.BitTorrentContainer_NullParameter, "localFileToSave")); //$NON-NLS-1$ + Assert.isNotNull(localFileToSave, "localFileToSave cannot be null"); //$NON-NLS-1$ if (localFileToSave.exists() && !localFileToSave.canWrite()) { - throw new IOException(NLS.bind(BitTorrentMessages.BitTorrentContainer_CannotWriteToFile, localFileToSave.getAbsolutePath())); + throw new IOException("file="+localFileToSave.getAbsolutePath()+" does not exist or cannot be written to"); //$NON-NLS-1$ //$NON-NLS-2$ } final TorrentFile file = new TorrentFile(((TorrentID) remoteFileReference).getFile()); @@ -143,10 +142,10 @@ public final class BitTorrentContainer implements IContainer, IRetrieveFileTrans throw new RuntimeException(new UserCancelledException()); } - Assert.isNotNull(localFileToSave, NLS.bind(BitTorrentMessages.BitTorrentContainer_NullParameter, "localFileToSave")); //$NON-NLS-1$ + Assert.isNotNull(localFileToSave, "localFileToSave must not be null"); //$NON-NLS-1$ if (localFileToSave.exists() && !localFileToSave.canWrite()) { - throw new IOException(NLS.bind(BitTorrentMessages.BitTorrentContainer_CannotWriteToFile, localFileToSave.getAbsolutePath())); + throw new IOException("file="+localFileToSave.getAbsolutePath()+" does not exist or cannot be written to"); //$NON-NLS-1$ //$NON-NLS-2$ } final TorrentFile file = new TorrentFile(((TorrentID) remoteFileReference).getFile()); @@ -168,11 +167,11 @@ public final class BitTorrentContainer implements IContainer, IRetrieveFileTrans } public IIncomingFileTransfer receive(OutputStream streamToStore) throws IOException { - throw new UnsupportedOperationException(BitTorrentMessages.BitTorrentContainer_CannotWriteToStream); + throw new UnsupportedOperationException("receive(OutputStream) not supported by this provider"); } public IIncomingFileTransfer receive(OutputStream streamToStore, FileTransferJob fileTransferJob) throws IOException { - throw new UnsupportedOperationException(BitTorrentMessages.BitTorrentContainer_CannotWriteToStream); + throw new UnsupportedOperationException("receive(OutputStream,FileTransferJob) not supported by this provider"); } public IIncomingFileTransfer getSource() { diff --git a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentMessages.java b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentMessages.java deleted file mode 100644 index 99710066c..000000000 --- a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentMessages.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Remy Suen, Composent Inc., 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: - * Remy Suen <remy.suen@gmail.com> - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.internal.provider.bittorrent; - -import org.eclipse.osgi.util.NLS; - -public final class BitTorrentMessages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.provider.bittorrent.BitTorrentMessages"; //$NON-NLS-1$ - - public static String TorrentNamespace_InvalidParameter; - - public static String TorrentNamespace_FileIsDirectory; - - public static String TorrentNamespace_CannotReadFile; - - public static String BitTorrentContainer_ReferenceNotTorrentID; - - public static String BitTorrentContainer_CannotWriteToStream; - - public static String BitTorrentContainer_CannotWriteToFile; - - public static String BitTorrentContainer_NullParameter; - - static { - NLS.initializeMessages(BUNDLE_NAME, BitTorrentMessages.class); - } - -} diff --git a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentMessages.properties b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentMessages.properties deleted file mode 100644 index 95ec8b2b9..000000000 --- a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/BitTorrentMessages.properties +++ /dev/null @@ -1,19 +0,0 @@ -################################################################################ -# Copyright (c) 2006 Remy Suen -# 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: -# Remy Suen <remy.suen@gmail.com> - initial API and implementation -################################################################################ - -TorrentNamespace_InvalidParameter = The {0} parameter must be a java.lang.String or a java.io.File -TorrentNamespace_FileIsDirectory = The file {0} is a directory -TorrentNamespace_CannotReadFile = The file {0} cannot be read - -BitTorrentContainer_ReferenceNotTorrentID = {0} must be a TorrentID -BitTorrentContainer_CannotWriteToStream = The contents specified by a torrent file cannot be downloaded onto a stream -BitTorrentContainer_CannotWriteToFile = The file {0} cannot be written to -BitTorrentContainer_NullParameter = The {0} parameter is null diff --git a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentNamespace.java b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentNamespace.java index 887b30486..60259beed 100644 --- a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentNamespace.java +++ b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentNamespace.java @@ -15,7 +15,6 @@ import java.io.File; import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.identity.IDCreateException; import org.eclipse.ecf.core.identity.Namespace; -import org.eclipse.osgi.util.NLS; public final class TorrentNamespace extends Namespace { @@ -25,8 +24,7 @@ public final class TorrentNamespace extends Namespace { public ID createInstance(Object[] args) throws IDCreateException { if (args == null || args.length == 0) { - throw new IDCreateException( - BitTorrentMessages.TorrentNamespace_InvalidParameter); + throw new IDCreateException("parameters cannot be null or of 0 length"); } else { File file = null; if (args[0] instanceof String) { @@ -34,20 +32,16 @@ public final class TorrentNamespace extends Namespace { } else if (args[0] instanceof File) { file = (File) args[0]; } else { - throw new IDCreateException( - BitTorrentMessages.TorrentNamespace_InvalidParameter); + throw new IDCreateException("parameter-0 must be of type File or String"); } if (file.isDirectory()) { - throw new IDCreateException(NLS.bind( - BitTorrentMessages.TorrentNamespace_FileIsDirectory, - file.getAbsolutePath())); + throw new IDCreateException("file="+ + file.getAbsolutePath()+" must not be a directory"); } else if (file.canRead()) { return new TorrentID(this, file); } else { - throw new IDCreateException(NLS.bind( - BitTorrentMessages.TorrentNamespace_CannotReadFile, - file.getAbsolutePath())); + throw new IDCreateException("file="+file.getAbsolutePath()+" cannot be read"); } } } |