Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Torregrosa Paez2016-04-18 08:06:16 +0000
committerPablo Torregrosa Paez2016-04-18 08:06:16 +0000
commit8d1fd1ff246742d8316151fdd03574c19290b596 (patch)
treef83401390cfb06ea244a0b70371279ee4eb7dac4
parent7e9010c1dfd9c377e72c7856589835f299f8ca2c (diff)
downloadorg.eclipse.tcf-8d1fd1ff246742d8316151fdd03574c19290b596.tar.gz
org.eclipse.tcf-8d1fd1ff246742d8316151fdd03574c19290b596.tar.xz
org.eclipse.tcf-8d1fd1ff246742d8316151fdd03574c19290b596.zip
Target Explorer: Added error code translator to File System operations
Change-Id: I8b46e092474236cae4afe3ba976d0ad3e8127c7a Signed-off-by: Pablo Torregrosa Paez <pablo.torregrosa@windriver.com>
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/TCFOperationMonitor.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCopy.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFile.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFolder.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUpload.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/utils/StatusHelper.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.java320
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.properties250
8 files changed, 349 insertions, 279 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/TCFOperationMonitor.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/TCFOperationMonitor.java
index 4be3efc09..83a5297fd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/TCFOperationMonitor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/TCFOperationMonitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Wind River Systems, Inc.
+ * Copyright (c) 2016 Wind River Systems, Inc.
* 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
@@ -162,6 +162,13 @@ public class TCFOperationMonitor<T> {
return setDone(createStatus(msg, th), null);
}
+ /**
+ * Method for reporting the completion of the operation with an error.
+ */
+ public IStatus setError(IStatus status) {
+ return setDone(status, null);
+ }
+
private IStatus createStatus(String msg, Throwable th) {
if (th != null) {
String msg2= th.getLocalizedMessage();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCopy.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCopy.java
index e25eba432..80cdf17a1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCopy.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCopy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2016 Wind River Systems, 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
@@ -28,6 +28,7 @@ import org.eclipse.tcf.te.tcf.core.concurrent.TCFOperationMonitor;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IConfirmCallback;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.runtime.IFSTreeNode;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
/**
@@ -112,13 +113,13 @@ public class OpCopy extends OpCopyBase<FSTreeNode> {
@Override
public void doneMkDir(IToken token, FileSystemException error) {
if (error != null) {
- result.setError(format(Messages.Operation_CannotCreateDirectory, newName), error);
+ result.setError(StatusHelper.createStatus(format(Messages.Operation_CannotCreateDirectory, newName), error));
} else if (!result.checkCancelled()) {
fileSystem.lstat(path, new DoneStat() {
@Override
public void doneStat(IToken token, FileSystemException error, FileAttrs attrs) {
if (error != null) {
- result.setError(format(Messages.Operation_CannotCreateDirectory, newName), error);
+ result.setError(StatusHelper.createStatus(format(Messages.Operation_CannotCreateDirectory, newName), error));
} else if (!result.checkCancelled()) {
FSTreeNode copy = new FSTreeNode(dest, newName, false, attrs);
copy.setContent(new FSTreeNode[0], false);
@@ -146,13 +147,13 @@ public class OpCopy extends OpCopyBase<FSTreeNode> {
@Override
public void doneCopy(IToken token, FileSystemException error) {
if (error != null) {
- result.setError(format(Messages.OpCopy_CannotCopyFile, source.getName()), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpCopy_CannotCopyFile, source.getName()), error));
} else if (!result.checkCancelled()) {
fileSystem.stat(path, new DoneStat() {
@Override
public void doneStat(IToken token, FileSystemException error, FileAttrs attrs) {
if (error != null) {
- result.setError(format(Messages.OpCopy_CannotCopyFile, source.getName()), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpCopy_CannotCopyFile, source.getName()), error));
} else if (!result.checkCancelled()) {
if (existing != null) {
existing.setAttributes(attrs, false);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFile.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFile.java
index b53627457..074daa3fe 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFile.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2016 Wind River Systems, 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
@@ -23,6 +23,7 @@ import org.eclipse.tcf.services.IFileSystem.FileSystemException;
import org.eclipse.tcf.services.IFileSystem.IFileHandle;
import org.eclipse.tcf.te.tcf.core.concurrent.TCFOperationMonitor;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
/**
@@ -51,19 +52,19 @@ public class OpCreateFile extends OpCreate {
@Override
public void doneOpen(IToken token, FileSystemException error, IFileHandle hdl) {
if (error != null) {
- result.setError(format(Messages.OpCreateFile_error_create, path), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpCreateFile_error_create, path), error));
} else if (!result.checkCancelled()) {
fileSystem.close(hdl, new DoneClose() {
@Override
public void doneClose(IToken token, FileSystemException error) {
if (error != null) {
- result.setError(format(Messages.OpCreateFile_error_create, path), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpCreateFile_error_create, path), error));
} else if (!result.checkCancelled()) {
fileSystem.stat(path, new DoneStat() {
@Override
public void doneStat(IToken token, FileSystemException error, FileAttrs attrs) {
if (error != null) {
- result.setError(format(Messages.OpCreateFile_error_create, path), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpCreateFile_error_create, path), error));
} else if (!result.checkCancelled()) {
FSTreeNode node = new FSTreeNode(destination, name, false, attrs);
destination.addNode(node, true);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFolder.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFolder.java
index 03913964d..657afe4aa 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFolder.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpCreateFolder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2016 Wind River Systems, 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
@@ -21,6 +21,7 @@ import org.eclipse.tcf.services.IFileSystem.FileAttrs;
import org.eclipse.tcf.services.IFileSystem.FileSystemException;
import org.eclipse.tcf.te.tcf.core.concurrent.TCFOperationMonitor;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
/**
@@ -49,13 +50,13 @@ public class OpCreateFolder extends OpCreate {
@Override
public void doneMkDir(IToken token, FileSystemException error) {
if (error != null) {
- result.setError(format(Messages.OpCreateFolder_error_createFolder, path), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpCreateFolder_error_createFolder, path), error));
} else if (!result.checkCancelled()) {
fileSystem.stat(path, new DoneStat() {
@Override
public void doneStat(IToken token, FileSystemException error, FileAttrs attrs) {
if (error != null) {
- result.setError(format(Messages.OpCreateFolder_error_createFolder, path), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpCreateFolder_error_createFolder, path), error));
} else if (!result.checkCancelled()) {
FSTreeNode node = new FSTreeNode(destination, name, false, attrs);
node.setContent(new FSTreeNode[0], false);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUpload.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUpload.java
index cc5863d00..25488d0c4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUpload.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUpload.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2016 Wind River Systems, 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
@@ -219,7 +219,7 @@ public class OpUpload extends AbstractOperation {
@Override
public void doneOpen(IToken token, FileSystemException error, IFileHandle handle) {
if (error != null) {
- result.setError(format(Messages.OpUpload_error_openFile, path), error);
+ result.setError(StatusHelper.createStatus(format(Messages.OpUpload_error_openFile, path), error));
} else {
result.setDone(new TCFFileOutputStream(handle));
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/utils/StatusHelper.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/utils/StatusHelper.java
index 5fbe2c113..331fbdd96 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/utils/StatusHelper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/utils/StatusHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Wind River Systems, Inc.
+ * Copyright (c) 2015, 2016 Wind River Systems, Inc.
* 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
@@ -12,13 +12,27 @@ package org.eclipse.tcf.te.tcf.filesystem.core.internal.utils;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.protocol.IErrorReport;
import org.eclipse.tcf.te.tcf.filesystem.core.activator.CorePlugin;
+import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
public class StatusHelper {
public static IStatus createStatus(String msg, Throwable e) {
if (e != null) {
- String msg2= e.getLocalizedMessage();
+ String msg2 = e.getLocalizedMessage();
+
+ // Try to find a translation for the error code
+ int errorCode = -1;
+ if (e instanceof IErrorReport) {
+ errorCode = ((IErrorReport) e).getErrorCode();
+ }
+ String errorMessageKey = NLS.bind(Messages.FileSystem_ErrorMessage_Errno_Base, Integer.valueOf(errorCode));
+ if (errorCode != -1 && Messages.hasString(errorMessageKey)) {
+ msg2 = Messages.getString(errorMessageKey);
+ }
+
if (msg2 != null) {
msg = msg == null ? msg2 : msg + ": " + msg2; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.java
index 41f8907e9..2395db311 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.java
@@ -1,139 +1,181 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, 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:
- * Wind River Systems - initial API and implementation
- * William Chen (Wind River) - [345384] Provide property pages for remote file system nodes
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.filesystem.core.nls;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * File System plug-in externalized strings management.
- */
-public class Messages extends NLS {
-
- // The plug-in resource bundle name
- private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages"; //$NON-NLS-1$
-
- /**
- * Static constructor.
- */
- static {
- // Load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- // **** Declare externalized string id's down here *****
-
- public static String FSTreeNodeContentProvider_rootNodeLabel;
- public static String FSTreeNode_TypeFile;
- public static String FSTreeNode_TypeFileFolder;
- public static String FSTreeNode_TypeLocalDisk;
- public static String FSTreeNode_TypeSystemFile;
- public static String FSTreeNode_TypeUnknownFile;
- public static String FSTreeNodeWorkingCopy_commitOperation_name;
-
- public static String Operation_NotResponding;
- public static String Operation_OpeningChannelFailureMessage;
- public static String Operation_NoFileSystemError;
- public static String Operation_CannotOpenDir;
- public static String Operation_CopyNOfFile;
- public static String Operation_CopyOfFile;
- public static String Operation_CannotCreateDirectory;
- public static String Operation_TimeoutOpeningChannel;
-
- public static String OpCacheFileDigest_error_updatingDigest;
- public static String OpCacheFileDigest_name;
- public static String OpCommitAttr_error_cannotSetAttributes;
- public static String OpCommitAttr_name;
- public static String OpCopy_Copying;
- public static String OpCopy_CannotCopyFile;
- public static String OpCopy_CopyingFile;
- public static String OpCopy_error_noDirectory;
- public static String OpCopy_error_noFile;
-
- public static String OpCreate_error_existingFile;
- public static String OpCreate_TaskName;
- public static String OpCreateFile_error_create;
- public static String OpCreateFolder_error_createFolder;
-
- public static String TcfURLConnection_errorInvalidURL;
- public static String TcfURLConnection_NoFileHandleReturned;
- public static String TcfURLConnection_NoPeerFound;
- public static String TcfURLConnection_NoSuchTcfAgent;
- public static String TcfURLConnection_relativePath;
-
- public static String OpDelete_Deleting;
- public static String OpDelete_error_delete;
- public static String OpDelete_error_readDir;
- public static String OpDelete_RemovingFileFolder;
-
- public static String OpDownload_Downloading;
- public static String OpDownload_DownloadingSingleFile;
-
- public static String OpMove_Moving;
- public static String OpMove_CannotMove;
- public static String OpMove_MovingFile;
-
- public static String OpParsePath_name;
-
- public static String OpRefresh_errorGetRoots;
- public static String OpRefresh_errorOpenDir;
- public static String OpRefresh_errorReadAttributes;
- public static String OpRefresh_name;
-
- public static String OpRename_TitleRename;
- public static String OpRestoreFavorites_name;
-
- public static String CacheManager_SetReadOnlyFailed;
- public static String OpStreamOp_Bytes;
- public static String OpStreamOp_KBs;
- public static String OpStreamOp_MBs;
- public static String OpTargetFileDigest_error_download;
- public static String OpTargetFileDigest_error_openFile;
-
- public static String OpUpload_error_openFile;
- public static String OpUpload_error_upload;
- public static String OpUpload_UploadingProgress;
- public static String OpUpload_UploadNFiles;
- public static String OpUpload_UploadSingleFile;
-
- public static String TcfInputStream_NoDataAvailable;
- public static String TcfInputStream_StreamClosed;
- public static String TcfOutputStream_StreamClosed;
- public static String TcfURLStreamHandlerService_ErrorURLFormat;
- public static String TcfURLStreamHandlerService_IllegalCharacter;
- public static String TcfURLStreamHandlerService_OnlyDiskPartError;
-
- public static String CacheManager_MkdirFailed;
-
- public static String FileTransferService_error_mkdirFailed;
- public static String BlockingFileSystemProxy_TimeoutOpeningFile;
- public static String BlockingFileSystemProxy_TimeoutClosingFile;
- public static String BlockingFileSystemProxy_TimeoutReadingFile;
- public static String BlockingFileSystemProxy_TimeoutWritingFile;
- public static String BlockingFileSystemProxy_TimeoutStat;
- public static String BlockingFileSystemProxy_TimeoutLstat;
- public static String BlockingFileSystemProxy_TimeoutFstat;
- public static String BlockingFileSystemProxy_TimeoutSetStat;
- public static String BlockingFileSystemProxy_TimeoutFSetStat;
- public static String BlockingFileSystemProxy_TimeoutOpeningDir;
- public static String BlockingFileSystemProxy_TimeoutReadingDir;
- public static String BlockingFileSystemProxy_TimeoutMakingDir;
- public static String BlockingFileSystemProxy_TimeoutRemovingDir;
- public static String BlockingFileSystemProxy_TimeoutListingRoots;
- public static String BlockingFileSystemProxy_TimeoutRemovingFile;
- public static String BlockingFileSystemProxy_TimeoutGettingRealPath;
- public static String BlockingFileSystemProxy_TimeoutRenamingFile;
- public static String BlockingFileSystemProxy_TimeoutReadingLink;
- public static String BlockingFileSystemProxy_TimeoutSymLink;
- public static String BlockingFileSystemProxy_TimeoutCopying;
- public static String BlockingFileSystemProxy_TimeoutGettingUser;
- public static String ModelManager_errorNoUserAccount;
- public static String ModelManager_errorOpenChannel;
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2016 Wind River Systems, 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:
+ * Wind River Systems - initial API and implementation
+ * William Chen (Wind River) - [345384] Provide property pages for remote file system nodes
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.filesystem.core.nls;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * File System plug-in externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /**
+ * Returns if or if not this NLS manager contains a constant for
+ * the given externalized strings key.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return <code>True</code> if a constant for the given key exists, <code>false</code> otherwise.
+ */
+ public static boolean hasString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ return field != null;
+ } catch (NoSuchFieldException e) { /* ignored on purpose */ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the corresponding string for the given externalized strings
+ * key or <code>null</code> if the key does not exist.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return The corresponding string or <code>null</code>.
+ */
+ public static String getString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ return (String)field.get(null);
+ } catch (Exception e) { /* ignored on purpose */ }
+ }
+
+ return null;
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String FSTreeNodeContentProvider_rootNodeLabel;
+ public static String FSTreeNode_TypeFile;
+ public static String FSTreeNode_TypeFileFolder;
+ public static String FSTreeNode_TypeLocalDisk;
+ public static String FSTreeNode_TypeSystemFile;
+ public static String FSTreeNode_TypeUnknownFile;
+ public static String FSTreeNodeWorkingCopy_commitOperation_name;
+
+ public static String Operation_NotResponding;
+ public static String Operation_OpeningChannelFailureMessage;
+ public static String Operation_NoFileSystemError;
+ public static String Operation_CannotOpenDir;
+ public static String Operation_CopyNOfFile;
+ public static String Operation_CopyOfFile;
+ public static String Operation_CannotCreateDirectory;
+ public static String Operation_TimeoutOpeningChannel;
+
+ public static String OpCacheFileDigest_error_updatingDigest;
+ public static String OpCacheFileDigest_name;
+ public static String OpCommitAttr_error_cannotSetAttributes;
+ public static String OpCommitAttr_name;
+ public static String OpCopy_Copying;
+ public static String OpCopy_CannotCopyFile;
+ public static String OpCopy_CopyingFile;
+ public static String OpCopy_error_noDirectory;
+ public static String OpCopy_error_noFile;
+
+ public static String OpCreate_error_existingFile;
+ public static String OpCreate_TaskName;
+ public static String OpCreateFile_error_create;
+ public static String OpCreateFolder_error_createFolder;
+
+ public static String TcfURLConnection_errorInvalidURL;
+ public static String TcfURLConnection_NoFileHandleReturned;
+ public static String TcfURLConnection_NoPeerFound;
+ public static String TcfURLConnection_NoSuchTcfAgent;
+ public static String TcfURLConnection_relativePath;
+
+ public static String OpDelete_Deleting;
+ public static String OpDelete_error_delete;
+ public static String OpDelete_error_readDir;
+ public static String OpDelete_RemovingFileFolder;
+
+ public static String OpDownload_Downloading;
+ public static String OpDownload_DownloadingSingleFile;
+
+ public static String OpMove_Moving;
+ public static String OpMove_CannotMove;
+ public static String OpMove_MovingFile;
+
+ public static String OpParsePath_name;
+
+ public static String OpRefresh_errorGetRoots;
+ public static String OpRefresh_errorOpenDir;
+ public static String OpRefresh_errorReadAttributes;
+ public static String OpRefresh_name;
+
+ public static String OpRename_TitleRename;
+ public static String OpRestoreFavorites_name;
+
+ public static String CacheManager_SetReadOnlyFailed;
+ public static String OpStreamOp_Bytes;
+ public static String OpStreamOp_KBs;
+ public static String OpStreamOp_MBs;
+ public static String OpTargetFileDigest_error_download;
+ public static String OpTargetFileDigest_error_openFile;
+
+ public static String OpUpload_error_openFile;
+ public static String OpUpload_error_upload;
+ public static String OpUpload_UploadingProgress;
+ public static String OpUpload_UploadNFiles;
+ public static String OpUpload_UploadSingleFile;
+
+ public static String TcfInputStream_NoDataAvailable;
+ public static String TcfInputStream_StreamClosed;
+ public static String TcfOutputStream_StreamClosed;
+ public static String TcfURLStreamHandlerService_ErrorURLFormat;
+ public static String TcfURLStreamHandlerService_IllegalCharacter;
+ public static String TcfURLStreamHandlerService_OnlyDiskPartError;
+
+ public static String CacheManager_MkdirFailed;
+
+ public static String FileTransferService_error_mkdirFailed;
+ public static String BlockingFileSystemProxy_TimeoutOpeningFile;
+ public static String BlockingFileSystemProxy_TimeoutClosingFile;
+ public static String BlockingFileSystemProxy_TimeoutReadingFile;
+ public static String BlockingFileSystemProxy_TimeoutWritingFile;
+ public static String BlockingFileSystemProxy_TimeoutStat;
+ public static String BlockingFileSystemProxy_TimeoutLstat;
+ public static String BlockingFileSystemProxy_TimeoutFstat;
+ public static String BlockingFileSystemProxy_TimeoutSetStat;
+ public static String BlockingFileSystemProxy_TimeoutFSetStat;
+ public static String BlockingFileSystemProxy_TimeoutOpeningDir;
+ public static String BlockingFileSystemProxy_TimeoutReadingDir;
+ public static String BlockingFileSystemProxy_TimeoutMakingDir;
+ public static String BlockingFileSystemProxy_TimeoutRemovingDir;
+ public static String BlockingFileSystemProxy_TimeoutListingRoots;
+ public static String BlockingFileSystemProxy_TimeoutRemovingFile;
+ public static String BlockingFileSystemProxy_TimeoutGettingRealPath;
+ public static String BlockingFileSystemProxy_TimeoutRenamingFile;
+ public static String BlockingFileSystemProxy_TimeoutReadingLink;
+ public static String BlockingFileSystemProxy_TimeoutSymLink;
+ public static String BlockingFileSystemProxy_TimeoutCopying;
+ public static String BlockingFileSystemProxy_TimeoutGettingUser;
+ public static String ModelManager_errorNoUserAccount;
+ public static String ModelManager_errorOpenChannel;
+
+ public static String FileSystem_ErrorMessage_Errno_Base;
+ public static String FileSystem_ErrorMessage_Errno_65563;
+ public static String FileSystem_ErrorMessage_Errno_65565;
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.properties
index 2e781ebb6..b25c623c0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/nls/Messages.properties
@@ -1,123 +1,127 @@
-###############################################################################
-# Copyright (c) 2012, 2015 Wind River Systems, 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:
-# Wind River Systems - initial API and implementation
-###############################################################################
-
-BlockingFileSystemProxy_TimeoutOpeningFile=Timeout while opening the file ''{0}''.
-BlockingFileSystemProxy_TimeoutClosingFile=Timeout while closing the handle ''{0}''.
-BlockingFileSystemProxy_TimeoutReadingFile=Timeout while reading the handle ''{0}''.
-BlockingFileSystemProxy_TimeoutWritingFile=Timeout while writing the handle ''{0}''.
-BlockingFileSystemProxy_TimeoutStat=Timeout while getting the stat of ''{0}''.
-BlockingFileSystemProxy_TimeoutLstat=Timeout while getting the lstat of ''{0}''.
-BlockingFileSystemProxy_TimeoutFstat=Timeout while getting the fstat of ''{0}''.
-BlockingFileSystemProxy_TimeoutSetStat=Timeout while setting the stat of ''{0}''.
-BlockingFileSystemProxy_TimeoutFSetStat=Timeout while setting the fstat of ''{0}''.
-BlockingFileSystemProxy_TimeoutOpeningDir=Timeout while opening the directory ''{0}''.
-BlockingFileSystemProxy_TimeoutReadingDir=Timeout while reading the directory ''{0}''.
-BlockingFileSystemProxy_TimeoutMakingDir=Timeout while making the directory ''{0}''.
-BlockingFileSystemProxy_TimeoutRemovingDir=Timeout while removing the directory ''{0}''.
-BlockingFileSystemProxy_TimeoutListingRoots=Timeout while listing root directories.
-BlockingFileSystemProxy_TimeoutRemovingFile=Timeout while removing the file ''{0}''.
-BlockingFileSystemProxy_TimeoutGettingRealPath=Timeout while getting real path for ''{0}''.
-BlockingFileSystemProxy_TimeoutRenamingFile=Timeout while renaming the file from ''{0}'' to ''{1}''.
-BlockingFileSystemProxy_TimeoutReadingLink=Timeout while reading the link for ''{0}''.
-BlockingFileSystemProxy_TimeoutSymLink=Timeout while creating a link ''{0}'' for ''{1}''.
-BlockingFileSystemProxy_TimeoutCopying=Timeout while copying files from ''{0}'' to ''{1}''.
-BlockingFileSystemProxy_TimeoutGettingUser=Timeout while getting the user data.
-
-CacheManager_MkdirFailed=Making directory {0} failed
-CacheManager_SetReadOnlyFailed=Setting the read-only attribute of {0} failed\!
-
-FileTransferService_error_mkdirFailed=Failed to create directory structure to {0}.
-
-FSTreeNodeContentProvider_rootNodeLabel=File System
-
-FSTreeNode_TypeFile=File
-FSTreeNode_TypeFileFolder=File Folder
-FSTreeNode_TypeLocalDisk=Local Disk
-FSTreeNode_TypeSystemFile=System file
-FSTreeNode_TypeUnknownFile=Unknown File
-
-FSTreeNodeWorkingCopy_commitOperation_name=Commit changes to {0}
-
-ModelManager_errorNoUserAccount=Cannot obtain user account for {0}
-ModelManager_errorOpenChannel=Cannot open channel for {0}
-
-Operation_NotResponding=The TCF agent on the target {0} is probably down. It is not responding.
-Operation_OpeningChannelFailureMessage=We cannot open a TCF channel to the target: {0}. It is caused by {1}.
-Operation_NoFileSystemError=This TCF agent, {0}, does not provide a file system service\!
-Operation_CannotOpenDir=Cannot open directory {0} because {1}
-Operation_CannotCreateDirectory=Cannot create directory {0}
-Operation_CopyNOfFile=Copy ({0}) of {1}
-Operation_CopyOfFile=Copy of {0}
-Operation_TimeoutOpeningChannel=Timeout while opening a channel\!
-OpStreamOp_Bytes=\ bytes
-OpStreamOp_KBs=\ KBs
-OpStreamOp_MBs=\ MBs
-
-OpCacheFileDigest_error_updatingDigest=Failed to update digest
-OpCacheFileDigest_name=Update cache digest
-OpCommitAttr_error_cannotSetAttributes=Cannot set attributes
-OpCommitAttr_name=Set file attributes:
-
-OpCopy_Copying=Copying {0}
-OpCopy_CannotCopyFile=Cannot copy file {0}
-OpCopy_CopyingFile=Copying files
-OpCopy_error_noDirectory={0} exists and is not a directory
-OpCopy_error_noFile={0} exists and is not a file
-
-OpCreate_error_existingFile=Cannot create {0}, a file or folder with the same name already exists
-OpCreate_TaskName=Creating {0}
-OpCreateFile_error_create=Error creating file {0}
-OpCreateFolder_error_createFolder=Error creating folder {0}
-
-OpDelete_Deleting=Deleting files
-OpDelete_error_delete=Cannot delete {0}
-OpDelete_error_readDir=Cannot list directory {0}
-OpDelete_RemovingFileFolder=Removing {0}
-
-OpDownload_Downloading=Downloading file {0}:{1}/{2}
-OpDownload_DownloadingSingleFile=Downloading file {0}...
-
-OpMove_Moving=Moving {0}
-OpMove_CannotMove=Cannot move {0}
-OpMove_MovingFile=Moving files
-
-OpParsePath_name=Restoring {0}
-
-OpRefresh_errorGetRoots=Cannot obtain root directories for {0}
-OpRefresh_errorOpenDir=Cannot list directory {0}
-OpRefresh_errorReadAttributes=Cannot read attributes of {0}
-OpRefresh_name=Refresh {0}
-
-OpRename_TitleRename=Rename
-OpRestoreFavorites_name=Open favorites
-
-OpTargetFileDigest_error_download=Cannot download {0}
-OpTargetFileDigest_error_openFile=Cannot open file {0}
-
-OpUpload_error_openFile=Cannot open file {0}
-OpUpload_error_upload=Cannot upload {0}
-OpUpload_UploadingProgress=Uploading file {0}: {1}/{2}
-OpUpload_UploadNFiles=Uploading {0} files...
-OpUpload_UploadSingleFile=Uploading file {0}
-
-TcfInputStream_NoDataAvailable=No data available
-TcfInputStream_StreamClosed=Stream is already closed\!
-
-TcfOutputStream_StreamClosed=Stream is already closed\!
-
-TcfURLConnection_errorInvalidURL=Invalid url:
-TcfURLConnection_NoFileHandleReturned=No file handle returned\!
-TcfURLConnection_NoPeerFound=Could not find the specified target with the ID {0}
-TcfURLConnection_NoSuchTcfAgent=TCF agent is already disconnected\!
-TcfURLConnection_relativePath=Path must be absolute
-
-TcfURLStreamHandlerService_ErrorURLFormat=Error TCF URL format\!
-TcfURLStreamHandlerService_IllegalCharacter=A Windows path does not permit character {0}.
-TcfURLStreamHandlerService_OnlyDiskPartError=A Windows path should not contain only disk part.
+###############################################################################
+# Copyright (c) 2012, 2016 Wind River Systems, 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:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+BlockingFileSystemProxy_TimeoutOpeningFile=Timeout while opening the file ''{0}''.
+BlockingFileSystemProxy_TimeoutClosingFile=Timeout while closing the handle ''{0}''.
+BlockingFileSystemProxy_TimeoutReadingFile=Timeout while reading the handle ''{0}''.
+BlockingFileSystemProxy_TimeoutWritingFile=Timeout while writing the handle ''{0}''.
+BlockingFileSystemProxy_TimeoutStat=Timeout while getting the stat of ''{0}''.
+BlockingFileSystemProxy_TimeoutLstat=Timeout while getting the lstat of ''{0}''.
+BlockingFileSystemProxy_TimeoutFstat=Timeout while getting the fstat of ''{0}''.
+BlockingFileSystemProxy_TimeoutSetStat=Timeout while setting the stat of ''{0}''.
+BlockingFileSystemProxy_TimeoutFSetStat=Timeout while setting the fstat of ''{0}''.
+BlockingFileSystemProxy_TimeoutOpeningDir=Timeout while opening the directory ''{0}''.
+BlockingFileSystemProxy_TimeoutReadingDir=Timeout while reading the directory ''{0}''.
+BlockingFileSystemProxy_TimeoutMakingDir=Timeout while making the directory ''{0}''.
+BlockingFileSystemProxy_TimeoutRemovingDir=Timeout while removing the directory ''{0}''.
+BlockingFileSystemProxy_TimeoutListingRoots=Timeout while listing root directories.
+BlockingFileSystemProxy_TimeoutRemovingFile=Timeout while removing the file ''{0}''.
+BlockingFileSystemProxy_TimeoutGettingRealPath=Timeout while getting real path for ''{0}''.
+BlockingFileSystemProxy_TimeoutRenamingFile=Timeout while renaming the file from ''{0}'' to ''{1}''.
+BlockingFileSystemProxy_TimeoutReadingLink=Timeout while reading the link for ''{0}''.
+BlockingFileSystemProxy_TimeoutSymLink=Timeout while creating a link ''{0}'' for ''{1}''.
+BlockingFileSystemProxy_TimeoutCopying=Timeout while copying files from ''{0}'' to ''{1}''.
+BlockingFileSystemProxy_TimeoutGettingUser=Timeout while getting the user data.
+
+CacheManager_MkdirFailed=Making directory {0} failed
+CacheManager_SetReadOnlyFailed=Setting the read-only attribute of {0} failed\!
+
+FileTransferService_error_mkdirFailed=Failed to create directory structure to {0}.
+
+FSTreeNodeContentProvider_rootNodeLabel=File System
+
+FSTreeNode_TypeFile=File
+FSTreeNode_TypeFileFolder=File Folder
+FSTreeNode_TypeLocalDisk=Local Disk
+FSTreeNode_TypeSystemFile=System file
+FSTreeNode_TypeUnknownFile=Unknown File
+
+FSTreeNodeWorkingCopy_commitOperation_name=Commit changes to {0}
+
+ModelManager_errorNoUserAccount=Cannot obtain user account for {0}
+ModelManager_errorOpenChannel=Cannot open channel for {0}
+
+Operation_NotResponding=The TCF agent on the target {0} is probably down. It is not responding.
+Operation_OpeningChannelFailureMessage=We cannot open a TCF channel to the target: {0}. It is caused by {1}.
+Operation_NoFileSystemError=This TCF agent, {0}, does not provide a file system service\!
+Operation_CannotOpenDir=Cannot open directory {0} because {1}
+Operation_CannotCreateDirectory=Cannot create directory {0}
+Operation_CopyNOfFile=Copy ({0}) of {1}
+Operation_CopyOfFile=Copy of {0}
+Operation_TimeoutOpeningChannel=Timeout while opening a channel\!
+OpStreamOp_Bytes=\ bytes
+OpStreamOp_KBs=\ KBs
+OpStreamOp_MBs=\ MBs
+
+OpCacheFileDigest_error_updatingDigest=Failed to update digest
+OpCacheFileDigest_name=Update cache digest
+OpCommitAttr_error_cannotSetAttributes=Cannot set attributes
+OpCommitAttr_name=Set file attributes:
+
+OpCopy_Copying=Copying {0}
+OpCopy_CannotCopyFile=Cannot copy file {0}
+OpCopy_CopyingFile=Copying files
+OpCopy_error_noDirectory={0} exists and is not a directory
+OpCopy_error_noFile={0} exists and is not a file
+
+OpCreate_error_existingFile=Cannot create {0}, a file or folder with the same name already exists
+OpCreate_TaskName=Creating {0}
+OpCreateFile_error_create=Error creating file {0}
+OpCreateFolder_error_createFolder=Error creating folder {0}
+
+OpDelete_Deleting=Deleting files
+OpDelete_error_delete=Cannot delete {0}
+OpDelete_error_readDir=Cannot list directory {0}
+OpDelete_RemovingFileFolder=Removing {0}
+
+OpDownload_Downloading=Downloading file {0}:{1}/{2}
+OpDownload_DownloadingSingleFile=Downloading file {0}...
+
+OpMove_Moving=Moving {0}
+OpMove_CannotMove=Cannot move {0}
+OpMove_MovingFile=Moving files
+
+OpParsePath_name=Restoring {0}
+
+OpRefresh_errorGetRoots=Cannot obtain root directories for {0}
+OpRefresh_errorOpenDir=Cannot list directory {0}
+OpRefresh_errorReadAttributes=Cannot read attributes of {0}
+OpRefresh_name=Refresh {0}
+
+OpRename_TitleRename=Rename
+OpRestoreFavorites_name=Open favorites
+
+OpTargetFileDigest_error_download=Cannot download {0}
+OpTargetFileDigest_error_openFile=Cannot open file {0}
+
+OpUpload_error_openFile=Cannot open file {0}
+OpUpload_error_upload=Cannot upload {0}
+OpUpload_UploadingProgress=Uploading file {0}: {1}/{2}
+OpUpload_UploadNFiles=Uploading {0} files...
+OpUpload_UploadSingleFile=Uploading file {0}
+
+TcfInputStream_NoDataAvailable=No data available
+TcfInputStream_StreamClosed=Stream is already closed\!
+
+TcfOutputStream_StreamClosed=Stream is already closed\!
+
+TcfURLConnection_errorInvalidURL=Invalid url:
+TcfURLConnection_NoFileHandleReturned=No file handle returned\!
+TcfURLConnection_NoPeerFound=Could not find the specified target with the ID {0}
+TcfURLConnection_NoSuchTcfAgent=TCF agent is already disconnected\!
+TcfURLConnection_relativePath=Path must be absolute
+
+TcfURLStreamHandlerService_ErrorURLFormat=Error TCF URL format\!
+TcfURLStreamHandlerService_IllegalCharacter=A Windows path does not permit character {0}.
+TcfURLStreamHandlerService_OnlyDiskPartError=A Windows path should not contain only disk part.
+
+FileSystem_ErrorMessage_Errno_Base=FileSystem_ErrorMessage_Errno_{0}
+FileSystem_ErrorMessage_Errno_65563=Out of space
+FileSystem_ErrorMessage_Errno_65565=Read-only file system

Back to the top