Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2008-01-25 17:03:55 +0000
committerPascal Rapicault2008-01-25 17:03:55 +0000
commit9b94747f14bc3ee609bba102400160660272512e (patch)
treef89f5bf782850038e06ddf238c2e4f87de5e9d6d
parent716e3883e49455ae87033e2945e1eb8642909d75 (diff)
downloadrt.equinox.p2-9b94747f14bc3ee609bba102400160660272512e.tar.gz
rt.equinox.p2-9b94747f14bc3ee609bba102400160660272512e.tar.xz
rt.equinox.p2-9b94747f14bc3ee609bba102400160660272512e.zip
cleanups and translation
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties22
3 files changed, 28 insertions, 15 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
index 8e5e8b4ce..ef7ec7f0c 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
@@ -25,6 +25,11 @@ public class Messages extends NLS {
// Do not instantiate
}
+ public static String artifact_not_found;
+ public static String available_already_in;
+ public static String cant_get_outputstream;
+ public static String downloading;
+ public static String error_closing_stream;
public static String repoMan_exists;
public static String repoMan_failedRead;
public static String repoMan_internalError;
@@ -35,5 +40,6 @@ public class Messages extends NLS {
public static String io_failedRead;
public static String io_parseError;
public static String io_incompatibleVersion;
+ public static String mirroring;
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
index 74c444cb5..1ff643c5d 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
@@ -18,6 +18,7 @@ import org.eclipse.equinox.p2.artifact.repository.*;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStepDescriptor;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStepHandler;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.osgi.util.NLS;
public class MirrorRequest extends ArtifactRequest {
private static final ProcessingStepDescriptor[] EMPTY_STEPS = new ProcessingStepDescriptor[0];
@@ -47,10 +48,10 @@ public class MirrorRequest extends ArtifactRequest {
}
public void perform(IProgressMonitor monitor) {
- monitor.subTask("Downloading " + getArtifactKey().getId());
+ monitor.subTask(NLS.bind(Messages.downloading, getArtifactKey().getId()));
// Do we already have the artifact in the target?
if (target.contains(getArtifactKey())) {
- setResult(new Status(IStatus.OK, Activator.ID, "The artifact is already available in the repo."));
+ setResult(new Status(IStatus.OK, Activator.ID, NLS.bind(Messages.available_already_in, getArtifactKey())));
return;
}
@@ -67,7 +68,7 @@ public class MirrorRequest extends ArtifactRequest {
else if (ProcessingStepHandler.canProcess(descriptors[i]))
optimized = descriptors[i];
}
- boolean chooseCanonical = source.getLocation().getProtocol().equals("file");
+ boolean chooseCanonical = source.getLocation().getProtocol().equals("file"); //$NON-NLS-1$
// If the source repo is local then look for a canonical descriptor so we don't waste processing time.
descriptor = chooseCanonical ? canonical : optimized;
// if the descriptor is still null then we could not find our first choice of format so switch the logic.
@@ -80,7 +81,7 @@ public class MirrorRequest extends ArtifactRequest {
// TODO improve the reporting here. It may be the case that the repo has the artifact
// but the client does not have a processor
if (descriptor == null) {
- setResult(new Status(IStatus.ERROR, Activator.ID, "Artifact requested can't be found:" + getArtifactKey()));
+ setResult(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.artifact_not_found, getArtifactKey())));
return;
}
@@ -102,7 +103,7 @@ public class MirrorRequest extends ArtifactRequest {
OutputStream destination = target.getOutputStream(destinationDescriptor);
if (destination == null) {
- setResult(new Status(IStatus.ERROR, Activator.ID, "Can't get an output stream to " + target + " to store " + getArtifactKey()));
+ setResult(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.cant_get_outputstream, target, getArtifactKey())));
return;
}
@@ -114,12 +115,12 @@ public class MirrorRequest extends ArtifactRequest {
try {
destination.close();
} catch (IOException e) {
- setResult(new Status(IStatus.ERROR, Activator.ID, "Error closing the output stream for " + getArtifactKey() + "on repo " + target.getLocation(), e));
+ setResult(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.error_closing_stream, getArtifactKey(), target.getLocation()), e));
}
}
}
public String toString() {
- return "Mirroring: " + getArtifactKey() + " into " + target;
+ return Messages.mirroring + getArtifactKey() + " into " + target; //$NON-NLS-2$
}
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
index c88e8115b..b66d5f7df 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
@@ -8,16 +8,22 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
+available_already_in=The artifact is already available in the repo {0}.
+cant_get_outputstream=Can't get an output stream to {0} store {1}.
+downloading=Downloading {0}.
+error_closing_stream=Error closing the output stream for {0} on repo {1}.
+artifact_not_found=Artifact requested can't be found {0}.
FileDownloadError=Error downloading {0} to {1}.
-io_failedRead=Unable to read repository at {0}
+io_failedRead=Unable to read repository at {0}.
io_parseError=\
- Error parsing simple artifact repository
+ Error parsing simple artifact repository.
io_incompatibleVersion=\
- Simple artifact repository has incompatible version {0}; expected {1}
-repoMan_exists=Repository already exists at {0}
-repoMan_failedRead=The repository could not be read: {0}
-repoMan_internalError=Internal error
-repoMan_notExists=No repository found at {0}
-repoMan_unknownType=Unknown repository type at {0}
+ Simple artifact repository has incompatible version {0}; expected {1}.
+mirroring=Mirroring:
+repoMan_exists=Repository already exists at {0}.
+repoMan_failedRead=The repository could not be read: {0}.
+repoMan_internalError=Internal error.
+repoMan_notExists=No repository found at {0}.
+repoMan_unknownType=Unknown repository type at {0}.
\ No newline at end of file

Back to the top