From 0ee5f80598059abf981fddf40d9e1b6553023774 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 28 Nov 2006 17:26:32 +0000 Subject: [PATCH] removing dstore compiler warnings --- .../miners/IUniversalDataStoreConstants.java | 68 +- .../dstore/universal/miners/ServerLogger.java | 28 +- .../miners/UniversalServerUtilities.java | 12 +- .../miners/command/CommandMiner.java | 78 +-- .../miners/command/CommandMinerThread.java | 6 +- .../miners/command/OutputHandler.java | 16 +- .../miners/command/QueryPathThread.java | 16 +- .../command/patterns/OutputPattern.java | 10 +- .../miners/command/patterns/Patterns.java | 34 +- .../miners/environment/EnvironmentMiner.java | 74 +- .../miners/filesystem/FileClassifier.java | 9 +- .../UniversalByteStreamHandler.java | 14 +- .../filesystem/UniversalDownloadHandler.java | 20 +- .../filesystem/UniversalFileSystemFilter.java | 6 +- .../filesystem/UniversalFileSystemMiner.java | 631 +++++++----------- .../filesystem/UniversalSearchHandler.java | 14 +- .../IUniversalProcessDataStoreConstants.java | 18 +- .../processes/UniversalProcessMiner.java | 58 +- .../dstore/shell/DStoreShellOutputReader.java | 12 +- .../dstore/shell/DStoreShellThread.java | 32 +- .../dstore/AbstractDStoreService.java | 11 +- .../dstore/files/DStoreFileService.java | 90 +-- .../services/dstore/files/DStoreHostFile.java | 18 +- .../dstore/processes/DStoreHostProcess.java | 20 +- .../processes/DStoreProcessService.java | 24 +- .../dstore/search/DStoreSearchService.java | 4 +- .../dstore/shells/DStoreHostShell.java | 2 +- .../dstore/shells/DStoreShellService.java | 6 +- .../DStoreFileTransferStatusListener.java | 12 +- .../dstore/util/DStoreStatusMonitor.java | 2 +- .../dstore/util/DownloadListener.java | 22 +- .../dstore/util/FileSystemMessageUtil.java | 10 +- .../dstore/util/StatusChangeListener.java | 2 +- 33 files changed, 626 insertions(+), 753 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/IUniversalDataStoreConstants.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/IUniversalDataStoreConstants.java index ac655c40fad..512ebb13b88 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/IUniversalDataStoreConstants.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/IUniversalDataStoreConstants.java @@ -26,54 +26,54 @@ public interface IUniversalDataStoreConstants extends IServiceConstants /* * Miner names, used for logging */ - public static final String UNIVERSAL_FILESYSTEM_MINER = "UniversalFileSystemMiner"; + public static final String UNIVERSAL_FILESYSTEM_MINER = "UniversalFileSystemMiner"; //$NON-NLS-1$ // // Universal File descriptors for DataStore DataElements // - public static final String MESSAGE_DESCRIPTOR = "universal.message"; + public static final String MESSAGE_DESCRIPTOR = "universal.message"; //$NON-NLS-1$ - public static final String UNIVERSAL_NODE_DESCRIPTOR = "universal.node"; - public static final String UNIVERSAL_TEMP_DESCRIPTOR = "universal.temp"; - public static final String UNIVERSAL_FILTER_DESCRIPTOR = "universal.FilterObject"; - public static final String UNIVERSAL_FILE_DESCRIPTOR = "universal.FileObject"; - public static final String UNIVERSAL_FOLDER_DESCRIPTOR = "universal.FolderObject"; + public static final String UNIVERSAL_NODE_DESCRIPTOR = "universal.node"; //$NON-NLS-1$ + public static final String UNIVERSAL_TEMP_DESCRIPTOR = "universal.temp"; //$NON-NLS-1$ + public static final String UNIVERSAL_FILTER_DESCRIPTOR = "universal.FilterObject"; //$NON-NLS-1$ + public static final String UNIVERSAL_FILE_DESCRIPTOR = "universal.FileObject"; //$NON-NLS-1$ + public static final String UNIVERSAL_FOLDER_DESCRIPTOR = "universal.FolderObject"; //$NON-NLS-1$ - public static final String UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR = "universal.ArchiveFileObject"; - public static final String UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR = "universal.VirtualFileObject"; - public static final String UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR = "universal.VirtualFolderObject"; + public static final String UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR = "universal.ArchiveFileObject"; //$NON-NLS-1$ + public static final String UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR = "universal.VirtualFileObject"; //$NON-NLS-1$ + public static final String UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR = "universal.VirtualFolderObject"; //$NON-NLS-1$ // // Universal File Miner Commands // - public static final String C_QUERY_ROOTS = "C_QUERY_ROOTS"; - public static final String C_QUERY_VIEW_ALL = "C_QUERY_VIEW_ALL"; - public static final String C_QUERY_VIEW_FILES = "C_QUERY_VIEW_FILES"; - public static final String C_QUERY_VIEW_FOLDERS = "C_QUERY_VIEW_FOLDERS"; - public static final String C_CREATE_FILE = "C_CREATE_FILE"; - public static final String C_CREATE_FOLDER = "C_CREATE_FOLDER"; - public static final String C_QUERY_GET_REMOTE_OBJECT="C_QUERY_GET_REMOTE_OBJECT"; + public static final String C_QUERY_ROOTS = "C_QUERY_ROOTS"; //$NON-NLS-1$ + public static final String C_QUERY_VIEW_ALL = "C_QUERY_VIEW_ALL"; //$NON-NLS-1$ + public static final String C_QUERY_VIEW_FILES = "C_QUERY_VIEW_FILES"; //$NON-NLS-1$ + public static final String C_QUERY_VIEW_FOLDERS = "C_QUERY_VIEW_FOLDERS"; //$NON-NLS-1$ + public static final String C_CREATE_FILE = "C_CREATE_FILE"; //$NON-NLS-1$ + public static final String C_CREATE_FOLDER = "C_CREATE_FOLDER"; //$NON-NLS-1$ + public static final String C_QUERY_GET_REMOTE_OBJECT="C_QUERY_GET_REMOTE_OBJECT"; //$NON-NLS-1$ - public static final String C_DELETE = "C_DELETE"; - public static final String C_DELETE_BATCH = "C_DELETE_BATCH"; - public static final String C_RENAME = "C_RENAME"; - public static final String C_COPY = "C_COPY"; - public static final String C_COPY_BATCH = "C_COPY_BATCH"; + public static final String C_DELETE = "C_DELETE"; //$NON-NLS-1$ + public static final String C_DELETE_BATCH = "C_DELETE_BATCH"; //$NON-NLS-1$ + public static final String C_RENAME = "C_RENAME"; //$NON-NLS-1$ + public static final String C_COPY = "C_COPY"; //$NON-NLS-1$ + public static final String C_COPY_BATCH = "C_COPY_BATCH"; //$NON-NLS-1$ // Download file command - public static final String C_DOWNLOAD_FILE = "C_DOWNLOAD_FILE"; + public static final String C_DOWNLOAD_FILE = "C_DOWNLOAD_FILE"; //$NON-NLS-1$ // Query system encoding command - public static final String C_SYSTEM_ENCODING = "C_SYSTEM_ENCODING"; + public static final String C_SYSTEM_ENCODING = "C_SYSTEM_ENCODING"; //$NON-NLS-1$ // Query unused port - public static final String C_QUERY_UNUSED_PORT = "C_QUERY_UNUSED_PORT"; + public static final String C_QUERY_UNUSED_PORT = "C_QUERY_UNUSED_PORT"; //$NON-NLS-1$ // Qualified class name command and return type - public static final String C_QUERY_QUALIFIED_CLASSNAME = "C_QUERY_QUALIFIED_CLASSNAME"; - public static final String TYPE_QUALIFIED_CLASSNAME = "fullClassName"; + public static final String C_QUERY_QUALIFIED_CLASSNAME = "C_QUERY_QUALIFIED_CLASSNAME"; //$NON-NLS-1$ + public static final String TYPE_QUALIFIED_CLASSNAME = "fullClassName"; //$NON-NLS-1$ @@ -83,13 +83,13 @@ public interface IUniversalDataStoreConstants extends IServiceConstants // Download result types and download messages - public static final String DOWNLOAD_RESULT_SUCCESS_TYPE = "universal.download.success"; - public static final String DOWNLOAD_RESULT_SUCCESS_MESSAGE = "successful"; - public static final String DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION = "FileNotFoundException"; - public static final String DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION = "UnsupportedEncodingException"; - public static final String DOWNLOAD_RESULT_IO_EXCEPTION = "IOException"; - public static final String DOWNLOAD_RESULT_EXCEPTION = "Exception"; - public static final String DOWNLOAD_RESULT_UNEXPECTED_ERROR = "UnexpectedError"; + public static final String DOWNLOAD_RESULT_SUCCESS_TYPE = "universal.download.success"; //$NON-NLS-1$ + public static final String DOWNLOAD_RESULT_SUCCESS_MESSAGE = "successful"; //$NON-NLS-1$ + public static final String DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION = "FileNotFoundException"; //$NON-NLS-1$ + public static final String DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION = "UnsupportedEncodingException"; //$NON-NLS-1$ + public static final String DOWNLOAD_RESULT_IO_EXCEPTION = "IOException"; //$NON-NLS-1$ + public static final String DOWNLOAD_RESULT_EXCEPTION = "Exception"; //$NON-NLS-1$ + public static final String DOWNLOAD_RESULT_UNEXPECTED_ERROR = "UnexpectedError"; //$NON-NLS-1$ // Number of bytes in a kilobyte diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/ServerLogger.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/ServerLogger.java index 6e1e280b8a1..03b1e8b69e6 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/ServerLogger.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/ServerLogger.java @@ -28,14 +28,14 @@ public class ServerLogger { // Constants for logging - for use in rsecomm.properties - private static final String DEBUG_LEVEL = "debug_level"; - private static final String LOG_LOCATION = "log_location"; + private static final String DEBUG_LEVEL = "debug_level"; //$NON-NLS-1$ + private static final String LOG_LOCATION = "log_location"; //$NON-NLS-1$ private static final int LOG_WARNING = 1; private static final int LOG_INFO = 2; private static final int LOG_DEBUG = 3; - private static final String LOG_TO_STDOUT = "Log_To_StdOut"; + private static final String LOG_TO_STDOUT = "Log_To_StdOut"; //$NON-NLS-1$ private static Object writeLock = new Object(); private static PrintWriter _logFileStream = null; @@ -52,7 +52,7 @@ public class ServerLogger { boolean logToFile = true; try { - ResourceBundle properties = ResourceBundle.getBundle("rsecomm"); + ResourceBundle properties = ResourceBundle.getBundle("rsecomm"); //$NON-NLS-1$ String debug_level = properties.getString(DEBUG_LEVEL).trim(); log_level = Integer.parseInt(debug_level); String log_location = properties.getString(LOG_LOCATION).trim(); @@ -67,7 +67,7 @@ public class ServerLogger { if (logToFile) { try { - File _logFile = new File(logPathName, "rsecomm.log"); + File _logFile = new File(logPathName, "rsecomm.log"); //$NON-NLS-1$ if (!_logFile.exists()) { _logFile.createNewFile(); @@ -76,7 +76,7 @@ public class ServerLogger { _logFileStream = new PrintWriter(new FileOutputStream(_logFile)); } catch (IOException e) { - System.out.println("Error opening log file " + logPathName + "rsecomm.log"); + System.out.println("Error opening log file " + logPathName + "rsecomm.log"); //$NON-NLS-1$ //$NON-NLS-2$ } } } @@ -96,8 +96,8 @@ public class ServerLogger { synchronized(writeLock) { try { _logFileStream.println(new Date()); - _logFileStream.println("INFO " + minerName + ": " + message); - _logFileStream.println("---------------------------------------------------------------"); + _logFileStream.println("INFO " + minerName + ": " + message); //$NON-NLS-1$ //$NON-NLS-2$ + _logFileStream.println("---------------------------------------------------------------"); //$NON-NLS-1$ _logFileStream.flush(); }catch (Exception e) {} } @@ -119,8 +119,8 @@ public class ServerLogger { synchronized(writeLock) { try { _logFileStream.println(new Date()); - _logFileStream.println("WARNING " + minerName + ": " + message); - _logFileStream.println("---------------------------------------------------------------"); + _logFileStream.println("WARNING " + minerName + ": " + message); //$NON-NLS-1$ //$NON-NLS-2$ + _logFileStream.println("---------------------------------------------------------------"); //$NON-NLS-1$ _logFileStream.flush(); }catch (Exception e) {} } @@ -143,11 +143,11 @@ public class ServerLogger { synchronized(writeLock) { try { _logFileStream.println(new Date()); - _logFileStream.println("ERROR " + minerName + ": " + message); + _logFileStream.println("ERROR " + minerName + ": " + message); //$NON-NLS-1$ //$NON-NLS-2$ if (exception != null) { exception.printStackTrace(_logFileStream); } - _logFileStream.println("---------------------------------------------------------------"); + _logFileStream.println("---------------------------------------------------------------"); //$NON-NLS-1$ _logFileStream.flush(); }catch (Exception e) {} } @@ -168,8 +168,8 @@ public class ServerLogger { synchronized(writeLock) { try { _logFileStream.println(new Date()); - _logFileStream.println("DEBUG " + minerName + ": " + message); - _logFileStream.println("---------------------------------------------------------------"); + _logFileStream.println("DEBUG " + minerName + ": " + message); //$NON-NLS-1$ //$NON-NLS-2$ + _logFileStream.println("---------------------------------------------------------------"); //$NON-NLS-1$ _logFileStream.flush(); }catch (Exception e) {} } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalServerUtilities.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalServerUtilities.java index f2e182fe206..e45b36cf6ae 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalServerUtilities.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalServerUtilities.java @@ -34,12 +34,12 @@ public class UniversalServerUtilities { { if (_userPreferencesDirectory == null) { - _userPreferencesDirectory = System.getProperty("user.home"); + _userPreferencesDirectory = System.getProperty("user.home"); //$NON-NLS-1$ - String clientUserID = System.getProperty("client.username"); - if (clientUserID == null || clientUserID.equals("")) + String clientUserID = System.getProperty("client.username"); //$NON-NLS-1$ + if (clientUserID == null || clientUserID.equals("")) //$NON-NLS-1$ { - clientUserID = ""; + clientUserID = ""; //$NON-NLS-1$ } else { @@ -53,8 +53,8 @@ public class UniversalServerUtilities { _userPreferencesDirectory = _userPreferencesDirectory + File.separator; } - _userPreferencesDirectory = _userPreferencesDirectory + ".eclipse" + File.separator + - "RSE" + File.separator + clientUserID; + _userPreferencesDirectory = _userPreferencesDirectory + ".eclipse" + File.separator + //$NON-NLS-1$ + "RSE" + File.separator + clientUserID; //$NON-NLS-1$ File dirFile = new File(_userPreferencesDirectory); if (!dirFile.exists()) { dirFile.mkdirs(); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMiner.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMiner.java index d2f67897270..f1dddf9cf40 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMiner.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMiner.java @@ -57,43 +57,43 @@ public class CommandMiner extends Miner public DataElement getDescriptorFor(String type) { DataElement descriptor = null; - if (type.equals("stdout")) + if (type.equals("stdout")) //$NON-NLS-1$ { descriptor = _stdout; } - else if (type.equals("pathenvvar")) + else if (type.equals("pathenvvar")) //$NON-NLS-1$ { descriptor = _pathenvvar; } - else if (type.equals("envvar")) + else if (type.equals("envvar")) //$NON-NLS-1$ { descriptor = _envvar; } - else if (type.equals("libenvvar")) + else if (type.equals("libenvvar")) //$NON-NLS-1$ { descriptor = _libenvvar; } - else if (type.equals("error")) + else if (type.equals("error")) //$NON-NLS-1$ { descriptor = _error; } - else if (type.equals("warning")) + else if (type.equals("warning")) //$NON-NLS-1$ { descriptor = _warning; } - else if (type.equals("informational")) + else if (type.equals("informational")) //$NON-NLS-1$ { descriptor = _informational; } - else if (type.equals("process")) + else if (type.equals("process")) //$NON-NLS-1$ { descriptor = _process; } - else if (type.equals("grep")) + else if (type.equals("grep")) //$NON-NLS-1$ { descriptor = _grep; } - else if (type.equals("stderr")) + else if (type.equals("stderr")) //$NON-NLS-1$ { descriptor = _stderr; } @@ -128,33 +128,33 @@ public class CommandMiner extends Miner DataElement fsD= _dataStore.findObjectDescriptor(DataStoreResources.model_directory); DataElement cancellable = _dataStore.findObjectDescriptor(DataStoreResources.model_Cancellable); - DataElement cmdD = createCommandDescriptor(fsD, "Command", "C_COMMAND", false); - _dataStore.createReference(cancellable, cmdD, "abstracts", "abstracted by"); + DataElement cmdD = createCommandDescriptor(fsD, "Command", "C_COMMAND", false); //$NON-NLS-1$ //$NON-NLS-2$ + _dataStore.createReference(cancellable, cmdD, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ - DataElement shellD = createCommandDescriptor(fsD, "Shell", "C_SHELL", false); - _dataStore.createReference(cancellable, shellD, "abstracts", "abstracted by"); + DataElement shellD = createCommandDescriptor(fsD, "Shell", "C_SHELL", false); //$NON-NLS-1$ //$NON-NLS-2$ + _dataStore.createReference(cancellable, shellD, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ // DataElement inputD = _dataStore.createObject(cmdD, "input", "Enter command"); - _dataStore.createObject(cmdD, "input", "Enter command"); + _dataStore.createObject(cmdD, "input", "Enter command"); //$NON-NLS-1$ //$NON-NLS-2$ // DataElement outputD = _dataStore.createObject(cmdD, "output", "Command Output"); - _dataStore.createObject(cmdD, "output", "Command Output"); + _dataStore.createObject(cmdD, "output", "Command Output"); //$NON-NLS-1$ //$NON-NLS-2$ _descriptors = new CommandMinerDescriptors(); - _descriptors._stdout = _dataStore.createObjectDescriptor(schemaRoot, "stdout"); - _descriptors._stderr = _dataStore.createObjectDescriptor(schemaRoot, "stderr"); - _descriptors._prompt = _dataStore.createObjectDescriptor(schemaRoot, "prompt"); - _descriptors._grep = _dataStore.createObjectDescriptor(schemaRoot, "grep"); - _descriptors._pathenvvar = _dataStore.createObjectDescriptor(schemaRoot, "pathenvvar"); - _descriptors._envvar = _dataStore.createObjectDescriptor(schemaRoot, "envvar"); - _descriptors._libenvvar = _dataStore.createObjectDescriptor(schemaRoot, "libenvvar"); - _descriptors._error = _dataStore.createObjectDescriptor(schemaRoot, "error"); - _descriptors._warning = _dataStore.createObjectDescriptor(schemaRoot, "warning"); - _descriptors._informational = _dataStore.createObjectDescriptor(schemaRoot, "informational"); - _descriptors._process =_dataStore.createObjectDescriptor(schemaRoot, "process"); + _descriptors._stdout = _dataStore.createObjectDescriptor(schemaRoot, "stdout"); //$NON-NLS-1$ + _descriptors._stderr = _dataStore.createObjectDescriptor(schemaRoot, "stderr"); //$NON-NLS-1$ + _descriptors._prompt = _dataStore.createObjectDescriptor(schemaRoot, "prompt"); //$NON-NLS-1$ + _descriptors._grep = _dataStore.createObjectDescriptor(schemaRoot, "grep"); //$NON-NLS-1$ + _descriptors._pathenvvar = _dataStore.createObjectDescriptor(schemaRoot, "pathenvvar"); //$NON-NLS-1$ + _descriptors._envvar = _dataStore.createObjectDescriptor(schemaRoot, "envvar"); //$NON-NLS-1$ + _descriptors._libenvvar = _dataStore.createObjectDescriptor(schemaRoot, "libenvvar"); //$NON-NLS-1$ + _descriptors._error = _dataStore.createObjectDescriptor(schemaRoot, "error"); //$NON-NLS-1$ + _descriptors._warning = _dataStore.createObjectDescriptor(schemaRoot, "warning"); //$NON-NLS-1$ + _descriptors._informational = _dataStore.createObjectDescriptor(schemaRoot, "informational"); //$NON-NLS-1$ + _descriptors._process =_dataStore.createObjectDescriptor(schemaRoot, "process"); //$NON-NLS-1$ // DataElement getPossibleCmds = createCommandDescriptor(fsD, "Get Commands", "C_GET_POSSIBLE_COMMANDS", false); - createCommandDescriptor(fsD, "Get Commands", "C_GET_POSSIBLE_COMMANDS", false); + createCommandDescriptor(fsD, "Get Commands", "C_GET_POSSIBLE_COMMANDS", false); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.refresh(schemaRoot); } @@ -164,7 +164,7 @@ public class CommandMiner extends Miner DataElement status = getCommandStatus(theElement); DataElement subject = getCommandArgument(theElement, 0); - if (name.equals("C_COMMAND")) + if (name.equals("C_COMMAND")) //$NON-NLS-1$ { DataElement invArg = getCommandArgument(theElement, 1); if (invArg != null) @@ -173,37 +173,37 @@ public class CommandMiner extends Miner //Remove All extra whitespace from the command if (invocation.trim().length() > 0) { - if (invocation.equals("?") || invocation.equals("help")) - invocation = "cat " + theElement.getDataStore().getAttribute(DataStoreAttributes.A_PLUGIN_PATH) + "/org.eclipse.rse.services.dstore/patterns.dat"; + if (invocation.equals("?") || invocation.equals("help")) //$NON-NLS-1$ //$NON-NLS-2$ + invocation = "cat " + theElement.getDataStore().getAttribute(DataStoreAttributes.A_PLUGIN_PATH) + "/org.eclipse.rse.services.dstore/patterns.dat"; //$NON-NLS-1$ //$NON-NLS-2$ launchCommand(subject, invocation, status); } return status; } else { - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ } } - else if (name.equals("C_SHELL")) + else if (name.equals("C_SHELL")) //$NON-NLS-1$ { - String invocation = ">"; + String invocation = ">"; //$NON-NLS-1$ launchCommand(subject, invocation, status); } - else if (name.equals("C_SEND_INPUT")) + else if (name.equals("C_SEND_INPUT")) //$NON-NLS-1$ { DataElement input = getCommandArgument(theElement, 1); // DataElement de = (DataElement) subject.dereference().get(1); subject.dereference().get(1); sendInputToCommand(input.getName(), getCommandStatus(subject)); } - else if (name.equals("C_CANCEL")) + else if (name.equals("C_CANCEL")) //$NON-NLS-1$ { DataElement de = subject.dereference().get(1); DataElement cancelStatus = getCommandStatus(subject); cancelCommand(de.getName().trim(), cancelStatus); return status; } - else if (name.equals("C_GET_POSSIBLE_COMMANDS")) + else if (name.equals("C_GET_POSSIBLE_COMMANDS")) //$NON-NLS-1$ { getPossibleCommands(status); return status; @@ -265,14 +265,14 @@ public class CommandMiner extends Miner while (!done) if ((!theThread.isAlive()) || (stopIn < System.currentTimeMillis())) done = true; - _dataStore.createObject(status, "stdout", "Command Cancelled by User Request"); + _dataStore.createObject(status, "stdout", "Command Cancelled by User Request"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.refresh(status); } } public String getVersion() { - return "6.4.0"; + return "6.4.0"; //$NON-NLS-1$ } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMinerThread.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMinerThread.java index d643bdc991c..0b53e0704cb 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMinerThread.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/CommandMinerThread.java @@ -778,7 +778,7 @@ public class CommandMinerThread extends MinerThread { String theKey = (String) e.nextElement(); if (matchString.equals(theKey.toUpperCase())) - theValue = (String) theTable.get(theKey); + theValue = theTable.get(theKey); } } if (theValue == null) @@ -890,7 +890,7 @@ public class CommandMinerThread extends MinerThread else { exitcode = _theProcess.exitValue(); - createObject("prompt", "> Shell Completed (exit code = " + exitcode + ")"); //$NON-NLS-1$ //$NON-NLS-3$ + createObject("prompt", "> Shell Completed (exit code = " + exitcode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } catch (IllegalThreadStateException e) @@ -1089,7 +1089,7 @@ public class CommandMinerThread extends MinerThread expectedPath = file; _cwdStr = file.replaceAll("//", "/"); //$NON-NLS-1$ //$NON-NLS-2$ } - else if (aFile != null && aFile.exists()) + else if (aFile.exists()) { expectedPath = aFile.getAbsolutePath(); file = expectedPath; diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/OutputHandler.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/OutputHandler.java index bd3ce5841b0..30bd0b9a154 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/OutputHandler.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/OutputHandler.java @@ -52,11 +52,11 @@ public class OutputHandler extends Handler _commandThread = commandThread; _isShell = isShell; _encodings = new ArrayList(); - String system = System.getProperty("os.name").toLowerCase(); + String system = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ - if (system.startsWith("z")) + if (system.startsWith("z")) //$NON-NLS-1$ { - _encodings.add("IBM-1047"); + _encodings.add("IBM-1047"); //$NON-NLS-1$ /* _encodings.add("Cp1047"); _encodings.add("Cp037"); @@ -65,12 +65,12 @@ public class OutputHandler extends Handler } else { - String specialEncoding = System.getProperty("dstore.stdin.encoding"); + String specialEncoding = System.getProperty("dstore.stdin.encoding"); //$NON-NLS-1$ if (specialEncoding != null) { _encodings.add(specialEncoding); } - _encodings.add(System.getProperty("file.encoding")); + _encodings.add(System.getProperty("file.encoding")); //$NON-NLS-1$ } } @@ -230,11 +230,10 @@ public class OutputHandler extends Handler String fullOutput = new String(readBytes, 0, numRead, encoding); // if output is not null, we assume the encoding was correct and process the output - if (fullOutput != null /*&& fullOutput.length() == numRead*/) - { + // tokenize the output so that we can get each line of output // the delimiters are therefore set to "\n\r" - StringTokenizer tokenizer = new StringTokenizer(fullOutput, "\n\r"); + StringTokenizer tokenizer = new StringTokenizer(fullOutput, "\n\r"); //$NON-NLS-1$ int numTokens = tokenizer.countTokens(); output = new String[numTokens]; int index = 0; @@ -247,7 +246,6 @@ public class OutputHandler extends Handler return output; } - } catch (Exception e) { } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/QueryPathThread.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/QueryPathThread.java index e3705872bcd..3e3eeb923b5 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/QueryPathThread.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/QueryPathThread.java @@ -56,13 +56,13 @@ public class QueryPathThread extends Thread DataElement envMinerData = _dataStore.findMinerInformation(EnvironmentMiner.MINER_ID); if (envMinerData != null) { - DataElement systemEnvironment = _dataStore.find(envMinerData, DE.A_NAME, "System Environment", 1); + DataElement systemEnvironment = _dataStore.find(envMinerData, DE.A_NAME, "System Environment", 1); //$NON-NLS-1$ if (systemEnvironment != null) { // d54675 // for Windows, ignore the case sensitiveness of PATH variable - boolean isIgnoreCase = System.getProperty("os.name").toLowerCase().startsWith("win"); - ArrayList vars = _dataStore.searchForPattern(systemEnvironment, DE.A_NAME, "PATH=*", isIgnoreCase); + boolean isIgnoreCase = System.getProperty("os.name").toLowerCase().startsWith("win"); //$NON-NLS-1$ //$NON-NLS-2$ + ArrayList vars = _dataStore.searchForPattern(systemEnvironment, DE.A_NAME, "PATH=*", isIgnoreCase); //$NON-NLS-1$ if (vars == null || vars.size() == 0) { return new ArrayList(); @@ -72,7 +72,7 @@ public class QueryPathThread extends Thread if (pathVariable != null) { String varStr = pathVariable.getValue(); - int separatorIndex = varStr.indexOf("="); + int separatorIndex = varStr.indexOf("="); //$NON-NLS-1$ if (separatorIndex > 0) { varStr = varStr.substring(separatorIndex + 1, varStr.length()); @@ -90,9 +90,9 @@ public class QueryPathThread extends Thread ArrayList addedPaths = new ArrayList(); ArrayList addedFolders = new ArrayList(); - boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("win"); + boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("win"); //$NON-NLS-1$ //$NON-NLS-2$ char separator = isWindows ? ';' : ':'; - StringTokenizer tokenizer = new StringTokenizer(path, separator + ""); + StringTokenizer tokenizer = new StringTokenizer(path, separator + ""); //$NON-NLS-1$ while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); @@ -124,7 +124,7 @@ public class QueryPathThread extends Thread resolvedPaths.add(abspath); } } - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _dataStore.refresh(status); _dataStore.disconnectObjects(status); } @@ -140,7 +140,7 @@ public class QueryPathThread extends Thread if (afile.isFile() && !afile.isHidden()) { String name = afile.getName(); - DataElement fileObj = _dataStore.createObject(status, "file", name); + DataElement fileObj = _dataStore.createObject(status, "file", name); //$NON-NLS-1$ fileObj.setAttribute(DE.A_SOURCE, afile.getAbsolutePath()); } } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/OutputPattern.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/OutputPattern.java index ea41cf21d83..f3927af76c0 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/OutputPattern.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/OutputPattern.java @@ -43,7 +43,7 @@ public class OutputPattern int nextSpace = 0; //Walk the matchOrder string parsing out words and adding them to _matchOrder...Could use StringTokenizer //but this seem much simpler. - while ((nextSpace = matchOrder.indexOf(" ", index)) > 0) + while ((nextSpace = matchOrder.indexOf(" ", index)) > 0) //$NON-NLS-1$ { _matchOrder.add(matchOrder.substring(index, nextSpace).toLowerCase()); index = nextSpace; @@ -71,18 +71,18 @@ public class OutputPattern return null; } - String fileString = ""; - String lineString = ""; + String fileString = ""; //$NON-NLS-1$ + String lineString = ""; //$NON-NLS-1$ //Groups start at 1 (group 0 is the entire match). for (int i = 1; i < _matchOrder.size(); i++) { String mStr = (String)_matchOrder.get(i); - if (mStr.equals("file")) + if (mStr.equals("file")) //$NON-NLS-1$ { fileString = matcher.group(i); } - else if (mStr.equals("line")) + else if (mStr.equals("line")) //$NON-NLS-1$ { lineString = matcher.group(i); } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/Patterns.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/Patterns.java index f494c0f94c2..3c5994b8ae2 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/Patterns.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/command/patterns/Patterns.java @@ -47,11 +47,11 @@ public class Patterns private boolean _isTerminal = false; private String _pluginPath; - private static String MINERS_PACKAGE = "org.eclipse.rse.services.dstore"; - private static String PATTERNS_FILE = "patterns.dat"; + private static String MINERS_PACKAGE = "org.eclipse.rse.services.dstore"; //$NON-NLS-1$ + private static String PATTERNS_FILE = "patterns.dat"; //$NON-NLS-1$ // HACK - too late in cycle to deal with version properly - for now this has to be fixed - private String _version = "8.0.0"; + private String _version = "8.0.0"; //$NON-NLS-1$ public Patterns(DataStore ds) { @@ -81,17 +81,17 @@ public class Patterns String result = theCommand; // for multi commands - int semiIndex = result.indexOf(";"); + int semiIndex = result.indexOf(";"); //$NON-NLS-1$ if (semiIndex > 0) { result = result.substring(0, semiIndex); } // for qualified commands - int spaceIndex = result.indexOf(" "); + int spaceIndex = result.indexOf(" "); //$NON-NLS-1$ if (spaceIndex > -1) { - int slashIndex = result.lastIndexOf("/", spaceIndex); + int slashIndex = result.lastIndexOf("/", spaceIndex); //$NON-NLS-1$ if ((slashIndex > 0)) { result = result.substring(slashIndex + 1, result.length()); @@ -99,7 +99,7 @@ public class Patterns } else { - int slashIndex = result.lastIndexOf("/"); + int slashIndex = result.lastIndexOf("/"); //$NON-NLS-1$ if ((slashIndex > 0)) { result = result.substring(slashIndex + 1, result.length()); @@ -131,13 +131,13 @@ public class Patterns if (_thePatternsFile == null) { - File thePatternsFile = new File(_pluginPath + "/" + MINERS_PACKAGE + "/" + PATTERNS_FILE); + File thePatternsFile = new File(_pluginPath + "/" + MINERS_PACKAGE + "/" + PATTERNS_FILE); //$NON-NLS-1$ //$NON-NLS-2$ if (!thePatternsFile.exists()) { - thePatternsFile = new File(_pluginPath + "/" + PATTERNS_FILE); + thePatternsFile = new File(_pluginPath + "/" + PATTERNS_FILE); //$NON-NLS-1$ if (!thePatternsFile.exists()) { - thePatternsFile = new File(_pluginPath + "/" + MINERS_PACKAGE + "_" + _version + "/" + PATTERNS_FILE); + thePatternsFile = new File(_pluginPath + "/" + MINERS_PACKAGE + "_" + _version + "/" + PATTERNS_FILE); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (!thePatternsFile.exists()) { @@ -187,7 +187,7 @@ public class Patterns catch (Exception e) { _dataStore.trace(e); - _dataStore.trace("failed to load patterns.dat with UTF-8. Trying with native encoding"); + _dataStore.trace("failed to load patterns.dat with UTF-8. Trying with native encoding"); //$NON-NLS-1$ try { @@ -228,9 +228,9 @@ public class Patterns continue; //Check if this line is the start of a new command section - if (curLine.startsWith("command")) + if (curLine.startsWith("command")) //$NON-NLS-1$ { - int colon = curLine.indexOf(":"); + int colon = curLine.indexOf(":"); //$NON-NLS-1$ //Check that there is something after the colon if (colon == (curLine.length() - 1)) continue; @@ -244,9 +244,9 @@ public class Patterns //If we get here, the line must be an output pattern else { - int firstSpace = curLine.indexOf(" "); - int patternWord = curLine.indexOf("pattern"); - int firstEquals = curLine.indexOf("="); + int firstSpace = curLine.indexOf(" "); //$NON-NLS-1$ + int patternWord = curLine.indexOf("pattern"); //$NON-NLS-1$ + int firstEquals = curLine.indexOf("="); //$NON-NLS-1$ if ((firstEquals == -1) || (firstEquals == (curLine.length() - 1))) continue; String objType = curLine.substring(0, firstSpace); @@ -294,7 +294,7 @@ public class Patterns if (curCommand.matchCommand(_currentCommand)) { - if (_currentCommand.equals("ls") && _isTerminal && !curCommand.getPattern().equals(".*")) + if (_currentCommand.equals("ls") && _isTerminal && !curCommand.getPattern().equals(".*")) //$NON-NLS-1$ //$NON-NLS-2$ { } else diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/environment/EnvironmentMiner.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/environment/EnvironmentMiner.java index d8a03c7293a..4da2e0997f8 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/environment/EnvironmentMiner.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/environment/EnvironmentMiner.java @@ -48,7 +48,7 @@ public class EnvironmentMiner extends Miner { if (_system == null) { - _system = _dataStore.createObject(_minerData, "Environment Variable", "System Environment"); + _system = _dataStore.createObject(_minerData, "Environment Variable", "System Environment"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.refresh(_minerData); } return _system; @@ -56,17 +56,17 @@ public class EnvironmentMiner extends Miner public void extendSchema(DataElement schemaRoot) { - DataElement envVar = _dataStore.createObjectDescriptor(schemaRoot, "Environment Variable"); - _dataStore.createReference(envVar, _dataStore.createRelationDescriptor(schemaRoot,"Parent Environment")); - DataElement containerObjectD = _dataStore.findObjectDescriptor("Container Object"); - _dataStore.createReference(containerObjectD, envVar, "abstracts", "abstracted by"); + DataElement envVar = _dataStore.createObjectDescriptor(schemaRoot, "Environment Variable"); //$NON-NLS-1$ + _dataStore.createReference(envVar, _dataStore.createRelationDescriptor(schemaRoot,"Parent Environment")); //$NON-NLS-1$ + DataElement containerObjectD = _dataStore.findObjectDescriptor("Container Object"); //$NON-NLS-1$ + _dataStore.createReference(containerObjectD, envVar, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ - createCommandDescriptor(containerObjectD, "Set Environment Variables", "C_SET_ENVIRONMENT_VARIABLES", false); - createCommandDescriptor(containerObjectD, "Set Environment Variables", "C_SET_ENVIRONMENT_VARIABLES_NO_SYSTEM", false); + createCommandDescriptor(containerObjectD, "Set Environment Variables", "C_SET_ENVIRONMENT_VARIABLES", false); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(containerObjectD, "Set Environment Variables", "C_SET_ENVIRONMENT_VARIABLES_NO_SYSTEM", false); //$NON-NLS-1$ //$NON-NLS-2$ - DataElement fsObj = _dataStore.findObjectDescriptor("Filesystem Objects"); - DataElement inhabits = _dataStore.createRelationDescriptor(schemaRoot, "inhabits"); - DataElement sustains = _dataStore.createRelationDescriptor(schemaRoot, "sustains"); + DataElement fsObj = _dataStore.findObjectDescriptor("Filesystem Objects"); //$NON-NLS-1$ + DataElement inhabits = _dataStore.createRelationDescriptor(schemaRoot, "inhabits"); //$NON-NLS-1$ + DataElement sustains = _dataStore.createRelationDescriptor(schemaRoot, "sustains"); //$NON-NLS-1$ _dataStore.createReference(envVar, sustains); _dataStore.createReference(fsObj, inhabits); @@ -77,13 +77,13 @@ public class EnvironmentMiner extends Miner * - temp directory (user.temp) * - user's home directory (user.home) */ - DataElement systemInfo = _dataStore.createObject(_minerData, "dstore.structureNode", "systemInfo"); + DataElement systemInfo = _dataStore.createObject(_minerData, "dstore.structureNode", "systemInfo"); //$NON-NLS-1$ //$NON-NLS-2$ - _dataStore.createObject(systemInfo, "system.property", "user.home", System.getProperty("user.home")); - _dataStore.createObject(systemInfo, "system.property", "temp.dir", System.getProperty("java.io.tmpdir")); + _dataStore.createObject(systemInfo, "system.property", "user.home", System.getProperty("user.home")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + _dataStore.createObject(systemInfo, "system.property", "temp.dir", System.getProperty("java.io.tmpdir")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - _dataStore.createObject(systemInfo, "system.property", "os.name", System.getProperty("os.name")); - _dataStore.createObject(systemInfo, "system.property", "os.version", System.getProperty("os.version")); + _dataStore.createObject(systemInfo, "system.property", "os.name", System.getProperty("os.name")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + _dataStore.createObject(systemInfo, "system.property", "os.version", System.getProperty("os.version")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ getSystemNode(); _dataStore.refresh(_minerData); @@ -98,7 +98,7 @@ public class EnvironmentMiner extends Miner DataElement env = getCommandArgument(theElement, 1); - if (name.equals("C_SET_ENVIRONMENT_VARIABLES")) + if (name.equals("C_SET_ENVIRONMENT_VARIABLES")) //$NON-NLS-1$ { if (_system.getNestedSize() == 0) { @@ -106,18 +106,18 @@ public class EnvironmentMiner extends Miner } handleSetEnvironment(subject, env); } - else if (name.equals("C_SET_ENVIRONMENT_VARIABLES_NO_SYSTEM")) + else if (name.equals("C_SET_ENVIRONMENT_VARIABLES_NO_SYSTEM")) //$NON-NLS-1$ { handleSetEnvironment(subject, env); } - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ return status; } public void handleSetEnvironment(DataElement theElement, DataElement environment) { - String envName = theElement.getValue() + ".env"; + String envName = theElement.getValue() + ".env"; //$NON-NLS-1$ //First check to see if we already have an Environment for theElement..and get rid of it if we do. DataElement envRoot = _dataStore.find(_minerData, DE.A_NAME, envName, 1); @@ -125,7 +125,7 @@ public class EnvironmentMiner extends Miner { _dataStore.deleteObject(_minerData, envRoot); _dataStore.refresh(_minerData); - List theReferences = theElement.getAssociated("inhabits"); + List theReferences = theElement.getAssociated("inhabits"); //$NON-NLS-1$ if (theReferences.size() > 0) { _dataStore.deleteObject(theElement, (DataElement)theReferences.get(0)); @@ -139,7 +139,7 @@ public class EnvironmentMiner extends Miner _minerData.addNestedData(environment, false); environment.setParent(_minerData); _dataStore.refresh(_minerData); - _dataStore.createReference(theElement, environment, "inhabits", "sustains"); + _dataStore.createReference(theElement, environment, "inhabits", "sustains"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.refresh(environment); _dataStore.refresh(theElement); } @@ -150,19 +150,19 @@ public class EnvironmentMiner extends Miner private void getSystemEnvironment() { - String envCommand = "sh -c env"; + String envCommand = "sh -c env"; //$NON-NLS-1$ - String theOS = System.getProperty("os.name").toLowerCase(); + String theOS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ //If we're on windows, change the envCommand. - if (theOS.startsWith("win")) - envCommand = "cmd /C set"; + if (theOS.startsWith("win")) //$NON-NLS-1$ + envCommand = "cmd /C set"; //$NON-NLS-1$ - if (theOS.startsWith("os/400")) + if (theOS.startsWith("os/400")) //$NON-NLS-1$ { - envCommand = "/QOpenSys/usr/bin/sh -c env"; + envCommand = "/QOpenSys/usr/bin/sh -c env"; //$NON-NLS-1$ } - String specialEncoding= System.getProperty("dstore.stdin.encoding"); + String specialEncoding= System.getProperty("dstore.stdin.encoding"); //$NON-NLS-1$ try { Process _process = Runtime.getRuntime().exec(envCommand); @@ -180,14 +180,14 @@ public class EnvironmentMiner extends Miner String curLine; while ( (curLine = _output.readLine()) != null) { - int eqIndex = curLine.indexOf("="); + int eqIndex = curLine.indexOf("="); //$NON-NLS-1$ if (eqIndex > 0) { - if (curLine.indexOf("=()") > 0) + if (curLine.indexOf("=()") > 0) //$NON-NLS-1$ { String multiLine =new String(curLine); - if (!curLine.endsWith("}")) + if (!curLine.endsWith("}")) //$NON-NLS-1$ { boolean complete = false; String subLine = null; @@ -202,16 +202,16 @@ public class EnvironmentMiner extends Miner } //String name = curLine.substring(0, eqIndex); - DataElement var = _dataStore.createObject(_system, "Environment Variable", curLine, multiLine); + DataElement var = _dataStore.createObject(_system, "Environment Variable", curLine, multiLine); //$NON-NLS-1$ var.setAttribute(DE.A_VALUE, multiLine); } else { - if (curLine.startsWith("PATH=")) + if (curLine.startsWith("PATH=")) //$NON-NLS-1$ { - curLine += ":."; + curLine += ":."; //$NON-NLS-1$ } - _dataStore.createObject(_system, "Environment Variable", curLine, curLine); + _dataStore.createObject(_system, "Environment Variable", curLine, curLine); //$NON-NLS-1$ } } @@ -221,12 +221,12 @@ public class EnvironmentMiner extends Miner } catch (IOException e) { - System.err.println("Error getting System Environment Variables\n" + e.getMessage()); + System.err.println("Error getting System Environment Variables\n" + e.getMessage()); //$NON-NLS-1$ } } public String getVersion() { - return "6.4.0"; + return "6.4.0"; //$NON-NLS-1$ } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/FileClassifier.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/FileClassifier.java index 8d86748fc68..143a5fa309b 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/FileClassifier.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/FileClassifier.java @@ -539,14 +539,14 @@ public class FileClassifier extends Thread { String referencedFile = aFile.getCanonicalPath(); - String specialEncoding = System.getProperty("dstore.stdin.encoding"); //$NON-NLS-1$ + // DKM - not sure why this was commented out but keeping it that way for now + String specialEncoding = null;//System.getProperty("dstore.stdin.encoding"); /* if (specialEncoding == null) { specialEncoding = System.getProperty("file.encoding"); } */ - specialEncoding = null; String args[] = new String[3]; args[0] = "sh"; //$NON-NLS-1$ args[1] = "-c"; //$NON-NLS-1$ @@ -556,11 +556,13 @@ public class FileClassifier extends Thread BufferedReader childReader = null; + /* if (specialEncoding != null && specialEncoding.length() > 0) { childReader = new BufferedReader(new InputStreamReader(childProcess.getInputStream(), specialEncoding)); } else + */ { childReader = new BufferedReader(new InputStreamReader(childProcess.getInputStream())); } @@ -621,8 +623,6 @@ public class FileClassifier extends Thread // if output is not null, we assume the encoding was correct and // process the output - if (fullOutput != null /* && fullOutput.length() == numRead */) - { // tokenize the output so that we can get each line of // output // the delimiters are therefore set to "\n\r" @@ -641,7 +641,6 @@ public class FileClassifier extends Thread } } } - } catch (Exception e) { e.printStackTrace(); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalByteStreamHandler.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalByteStreamHandler.java index 5863e9bf07b..31d775213a9 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalByteStreamHandler.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalByteStreamHandler.java @@ -106,8 +106,8 @@ public class UniversalByteStreamHandler extends ByteStreamHandler String bufferString = new String(buffer, 0, size, SystemEncodingUtil.ENCODING_UTF_8); // hack for zOS - String theOS = System.getProperty("os.name"); - if (theOS.toLowerCase().startsWith("z")) + String theOS = System.getProperty("os.name"); //$NON-NLS-1$ + if (theOS.toLowerCase().startsWith("z")) //$NON-NLS-1$ { bufferString = bufferString.replace('\r', ' '); } @@ -221,8 +221,8 @@ public class UniversalByteStreamHandler extends ByteStreamHandler String bufferString = new String(buffer, 0, size, SystemEncodingUtil.ENCODING_UTF_8); // hack for zOS - String theOS = System.getProperty("os.name"); - if (theOS.toLowerCase().startsWith("z")) + String theOS = System.getProperty("os.name"); //$NON-NLS-1$ + if (theOS.toLowerCase().startsWith("z")) //$NON-NLS-1$ { bufferString = bufferString.replace('\r', ' '); } @@ -249,7 +249,7 @@ public class UniversalByteStreamHandler extends ByteStreamHandler // divide appendedBuffer into chunks // at > 50M this kills Eclipse File oldFile = new File(fileName); - File newFile = new File(fileName + ".new"); + File newFile = new File(fileName + ".new"); //$NON-NLS-1$ newFile.createNewFile(); FileInputStream oldFileStream = new FileInputStream(oldFile); @@ -290,8 +290,8 @@ public class UniversalByteStreamHandler extends ByteStreamHandler String bufferString = new String(buffer, 0, size, SystemEncodingUtil.ENCODING_UTF_8); // hack for zOS - String theOS = System.getProperty("os.name"); - if (theOS.toLowerCase().startsWith("z")) + String theOS = System.getProperty("os.name"); //$NON-NLS-1$ + if (theOS.toLowerCase().startsWith("z")) //$NON-NLS-1$ { bufferString = bufferString.replace('\r', ' '); } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalDownloadHandler.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalDownloadHandler.java index 042751ce00f..c768663c22f 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalDownloadHandler.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalDownloadHandler.java @@ -73,7 +73,7 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand public void cancel() { - _dataStore.trace("cancelling download"); + _dataStore.trace("cancelling download"); //$NON-NLS-1$ _isCancelled = true; } @@ -85,7 +85,7 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand String remotePath = arg1.getName(); int buffer_size = IUniversalDataStoreConstants.BUFFER_SIZE; - DataElement bufferSizeElement = _dataStore.find(theElement, DE.A_TYPE, "buffer_size", 1); + DataElement bufferSizeElement = _dataStore.find(theElement, DE.A_TYPE, "buffer_size", 1); //$NON-NLS-1$ if (bufferSizeElement != null) { try @@ -110,7 +110,7 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand if (elementType.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) || elementType.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR) || elementType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR)) { - _dataStore.trace("download:" + remotePath + "," + elementType); + _dataStore.trace("download:" + remotePath + "," + elementType); //$NON-NLS-1$ //$NON-NLS-2$ File file = new File(remotePath); @@ -124,7 +124,7 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand { status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); resultType = IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION; - resultMessage = "Corrupted archive."; + resultMessage = "Corrupted archive."; //$NON-NLS-1$ _isDone = true; _dataStore.createObject(arg1, resultType, resultMessage); _dataStore.refresh(arg1); @@ -207,7 +207,7 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand totalWritten +=bytesRead; } - status.setAttribute(DE.A_SOURCE, "sent "+totalWritten + " of "+totalBytes); + status.setAttribute(DE.A_SOURCE, "sent "+totalWritten + " of "+totalBytes); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.refresh(status); available = bufInputStream.available(); } @@ -219,25 +219,25 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand } catch (FileNotFoundException e) { - UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); + UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); //$NON-NLS-1$ resultType = IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION; resultMessage = e.getLocalizedMessage(); } catch (UnsupportedEncodingException e) { - UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); + UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); //$NON-NLS-1$ resultType = IUniversalDataStoreConstants.DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION; resultMessage = e.getLocalizedMessage(); } catch (IOException e) { - UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); + UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); //$NON-NLS-1$ resultType = IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION; resultMessage = e.getLocalizedMessage(); } catch (Exception e) { - UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); + UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error reading file " + remotePath, e); //$NON-NLS-1$ resultType = IUniversalDataStoreConstants.DOWNLOAD_RESULT_EXCEPTION; resultMessage = e.getLocalizedMessage(); } @@ -253,7 +253,7 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand } catch (IOException e) { - UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error closing reader on " + remotePath, e); + UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, "handleDownload: error closing reader on " + remotePath, e); //$NON-NLS-1$ resultType = IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION; resultMessage = e.getMessage(); } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemFilter.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemFilter.java index f36f03cc963..575d7c672b8 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemFilter.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemFilter.java @@ -96,9 +96,9 @@ public class UniversalFileSystemFilter implements java.io.FilenameFilter, IUnive protected void setListValues(int includeFilesOrFolders, String nameFilter) { this.includeFilesOrFolders = includeFilesOrFolders; - if ((nameFilter!=null) && !nameFilter.equals("*")) + if ((nameFilter!=null) && !nameFilter.equals("*")) //$NON-NLS-1$ { - if (nameFilter.endsWith(",")) + if (nameFilter.endsWith(",")) //$NON-NLS-1$ matcher = new FileTypeMatcher(FileTypeMatcher.parseTypes(nameFilter), true); else matcher = new NamePatternMatcher(nameFilter, true, caseSensitive); @@ -117,7 +117,7 @@ public class UniversalFileSystemFilter implements java.io.FilenameFilter, IUnive protected void setListValues(int includeFilesOrFolders, String folderNameFilter, String fileNameFilter) { setListValues(includeFilesOrFolders, fileNameFilter); - if ((folderNameFilter!=null) && !folderNameFilter.equals("*")) + if ((folderNameFilter!=null) && !folderNameFilter.equals("*")) //$NON-NLS-1$ folderNameMatcher = new NamePatternMatcher(folderNameFilter, true, caseSensitive); } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemMiner.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemMiner.java index 4f044817fc1..75de16352de 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemMiner.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalFileSystemMiner.java @@ -121,8 +121,6 @@ public class UniversalFileSystemMiner extends Miner implements // TODO: test on WINDOWS! if ("C_QUERY_VIEW_ALL".equals(name)) { //$NON-NLS-1$ - if (subject != null) - { DataElement attributes = getCommandArgument(theElement, 1); if (attributes != null && attributes.getType().equals("attributes")) //$NON-NLS-1$ { @@ -134,13 +132,7 @@ public class UniversalFileSystemMiner extends Miner implements return handleQueryAll(subject, null, status, queryType, caseSensitive); } - } - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_VIEW_ALL - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_VIEW_FILES".equals(name)) { //$NON-NLS-1$ - if (subject != null) - { DataElement attributes = getCommandArgument(theElement, 1); if (attributes != null && attributes.getType().equals("attributes")) //$NON-NLS-1$ { @@ -152,13 +144,7 @@ public class UniversalFileSystemMiner extends Miner implements return handleQueryFiles(subject, null, status, queryType, caseSensitive); } - } - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_VIEW_FILES - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_VIEW_FOLDERS".equals(name)) { //$NON-NLS-1$ - if (subject != null) - { DataElement attributes = getCommandArgument(theElement, 1); if (attributes != null && attributes.getType().equals("attributes")) //$NON-NLS-1$ { @@ -170,170 +156,59 @@ public class UniversalFileSystemMiner extends Miner implements return handleQueryFolders(subject, null, status, queryType, caseSensitive); } - } - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_VIEW_FOLDERS - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_ROOTS".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryRoots(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_ROOTS - subject is null", null); //$NON-NLS-1$ } else if ("C_SEARCH".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleSearch(theElement, status, queryType, caseSensitive); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_SEARCH - subject is null", null); //$NON-NLS-1$ } else if ("C_CANCEL".equals(name)) { //$NON-NLS-1$ - if (subject != null) { -// String commandToCancel = subject.getName(); subject.getName(); return handleCancel(subject, status); - } else - UniversalServerUtilities.logError(CLASSNAME, - "C_CANCEL - subject is null", null); //$NON-NLS-1$ } else if ("C_RENAME".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleRename(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_RENAME - subject is null", null); //$NON-NLS-1$ } else if ("C_DELETE".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleDelete(subject, status, true); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_DELETE - subject is null", null); //$NON-NLS-1$ } else if ("C_DELETE_BATCH".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleDeleteBatch(theElement, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_DELETE_BATCH - subject is null", null); //$NON-NLS-1$ } else if ("C_COPY".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleCopy(subject, getCommandArgument(theElement, 1), getCommandArgument(theElement, 2), status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_COPY - subject is null", null); //$NON-NLS-1$ } else if ("C_COPY_BATCH".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleCopyBatch(subject, theElement, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_COPY_BATCH - subject is null", null); //$NON-NLS-1$ } else if ("C_CREATE_FILE".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleCreateFile(subject, status, queryType); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_CREATE_FILE - subject is null", null); //$NON-NLS-1$ } else if ("C_CREATE_FOLDER".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleCreateFolder(subject, status, queryType); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_CREATE_FOLDERS - subject is null", null); //$NON-NLS-1$ } else if ("C_SET_READONLY".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleSetReadOnly(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_SET_READONLY - subject is null", null); //$NON-NLS-1$ } else if ("C_SET_LASTMODIFIED".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleSetLastModified(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_SET_LASTMODIFIED - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_BASIC_PROPERTY".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryBasicProperty(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_BASIC_PROPERTY - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_CAN_WRITE_PROPERTY".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQuerycanWriteProperty(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_CAN_WRITE_PROPERTY - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_ADVANCE_PROPERTY".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryAdvanceProperty(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_ADVANCE_PROPERTY - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_FILE_CLASSIFICATIONS".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryFileClassification(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_FILE_CLASSIFICATION - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_FILE_CLASSIFICATION".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryFileClassification(subject, status); - else - UniversalServerUtilities - .logError( - CLASSNAME, - "C_QUERY_FOLDER_CLASSIFICATION - subject is null", //$NON-NLS-1$ - null); } else if ("C_QUERY_EXISTS".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryExists(subject, status, queryType); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_EXISTS - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_GET_REMOTE_OBJECT".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryGetRemoteObject(subject, status, queryType); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_GET_REMOTE_OBJECT- subject is null", null); //$NON-NLS-1$ } else if ("C_GET_OSTYPE".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleGetOSType(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_GET_OSTYPE - subject is null", null); //$NON-NLS-1$ } else if (C_DOWNLOAD_FILE.equals(name)) { - if (subject != null) - { return handleDownload(theElement, status); - } - else - UniversalServerUtilities.logError(CLASSNAME, C_DOWNLOAD_FILE - + " - subject is null", null); //$NON-NLS-1$ } else if (C_SYSTEM_ENCODING.equals(name)) { - if (subject != null) return handleQueryEncoding(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, C_SYSTEM_ENCODING - + " - subject is null", null); //$NON-NLS-1$ } else if (C_QUERY_UNUSED_PORT.equals(name)) { - if (subject != null) return handleQueryUnusedPort(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, C_QUERY_UNUSED_PORT - + " - subject is null", null); //$NON-NLS-1$ } else if ("C_QUERY_CLASSNAME".equals(name)) { //$NON-NLS-1$ - if (subject != null) return handleQueryClassName(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - "C_QUERY_CLASSNAME- subject is null", null); //$NON-NLS-1$ } else if (C_QUERY_QUALIFIED_CLASSNAME.equals(name)) { - if (subject != null) return handleQueryQualifiedClassName(subject, status); - else - UniversalServerUtilities.logError(CLASSNAME, - C_QUERY_QUALIFIED_CLASSNAME + " - subject is null", //$NON-NLS-1$ - null); } else { UniversalServerUtilities.logError(CLASSNAME, "Invalid query to handlecommand", null); //$NON-NLS-1$ @@ -1108,14 +983,14 @@ private DataElement createDataElementFromLSString(DataElement subject, UniversalServerUtilities .logError( CLASSNAME, - "The object to delete is neither a File or Folder! in handleDelete", + "The object to delete is neither a File or Folder! in handleDelete", //$NON-NLS-1$ null); } } catch (Exception e) { status.setAttribute(DE.A_SOURCE, FAILED_WITH_EXCEPTION + "|" + deleteObj.getAbsolutePath()); //$NON-NLS-1$ status.setAttribute(DE.A_VALUE, e.getLocalizedMessage()); UniversalServerUtilities.logError(CLASSNAME, - "Delete of the object failed", e); + "Delete of the object failed", e); //$NON-NLS-1$ } } _dataStore.refresh(subject); @@ -1164,7 +1039,7 @@ private DataElement createDataElementFromLSString(DataElement subject, boolean success = !(handler == null) && handler.fullRename(oldAbsPath.getVirtualPart(), newAbsPath.getVirtualPart()); - if (success) { + if (success && handler != null) { subject.setAttribute(DE.A_NAME, filerename.getName()); subject.setAttribute(DE.A_SOURCE, setProperties(handler .getVirtualFile(newAbsPath.getVirtualPart()))); @@ -1198,7 +1073,7 @@ private DataElement createDataElementFromLSString(DataElement subject, } catch (Exception e) { status.setAttribute(DE.A_SOURCE, FAILED); UniversalServerUtilities.logError(CLASSNAME, - "handleRename failed", e); + "handleRename failed", e); //$NON-NLS-1$ } } _dataStore.refresh(subject); @@ -1248,45 +1123,48 @@ private DataElement createDataElementFromLSString(DataElement subject, + File.separatorChar + subject.getName()); else UniversalServerUtilities.logError(CLASSNAME, - "Invalid query type to handleCreateFile", null); + "Invalid query type to handleCreateFile", null); //$NON-NLS-1$ - if (filename.exists()) - status.setAttribute(DE.A_SOURCE, FAILED_WITH_EXIST); - else { - try { - boolean done = filename.createNewFile(); - if (ArchiveHandlerManager.getInstance().isArchive(filename)) { - done = ArchiveHandlerManager.getInstance() - .createEmptyArchive(filename); - if (done) - subject.setAttribute(DE.A_TYPE, - UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR); - } else { - if (done) - { - subject.setAttribute(DE.A_TYPE, - UNIVERSAL_FILE_DESCRIPTOR); + if (filename != null) + { + if (filename.exists()) + status.setAttribute(DE.A_SOURCE, FAILED_WITH_EXIST); + else { + try { + boolean done = filename.createNewFile(); + if (ArchiveHandlerManager.getInstance().isArchive(filename)) { + done = ArchiveHandlerManager.getInstance() + .createEmptyArchive(filename); + if (done) + subject.setAttribute(DE.A_TYPE, + UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR); + } else { + if (done) + { + subject.setAttribute(DE.A_TYPE, + UNIVERSAL_FILE_DESCRIPTOR); + } } - } - subject.setAttribute(DE.A_SOURCE, setProperties(filename)); - if (done) { - status.setAttribute(DE.A_SOURCE, SUCCESS); - if (wasFilter) { - String fullName = subject.getValue(); - String name = fullName.substring(fullName - .lastIndexOf(File.separatorChar) + 1, fullName - .length()); - String path = fullName.substring(0, fullName - .lastIndexOf(File.separatorChar)); - subject.setAttribute(DE.A_NAME, name); - subject.setAttribute(DE.A_VALUE, path); - } - } else + subject.setAttribute(DE.A_SOURCE, setProperties(filename)); + if (done) { + status.setAttribute(DE.A_SOURCE, SUCCESS); + if (wasFilter) { + String fullName = subject.getValue(); + String name = fullName.substring(fullName + .lastIndexOf(File.separatorChar) + 1, fullName + .length()); + String path = fullName.substring(0, fullName + .lastIndexOf(File.separatorChar)); + subject.setAttribute(DE.A_NAME, name); + subject.setAttribute(DE.A_VALUE, path); + } + } else + status.setAttribute(DE.A_SOURCE, FAILED); + } catch (Exception e) { + UniversalServerUtilities.logError(CLASSNAME, + "handleCreateFile failed", e); //$NON-NLS-1$ status.setAttribute(DE.A_SOURCE, FAILED); - } catch (Exception e) { - UniversalServerUtilities.logError(CLASSNAME, - "handleCreateFile failed", e); - status.setAttribute(DE.A_SOURCE, FAILED); + } } } _dataStore.refresh(subject); @@ -1325,31 +1203,34 @@ private DataElement createDataElementFromLSString(DataElement subject, } else UniversalServerUtilities.logError(CLASSNAME, - "Invalid query type to handleCreateFolder", null); + "Invalid query type to handleCreateFolder", null); //$NON-NLS-1$ - if (filename.exists()) - status.setAttribute(DE.A_SOURCE, FAILED_WITH_EXIST); - else + if (filename != null) { - try { - boolean done = filename.mkdirs(); - if (done) - { - status.setAttribute(DE.A_SOURCE, SUCCESS); - subject.setAttribute(DE.A_SOURCE, setProperties(filename)); - subject.setAttribute(DE.A_TYPE,UNIVERSAL_FOLDER_DESCRIPTOR); - subject.setAttribute(DE.A_NAME, filename.getName()); - subject.setAttribute(DE.A_VALUE, filename.getParentFile().getAbsolutePath()); - } - else - { + if (filename.exists()) + status.setAttribute(DE.A_SOURCE, FAILED_WITH_EXIST); + else + { + try { + boolean done = filename.mkdirs(); + if (done) + { + status.setAttribute(DE.A_SOURCE, SUCCESS); + subject.setAttribute(DE.A_SOURCE, setProperties(filename)); + subject.setAttribute(DE.A_TYPE,UNIVERSAL_FOLDER_DESCRIPTOR); + subject.setAttribute(DE.A_NAME, filename.getName()); + subject.setAttribute(DE.A_VALUE, filename.getParentFile().getAbsolutePath()); + } + else + { + status.setAttribute(DE.A_SOURCE, FAILED); + } + + } catch (Exception e) { + UniversalServerUtilities.logError(CLASSNAME, + "handleCreateFolder failed", e); //$NON-NLS-1$ status.setAttribute(DE.A_SOURCE, FAILED); } - - } catch (Exception e) { - UniversalServerUtilities.logError(CLASSNAME, - "handleCreateFolder failed", e); - status.setAttribute(DE.A_SOURCE, FAILED); } } _dataStore.refresh(subject); @@ -1377,7 +1258,7 @@ private DataElement createDataElementFromLSString(DataElement subject, } } catch (Exception e) { UniversalServerUtilities.logError(CLASSNAME, - "handleSetreadOnly", e); + "handleSetreadOnly", e); //$NON-NLS-1$ } } _dataStore.refresh(subject); @@ -1409,7 +1290,7 @@ private DataElement createDataElementFromLSString(DataElement subject, status.setAttribute(DE.A_SOURCE, FAILED); } catch (Exception e) { UniversalServerUtilities.logError(CLASSNAME, - "handleSetLastModified", e); + "handleSetLastModified", e); //$NON-NLS-1$ } } _dataStore.refresh(subject); @@ -1512,7 +1393,7 @@ private DataElement createDataElementFromLSString(DataElement subject, } - if (fileobj.exists()) + if (fileobj != null && fileobj.exists()) status.setAttribute(DE.A_SOURCE, "true"); //$NON-NLS-1$ else status.setAttribute(DE.A_SOURCE, "false"); //$NON-NLS-1$ @@ -1532,9 +1413,9 @@ private DataElement createDataElementFromLSString(DataElement subject, isVirtual = ArchiveHandlerManager.isVirtual(fullName); String filterValue = subject.getValue(); // . translates to home dir - if (filterValue.equals(".")) + if (filterValue.equals(".")) //$NON-NLS-1$ { - filterValue = System.getProperty("user.home"); + filterValue = System.getProperty("user.home"); //$NON-NLS-1$ subject.setAttribute(DE.A_VALUE, filterValue); } if (!isVirtual) @@ -1561,11 +1442,11 @@ private DataElement createDataElementFromLSString(DataElement subject, } else { UniversalServerUtilities.logError(CLASSNAME, - "Invalid query type to handleQueryGetRemoteObject", null); + "Invalid query type to handleQueryGetRemoteObject", null); //$NON-NLS-1$ return statusDone(status); } - if (!isVirtual && fileobj.exists()) { + if (!isVirtual && fileobj != null && fileobj.exists()) { // Get the canonical path name so that we preserve case for Windows // systems. @@ -1597,7 +1478,7 @@ private DataElement createDataElementFromLSString(DataElement subject, } else { // directory subject.setAttribute(DE.A_TYPE, UNIVERSAL_FOLDER_DESCRIPTOR); - subject.setAttribute(DE.A_NAME, ""); + subject.setAttribute(DE.A_NAME, ""); //$NON-NLS-1$ subject.setAttribute(DE.A_VALUE, fullName); } @@ -1628,7 +1509,7 @@ private DataElement createDataElementFromLSString(DataElement subject, subject.setAttribute(DE.A_TYPE, UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR); subject.setAttribute(DE.A_NAME, child.name); - if (child.path.equals("")) { + if (child.path.equals("")) { //$NON-NLS-1$ subject.setAttribute(DE.A_VALUE, avp .getContainingArchiveString()); } else { @@ -1643,7 +1524,7 @@ private DataElement createDataElementFromLSString(DataElement subject, UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR); String name = child.name; String path = avp.getContainingArchiveString(); - if (!child.path.equals("")) { + if (!child.path.equals("")) { //$NON-NLS-1$ path = path + ArchiveHandlerManager.VIRTUAL_SEPARATOR + child.path; @@ -1657,7 +1538,7 @@ private DataElement createDataElementFromLSString(DataElement subject, status.setAttribute(DE.A_SOURCE, SUCCESS); } else { UniversalServerUtilities.logWarning(CLASSNAME, - "object does not exist"); + "object does not exist"); //$NON-NLS-1$ subject.setAttribute(DE.A_SOURCE, setProperties(child)); status .setAttribute(DE.A_SOURCE, @@ -1786,7 +1667,7 @@ private DataElement createDataElementFromLSString(DataElement subject, } catch (Exception e) { e.printStackTrace(); UniversalServerUtilities.logError(CLASSNAME, - "createDataElement failed with exception - isFile ", e); + "createDataElement failed with exception - isFile ", e); //$NON-NLS-1$ } } // end currentObj not 0 } @@ -1795,18 +1676,7 @@ private DataElement createDataElementFromLSString(DataElement subject, // then check if // it is already in datastore. If so do not recreate it. - if (list != null) - { - /* - * DKM: I've commented out this as we shouldn't need it any more - * with the above code working - * - * if (subject.getNestedData().size() != 0) { - * _dataStore.deleteObjects(subject); // subject.removeNestedData(); - * //System.out.println("removing nested data"); } - */ - // DKM - test - dummy object //ds.createObject(subject,UNIVERSAL_FILE_DESCRIPTOR,"I'm not really here!"); @@ -1890,70 +1760,73 @@ private DataElement createDataElementFromLSString(DataElement subject, } } - if (queryType.equals(UNIVERSAL_FILTER_DESCRIPTOR)) + if (deObj != null) { - deObj.setAttribute(DE.A_VALUE, subject.getAttribute(DE.A_VALUE)); - } - else - { - - if (subject.getName().length() > 0) + if (queryType.equals(UNIVERSAL_FILTER_DESCRIPTOR)) { - String valueStr = subject.getAttribute(DE.A_VALUE); - //String valueStr = list[i].getParentFile().getAbsolutePath(); - StringBuffer valueBuffer = new StringBuffer(valueStr); - if ((_isWindows && valueStr.endsWith("\\"))|| valueStr.endsWith("/") || subject.getName().startsWith("/")) + deObj.setAttribute(DE.A_VALUE, subject.getAttribute(DE.A_VALUE)); + } + else + { + + if (subject.getName().length() > 0) { - valueBuffer.append(subject.getName()); - deObj.setAttribute(DE.A_VALUE,valueBuffer.toString()); + String valueStr = subject.getAttribute(DE.A_VALUE); + //String valueStr = list[i].getParentFile().getAbsolutePath(); + StringBuffer valueBuffer = new StringBuffer(valueStr); + if ((_isWindows && valueStr.endsWith("\\"))|| valueStr.endsWith("/") || subject.getName().startsWith("/")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + { + valueBuffer.append(subject.getName()); + deObj.setAttribute(DE.A_VALUE,valueBuffer.toString()); + } + else + { + valueBuffer.append(File.separatorChar); + valueBuffer.append(subject.getName()); + deObj.setAttribute(DE.A_VALUE,valueBuffer.toString()); + } } else { - valueBuffer.append(File.separatorChar); - valueBuffer.append(subject.getName()); - deObj.setAttribute(DE.A_VALUE,valueBuffer.toString()); + String valueStr = list[i].getParentFile().getAbsolutePath(); + deObj.setAttribute(DE.A_VALUE, valueStr); } - } - else - { - String valueStr = list[i].getParentFile().getAbsolutePath(); - deObj.setAttribute(DE.A_VALUE, valueStr); } } } // DKM - do basic property stuff here String properties = setProperties(file); - - if (types != null) + if (deObj != null) { - /* - String oldClassification = getClassificationString(deObj.getAttribute(DE.A_SOURCE)); - if (oldClassification != null && !oldClassification.equals(types[i])) - { - deObj.setAttribute(DE.A_SOURCE, properties + "|" + oldClassification + " " + types[i]); - } - else - */ - { - deObj.setAttribute(DE.A_SOURCE, properties + "|" + types[i]); - } + if (types != null) + { + /* + String oldClassification = getClassificationString(deObj.getAttribute(DE.A_SOURCE)); + if (oldClassification != null && !oldClassification.equals(types[i])) + { + deObj.setAttribute(DE.A_SOURCE, properties + "|" + oldClassification + " " + types[i]); + } + else + */ + { + deObj.setAttribute(DE.A_SOURCE, properties + "|" + types[i]); //$NON-NLS-1$ + } + } + else + { + deObj.setAttribute(DE.A_SOURCE, properties); + } } - else - { - deObj.setAttribute(DE.A_SOURCE, properties); - } - } } catch (Exception e) { UniversalServerUtilities .logError( CLASSNAME, - "createDataElement failed with exception - isHidden ", + "createDataElement failed with exception - isHidden ", //$NON-NLS-1$ e); } } // end for - } // if list !=null //*/ } @@ -2034,7 +1907,7 @@ private DataElement createDataElementFromLSString(DataElement subject, } catch (Exception e) { e.printStackTrace(); UniversalServerUtilities.logError(CLASSNAME, - "createDataElement failed with exception - isFile ", e); + "createDataElement failed with exception - isFile ", e); //$NON-NLS-1$ } } // end currentObj not 0 } @@ -2108,10 +1981,10 @@ private DataElement createDataElementFromLSString(DataElement subject, if (isArchive) comment = ArchiveHandlerManager.getInstance().getComment(fileObj); else - comment = " "; + comment = " "; //$NON-NLS-1$ long compressedSize = size; - String compressionMethod = " "; + String compressionMethod = " "; //$NON-NLS-1$ double compressionRatio = 0; long expandedSize; @@ -2152,13 +2025,13 @@ private DataElement createDataElementFromLSString(DataElement subject, // These extra properties here might cause problems for older clients, // ie: a IndexOutOfBounds in UniversalFileImpl. String comment = fileObj.getComment(); - if (comment.equals("")) - comment = " "; // make sure this is still a + if (comment.equals("")) //$NON-NLS-1$ + comment = " "; // make sure this is still a //$NON-NLS-1$ // token long compressedSize = fileObj.getCompressedSize(); String compressionMethod = fileObj.getCompressionMethod(); - if (compressionMethod.equals("")) - compressionMethod = " "; + if (compressionMethod.equals("")) //$NON-NLS-1$ + compressionMethod = " "; //$NON-NLS-1$ double compressionRatio = fileObj.getCompressionRatio(); long expandedSize = size; @@ -2183,7 +2056,7 @@ private DataElement createDataElementFromLSString(DataElement subject, protected String getClassificationString(String s) { //StringTokenizer tokenizer = new StringTokenizer(s, TOKEN_SEPARATOR); - String[] str = s.split("\\"+TOKEN_SEPARATOR); + String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$ int tokens = str.length; if (tokens < 10) return null; @@ -2207,7 +2080,7 @@ private DataElement createDataElementFromLSString(DataElement subject, protected String getFilterString(String s) { //StringTokenizer tokenizer = new StringTokenizer(s, TOKEN_SEPARATOR); - String[] str = s.split("\\"+TOKEN_SEPARATOR); + String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$ int tokens = str.length; /* @@ -2224,8 +2097,8 @@ private DataElement createDataElementFromLSString(DataElement subject, } else { - System.out.println("problem with properties:"+s); - return "*"; + System.out.println("problem with properties:"+s); //$NON-NLS-1$ + return "*"; //$NON-NLS-1$ } } @@ -2235,7 +2108,7 @@ private DataElement createDataElementFromLSString(DataElement subject, protected boolean getShowHiddenFlag(String s) { //StringTokenizer tokenizer = new StringTokenizer(s, TOKEN_SEPARATOR); - String[] str = s.split("\\"+TOKEN_SEPARATOR); + String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$ int tokens = str.length; /* int tokens = tokenizer.countTokens(); @@ -2251,7 +2124,7 @@ private DataElement createDataElementFromLSString(DataElement subject, } else { - System.out.println("show hidden flag problem:"+s); + System.out.println("show hidden flag problem:"+s); //$NON-NLS-1$ return true; } } @@ -2261,7 +2134,7 @@ private DataElement createDataElementFromLSString(DataElement subject, */ protected int getDepth(String s) { - String[] str = s.split("\\"+TOKEN_SEPARATOR); + String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$ int tokens = str.length; /* StringTokenizer tokenizer = new StringTokenizer(s, TOKEN_SEPARATOR); @@ -2399,7 +2272,7 @@ private DataElement createDataElementFromLSString(DataElement subject, */ protected DataElement handleQueryEncoding(DataElement subject, DataElement status) { - String encoding = System.getProperty("file.encoding"); + String encoding = System.getProperty("file.encoding"); //$NON-NLS-1$ subject.setAttribute(DE.A_VALUE, encoding); _dataStore.refresh(subject); @@ -2421,7 +2294,7 @@ private DataElement createDataElementFromLSString(DataElement subject, socket.close(); } catch (IOException e) { - UniversalServerUtilities.logError(CLASSNAME, "Can not get unused port", e); + UniversalServerUtilities.logError(CLASSNAME, "Can not get unused port", e); //$NON-NLS-1$ port = -1; } @@ -2445,7 +2318,7 @@ private DataElement createDataElementFromLSString(DataElement subject, * Cancel status. */ public DataElement statusCancelled(DataElement status) { - status.setAttribute(DE.A_NAME, "cancelled"); + status.setAttribute(DE.A_NAME, "cancelled"); //$NON-NLS-1$ _dataStore.refresh(status); return status; } @@ -2455,12 +2328,12 @@ private DataElement createDataElementFromLSString(DataElement subject, */ public void load() { // Create datastore tree structure for UniversalFileSystemMiner - deUFSnode = _dataStore.createObject(_minerData, UNIVERSAL_NODE_DESCRIPTOR, "universal.node"); + deUFSnode = _dataStore.createObject(_minerData, UNIVERSAL_NODE_DESCRIPTOR, "universal.node"); //$NON-NLS-1$ // deUFStemp = _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.temp"); - _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.temp"); + _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.temp"); //$NON-NLS-1$ // deUFSfilters = _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.filters"); - _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.filters"); - deUFSuploadlog = _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.uploadlog"); + _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.filters"); //$NON-NLS-1$ + deUFSuploadlog = _dataStore.createObject(deUFSnode, UNIVERSAL_NODE_DESCRIPTOR, "universal.uploadlog"); //$NON-NLS-1$ UniversalByteStreamHandler universalHandler = new UniversalByteStreamHandler(_dataStore, deUFSuploadlog); @@ -2491,12 +2364,12 @@ private DataElement createDataElementFromLSString(DataElement subject, getInputStreamForFile(filename)); String name = parser.getPackageName(); if (name != null) { - _dataStore.createObject(status, "qualifiedClassName", name); + _dataStore.createObject(status, "qualifiedClassName", name); //$NON-NLS-1$ } else { - _dataStore.createObject(status, "qualifiedClassName", "null"); + _dataStore.createObject(status, "qualifiedClassName", "null"); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (java.io.IOException e) { - _dataStore.createObject(status, "qualifiedClassName", "null"); + _dataStore.createObject(status, "qualifiedClassName", "null"); //$NON-NLS-1$ //$NON-NLS-2$ } return statusDone(status); @@ -2520,7 +2393,7 @@ private DataElement createDataElementFromLSString(DataElement subject, // parent is virtual folder, so make separator "/" if (isParentVirtual) { - sep = "/"; + sep = "/"; //$NON-NLS-1$ } // file path @@ -2554,13 +2427,13 @@ private DataElement createDataElementFromLSString(DataElement subject, // otherwise, file is a virtual file else { String classification = SystemFileClassifier.getInstance().classifyFile(filePath); - String execJava = "executable(java:"; + String execJava = "executable(java:"; //$NON-NLS-1$ int idx = classification.indexOf(execJava); if (idx != -1) { idx = idx + execJava.length(); - int jdx = classification.indexOf(")", idx); + int jdx = classification.indexOf(")", idx); //$NON-NLS-1$ if (jdx != -1) { @@ -2568,7 +2441,7 @@ private DataElement createDataElementFromLSString(DataElement subject, className = classification.substring(idx, jdx); } else if (jdx == idx) { - className = ""; + className = ""; //$NON-NLS-1$ } } } @@ -2577,14 +2450,14 @@ private DataElement createDataElementFromLSString(DataElement subject, if (className != null) { _dataStore.createObject(status, TYPE_QUALIFIED_CLASSNAME, className); } else { - _dataStore.createObject(status, TYPE_QUALIFIED_CLASSNAME, "null"); + _dataStore.createObject(status, TYPE_QUALIFIED_CLASSNAME, "null"); //$NON-NLS-1$ } } catch (IOException e) { UniversalServerUtilities.logError(CLASSNAME, - "I/O error occured trying to read class file " + filePath, + "I/O error occured trying to read class file " + filePath, //$NON-NLS-1$ null); - _dataStore.createObject(status, TYPE_QUALIFIED_CLASSNAME, "null"); + _dataStore.createObject(status, TYPE_QUALIFIED_CLASSNAME, "null"); //$NON-NLS-1$ } return statusDone(status); @@ -2594,7 +2467,7 @@ private DataElement createDataElementFromLSString(DataElement subject, * Method to retrieve the OS that the miner is running. */ public DataElement handleGetOSType(DataElement subject, DataElement status) { - String osType = System.getProperty("os.name").toLowerCase(); + String osType = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ status.setAttribute(DE.A_SOURCE, osType); _dataStore.refresh(subject); return statusDone(status); @@ -2635,129 +2508,129 @@ private DataElement createDataElementFromLSString(DataElement subject, _dataStore.refresh(schemaRoot); // Define command descriptors - createCommandDescriptor(UniversalFilter, "Filter", "C_QUERY_VIEW_ALL"); - createCommandDescriptor(UniversalFilter, "Filter", "C_QUERY_VIEW_FILES"); - createCommandDescriptor(UniversalFilter, "Filter", - "C_QUERY_VIEW_FOLDERS"); - createCommandDescriptor(UniversalFilter, "Filter", "C_QUERY_ROOTS"); + createCommandDescriptor(UniversalFilter, "Filter", "C_QUERY_VIEW_ALL"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(UniversalFilter, "Filter", "C_QUERY_VIEW_FILES"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(UniversalFilter, "Filter", //$NON-NLS-1$ + "C_QUERY_VIEW_FOLDERS"); //$NON-NLS-1$ + createCommandDescriptor(UniversalFilter, "Filter", "C_QUERY_ROOTS"); //$NON-NLS-1$ //$NON-NLS-2$ - createCommandDescriptor(UniversalFilter, "GetOSType", "C_GET_OSTYPE"); - createCommandDescriptor(UniversalFilter, "Exists", "C_QUERY_EXISTS"); - createCommandDescriptor(UniversalFilter, "GetRemoteObject", - "C_QUERY_GET_REMOTE_OBJECT"); - createCommandDescriptor(UniversalFilter, "CreateNewFile", - "C_CREATE_FILE"); - createCommandDescriptor(UniversalFilter, "CreateNewFolder", - "C_CREATE_FOLDER"); - createCommandDescriptor(deUniversalFolderObject, "Filter", - "C_QUERY_VIEW_ALL"); - createCommandDescriptor(deUniversalFolderObject, "Filter", - "C_QUERY_VIEW_FILES"); - createCommandDescriptor(deUniversalFolderObject, "Filter", - "C_QUERY_VIEW_FOLDERS"); - createCommandDescriptor(deUniversalArchiveFileObject, "Filter", - "C_QUERY_VIEW_ALL"); - createCommandDescriptor(deUniversalArchiveFileObject, "Filter", - "C_QUERY_VIEW_FILES"); - createCommandDescriptor(deUniversalArchiveFileObject, "Filter", - "C_QUERY_VIEW_FOLDERS"); + createCommandDescriptor(UniversalFilter, "GetOSType", "C_GET_OSTYPE"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(UniversalFilter, "Exists", "C_QUERY_EXISTS"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(UniversalFilter, "GetRemoteObject", //$NON-NLS-1$ + "C_QUERY_GET_REMOTE_OBJECT"); //$NON-NLS-1$ + createCommandDescriptor(UniversalFilter, "CreateNewFile", //$NON-NLS-1$ + "C_CREATE_FILE"); //$NON-NLS-1$ + createCommandDescriptor(UniversalFilter, "CreateNewFolder", //$NON-NLS-1$ + "C_CREATE_FOLDER"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "Filter", //$NON-NLS-1$ + "C_QUERY_VIEW_ALL"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "Filter", //$NON-NLS-1$ + "C_QUERY_VIEW_FILES"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "Filter", //$NON-NLS-1$ + "C_QUERY_VIEW_FOLDERS"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalArchiveFileObject, "Filter", //$NON-NLS-1$ + "C_QUERY_VIEW_ALL"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalArchiveFileObject, "Filter", //$NON-NLS-1$ + "C_QUERY_VIEW_FILES"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalArchiveFileObject, "Filter", //$NON-NLS-1$ + "C_QUERY_VIEW_FOLDERS"); //$NON-NLS-1$ _dataStore.createReference(deUniversalFileObject, - deUniversalArchiveFileObject, "abstracts", "abstracted by"); + deUniversalArchiveFileObject, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.createReference(deUniversalFolderObject, - deUniversalArchiveFileObject, "abstracts", "abstracted by"); + deUniversalArchiveFileObject, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.createReference(deUniversalFileObject, - deUniversalVirtualFileObject, "abstracts", "abstracted by"); + deUniversalVirtualFileObject, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.createReference(deUniversalFolderObject, - deUniversalVirtualFolderObject, "abstracts", "abstracted by"); + deUniversalVirtualFolderObject, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ // create the search descriptor and make it cacnellable DataElement searchDescriptor = createCommandDescriptor( - deUniversalFolderObject, "Search", "C_SEARCH"); + deUniversalFolderObject, "Search", "C_SEARCH"); //$NON-NLS-1$ //$NON-NLS-2$ DataElement cancellable = _dataStore.find(schemaRoot, DE.A_NAME, DataStoreResources.model_Cancellable, 1); - _dataStore.createReference(cancellable, searchDescriptor, "abstracts", - "abstracted by"); + _dataStore.createReference(cancellable, searchDescriptor, "abstracts", //$NON-NLS-1$ + "abstracted by"); //$NON-NLS-1$ - createCommandDescriptor(deUniversalFolderObject, "GetAdvanceProperty", - "C_QUERY_ADVANCE_PROPERTY"); - createCommandDescriptor(tempnode, "Filter", "C_CREATE_TEMP"); - createCommandDescriptor(deUniversalFileObject, "Delete", "C_DELETE"); - createCommandDescriptor(deUniversalFileObject, "DeleteBatch", "C_DELETE_BATCH"); - createCommandDescriptor(deUniversalFileObject, "CreateNewFile", - "C_CREATE_FILE"); - createCommandDescriptor(deUniversalFileObject, "CreateNewFolder", - "C_CREATE_FOLDER"); - createCommandDescriptor(deUniversalFileObject, "Rename", "C_RENAME"); - createCommandDescriptor(deUniversalFileObject, "SetReadOnly", - "C_SET_READONLY"); - createCommandDescriptor(deUniversalFileObject, "SetLastModified", - "C_SET_LASTMODIFIED"); - createCommandDescriptor(deUniversalFileObject, "GetAdvanceProperty", - "C_QUERY_ADVANCE_PROPERTY"); + createCommandDescriptor(deUniversalFolderObject, "GetAdvanceProperty", //$NON-NLS-1$ + "C_QUERY_ADVANCE_PROPERTY"); //$NON-NLS-1$ + createCommandDescriptor(tempnode, "Filter", "C_CREATE_TEMP"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFileObject, "Delete", "C_DELETE"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFileObject, "DeleteBatch", "C_DELETE_BATCH"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFileObject, "CreateNewFile", //$NON-NLS-1$ + "C_CREATE_FILE"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFileObject, "CreateNewFolder", //$NON-NLS-1$ + "C_CREATE_FOLDER"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFileObject, "Rename", "C_RENAME"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFileObject, "SetReadOnly", //$NON-NLS-1$ + "C_SET_READONLY"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFileObject, "SetLastModified", //$NON-NLS-1$ + "C_SET_LASTMODIFIED"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFileObject, "GetAdvanceProperty", //$NON-NLS-1$ + "C_QUERY_ADVANCE_PROPERTY"); //$NON-NLS-1$ // dePropertyQuery = createCommandDescriptor(deUniversalFileObject, "GetBasicProperty", "C_QUERY_BASIC_PROPERTY"); - createCommandDescriptor(deUniversalFileObject, "GetBasicProperty", "C_QUERY_BASIC_PROPERTY"); + createCommandDescriptor(deUniversalFileObject, "GetBasicProperty", "C_QUERY_BASIC_PROPERTY"); //$NON-NLS-1$ //$NON-NLS-2$ - createCommandDescriptor(deUniversalFileObject, "GetcanWriteProperty", - "C_QUERY_CAN_WRITE_PROPERTY"); - createCommandDescriptor(deUniversalFileObject, "Exists", "C_QUERY_EXISTS"); + createCommandDescriptor(deUniversalFileObject, "GetcanWriteProperty", //$NON-NLS-1$ + "C_QUERY_CAN_WRITE_PROPERTY"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFileObject, "Exists", "C_QUERY_EXISTS"); //$NON-NLS-1$ //$NON-NLS-2$ - createCommandDescriptor(deUniversalFolderObject, "Delete", "C_DELETE"); - createCommandDescriptor(deUniversalFolderObject, "DeleteBatch", "C_DELETE_BATCH"); - createCommandDescriptor(deUniversalFolderObject, "Rename", "C_RENAME"); - createCommandDescriptor(deUniversalFolderObject, "Copy", "C_COPY"); - createCommandDescriptor(deUniversalFolderObject, "CopyBatch", "C_COPY_BATCH"); - createCommandDescriptor(deUniversalFolderObject, "CreateNewFolder", - "C_CREATE_FOLDER"); - createCommandDescriptor(deUniversalFolderObject, "SetReadOnly", - "C_SET_READONLY"); - createCommandDescriptor(deUniversalFolderObject, "SetLastModified", - "C_SET_LASTMODIFIED"); - createCommandDescriptor(deUniversalFolderObject, "GetBasicProperty", - "C_QUERY_BASIC_PROPERTY"); - createCommandDescriptor(deUniversalFolderObject, "GetcanWriteProperty", - "C_QUERY_CAN_WRITE_PROPERTY"); + createCommandDescriptor(deUniversalFolderObject, "Delete", "C_DELETE"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFolderObject, "DeleteBatch", "C_DELETE_BATCH"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFolderObject, "Rename", "C_RENAME"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFolderObject, "Copy", "C_COPY"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFolderObject, "CopyBatch", "C_COPY_BATCH"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFolderObject, "CreateNewFolder", //$NON-NLS-1$ + "C_CREATE_FOLDER"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "SetReadOnly", //$NON-NLS-1$ + "C_SET_READONLY"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "SetLastModified", //$NON-NLS-1$ + "C_SET_LASTMODIFIED"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "GetBasicProperty", //$NON-NLS-1$ + "C_QUERY_BASIC_PROPERTY"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "GetcanWriteProperty", //$NON-NLS-1$ + "C_QUERY_CAN_WRITE_PROPERTY"); //$NON-NLS-1$ // deFileClassificationQuery = createCommandDescriptor(deUniversalFileObject, "GetFileClassifications", "C_QUERY_FILE_CLASSIFICATIONS"); - createCommandDescriptor(deUniversalFileObject, "GetFileClassifications", "C_QUERY_FILE_CLASSIFICATIONS"); + createCommandDescriptor(deUniversalFileObject, "GetFileClassifications", "C_QUERY_FILE_CLASSIFICATIONS"); //$NON-NLS-1$ //$NON-NLS-2$ // deFolderClassificationQuery = createCommandDescriptor(deUniversalFolderObject, "GetFolderClassifications", "C_QUERY_FILE_CLASSIFICATION"); - createCommandDescriptor(deUniversalFolderObject, "GetFolderClassifications", "C_QUERY_FILE_CLASSIFICATION"); - createCommandDescriptor(deUniversalFolderObject, "Exists", - "C_QUERY_EXISTS"); - createCommandDescriptor(deUniversalFolderObject, "CreateNewFile", - "C_CREATE_FILE"); - createCommandDescriptor(deUniversalFolderObject, "CreateNewFolder", - "C_CREATE_FOLDER"); - createCommandDescriptor(deUniversalFolderObject, "GetOSType", - "C_GET_OSTYPE"); - createCommandDescriptor(deUniversalFileObject, "GetOSType", - "C_GET_OSTYPE"); + createCommandDescriptor(deUniversalFolderObject, "GetFolderClassifications", "C_QUERY_FILE_CLASSIFICATION"); //$NON-NLS-1$ //$NON-NLS-2$ + createCommandDescriptor(deUniversalFolderObject, "Exists", //$NON-NLS-1$ + "C_QUERY_EXISTS"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "CreateNewFile", //$NON-NLS-1$ + "C_CREATE_FILE"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "CreateNewFolder", //$NON-NLS-1$ + "C_CREATE_FOLDER"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFolderObject, "GetOSType", //$NON-NLS-1$ + "C_GET_OSTYPE"); //$NON-NLS-1$ + createCommandDescriptor(deUniversalFileObject, "GetOSType", //$NON-NLS-1$ + "C_GET_OSTYPE"); //$NON-NLS-1$ // create a download command descriptor and make it cancellable DataElement downloadDescriptor = createCommandDescriptor( - deUniversalFileObject, "DownloadFile", C_DOWNLOAD_FILE); + deUniversalFileObject, "DownloadFile", C_DOWNLOAD_FILE); //$NON-NLS-1$ _dataStore.createReference(cancellable, downloadDescriptor, - "abstracts", "abstracted by"); + "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.createReference(cancellable, downloadDescriptor, - "abstracts", "abstracted by"); + "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ DataElement adownloadDescriptor = createCommandDescriptor( - deUniversalArchiveFileObject, "DownloadFile", C_DOWNLOAD_FILE); + deUniversalArchiveFileObject, "DownloadFile", C_DOWNLOAD_FILE); //$NON-NLS-1$ _dataStore.createReference(cancellable, adownloadDescriptor, - "abstracts", "abstracted by"); + "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ _dataStore.createReference(cancellable, adownloadDescriptor, - "abstracts", "abstracted by"); + "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$ - createCommandDescriptor(tempnode, "SystemEncoding", C_SYSTEM_ENCODING); + createCommandDescriptor(tempnode, "SystemEncoding", C_SYSTEM_ENCODING); //$NON-NLS-1$ - createCommandDescriptor(tempnode, "UnusedPort", C_QUERY_UNUSED_PORT); + createCommandDescriptor(tempnode, "UnusedPort", C_QUERY_UNUSED_PORT); //$NON-NLS-1$ // command descriptor to retrieve package name for a class file - createCommandDescriptor(deUniversalFileObject, "GetQualifiedClassName", - "C_QUERY_CLASSNAME"); + createCommandDescriptor(deUniversalFileObject, "GetQualifiedClassName", //$NON-NLS-1$ + "C_QUERY_CLASSNAME"); //$NON-NLS-1$ // command descriptor to retrieve qualified class name for class file - createCommandDescriptor(deUniversalFileObject, "GetFullClassName", + createCommandDescriptor(deUniversalFileObject, "GetFullClassName", //$NON-NLS-1$ C_QUERY_QUALIFIED_CLASSNAME); } @@ -2825,7 +2698,7 @@ private DataElement createDataElementFromLSString(DataElement subject, String path = subject.getAttribute(DE.A_VALUE) + separatorChar + subject.getName(); String rootPath = path; - String virtualPath = ""; + String virtualPath = ""; //$NON-NLS-1$ VirtualChild[] children = null; @@ -2835,9 +2708,9 @@ private DataElement createDataElementFromLSString(DataElement subject, subject.setAttribute(DE.A_SOURCE, setProperties(fileobj, true)); if (foldersOnly) { - children = mgr.getFolderContents(fileobj, ""); + children = mgr.getFolderContents(fileobj, ""); //$NON-NLS-1$ } else { - children = mgr.getContents(fileobj, ""); + children = mgr.getContents(fileobj, ""); //$NON-NLS-1$ } } else if (subject.getType().equals( @@ -2859,13 +2732,13 @@ private DataElement createDataElementFromLSString(DataElement subject, subject.setAttribute(DE.A_SOURCE, setProperties(mgr.getVirtualObject(virtualPath))); if (children == null || children.length == 0) { - _dataStore.trace("problem with virtual:" + virtualPath); + _dataStore.trace("problem with virtual:" + virtualPath); //$NON-NLS-1$ } } else { - _dataStore.trace("problem with File:" + rootPath); + _dataStore.trace("problem with File:" + rootPath); //$NON-NLS-1$ } } - createDataElement(_dataStore, subject, children, "*", rootPath, virtualPath); + createDataElement(_dataStore, subject, children, "*", rootPath, virtualPath); //$NON-NLS-1$ _dataStore.refresh(subject); @@ -3043,7 +2916,7 @@ private DataElement createDataElementFromLSString(DataElement subject, srcFile = child.getExtractedFile(); } - String virtualContainer = ""; + String virtualContainer = ""; //$NON-NLS-1$ if (targetType.equals(UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { virtualContainer = vpath.getVirtualPart(); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalSearchHandler.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalSearchHandler.java index eebd6a1e4bc..3f202f48dfa 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalSearchHandler.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/filesystem/UniversalSearchHandler.java @@ -75,7 +75,7 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle _fsCaseSensitive = fsCaseSensitive; _alreadySearched = new HashSet(); - _deGrep = _dataStore.findObjectDescriptor("grep"); + _deGrep = _dataStore.findObjectDescriptor("grep"); //$NON-NLS-1$ _deFile = _dataStore.findObjectDescriptor(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR); _deFolder = _dataStore.findObjectDescriptor(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR); _deArchiveFile = _dataStore.findObjectDescriptor(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR); @@ -113,7 +113,7 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle internalSearch(_rootFile, _depth); } catch (Exception e) { - UniversalServerUtilities.logError(_miner.getName(), "Error occured when calling internal search", e); + UniversalServerUtilities.logError(_miner.getName(), "Error occured when calling internal search", e); //$NON-NLS-1$ } _isDone = true; @@ -128,7 +128,7 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle // to status refresh. As a result client thinks // search isn't finished. // _miner.statusDone(_status); - _status.setAttribute(DE.A_NAME, "done"); + _status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _dataStore.refresh(_status, true); // true indicates refresh immediately } } @@ -200,7 +200,7 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle deObj = _dataStore.createObject(null, _deVirtualFile, compareStr); // if parent of virtual child is archive, then create it this way - if (vc.path.equals("")) { + if (vc.path.equals("")) { //$NON-NLS-1$ deObj.setAttribute(DE.A_VALUE, vc.getContainingArchive().getAbsolutePath()); } else { @@ -291,7 +291,7 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle virtualchildren = ArchiveHandlerManager.getInstance().getContents(archive, virtualPath); } catch (IOException e) { - UniversalServerUtilities.logError(_miner.getName(), "Error occured trying to get the canonical file", e); + UniversalServerUtilities.logError(_miner.getName(), "Error occured trying to get the canonical file", e); //$NON-NLS-1$ } if (virtualchildren != null) { @@ -354,7 +354,7 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle return foundMatches; } catch (Exception e) { - UniversalServerUtilities.logError(_miner.getName(), "Error occured when trying to locate matches", e); + UniversalServerUtilities.logError(_miner.getName(), "Error occured when trying to locate matches", e); //$NON-NLS-1$ remoteFile.setAttribute(DE.A_VALUE, e.getMessage()); return false; } @@ -371,7 +371,7 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle */ protected boolean doesClassificationMatch(String absolutePath) { - if (_classificationString == null || _classificationString.equals("")) { + if (_classificationString == null || _classificationString.equals("")) { //$NON-NLS-1$ return true; } else { diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/IUniversalProcessDataStoreConstants.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/IUniversalProcessDataStoreConstants.java index e24eff4ff8b..ded21ee299a 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/IUniversalProcessDataStoreConstants.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/IUniversalProcessDataStoreConstants.java @@ -22,22 +22,22 @@ public interface IUniversalProcessDataStoreConstants /* * Miner name, used for logging */ - public static final String UNIVERSAL_PROCESS_MINER = "UniversalProcessMiner"; + public static final String UNIVERSAL_PROCESS_MINER = "UniversalProcessMiner"; //$NON-NLS-1$ // // Universal Process descriptors for DataStore DataElements // - public static final String UNIVERSAL_PROCESS_ROOT = "universal.process.root"; - public static final String UNIVERSAL_PROCESS_FILTER = "universal.process.filter"; - public static final String UNIVERSAL_PROCESS_DESCRIPTOR = "universal.process.descriptor"; - public static final String UNIVERSAL_PROCESS_TEMP = "universal.process.temp"; + public static final String UNIVERSAL_PROCESS_ROOT = "universal.process.root"; //$NON-NLS-1$ + public static final String UNIVERSAL_PROCESS_FILTER = "universal.process.filter"; //$NON-NLS-1$ + public static final String UNIVERSAL_PROCESS_DESCRIPTOR = "universal.process.descriptor"; //$NON-NLS-1$ + public static final String UNIVERSAL_PROCESS_TEMP = "universal.process.temp"; //$NON-NLS-1$ // // Universal Process Miner Commands // - public static final String C_PROCESS_FILTER_QUERY_ALL = "C_PROCESS_FILTER_QUERY_ALL"; - public static final String C_PROCESS_KILL = "C_PROCESS_KILL"; - public static final String C_PROCESS_QUERY_ALL_PROPERTIES = "C_PROCESS_QUERY_ALL_PROPERTIES"; - public static final String C_PROCESS_QUERY_USERNAME = "C_PROCESS_QUERY_USERNAME"; + public static final String C_PROCESS_FILTER_QUERY_ALL = "C_PROCESS_FILTER_QUERY_ALL"; //$NON-NLS-1$ + public static final String C_PROCESS_KILL = "C_PROCESS_KILL"; //$NON-NLS-1$ + public static final String C_PROCESS_QUERY_ALL_PROPERTIES = "C_PROCESS_QUERY_ALL_PROPERTIES"; //$NON-NLS-1$ + public static final String C_PROCESS_QUERY_USERNAME = "C_PROCESS_QUERY_USERNAME"; //$NON-NLS-1$ } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/UniversalProcessMiner.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/UniversalProcessMiner.java index cd99af072d6..ee282064a04 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/UniversalProcessMiner.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/processes/UniversalProcessMiner.java @@ -50,7 +50,7 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat private ProcessHandler handler; - private static final String _minerVersion = "7.0.0"; + private static final String _minerVersion = "7.0.0"; //$NON-NLS-1$ private DataElement deUniversalProcessObject, deUniversalProcessFilter, deKillInfoNode; private ProcessDEComparator _processDEcomparator; @@ -91,8 +91,8 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat if (subject == null) { - UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Subject for UniversalProcessMiner command " + name + " is null", null); - status.setAttribute(DE.A_NAME, "done"); + UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Subject for UniversalProcessMiner command " + name + " is null", null); //$NON-NLS-1$ //$NON-NLS-2$ + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ return status; } @@ -111,8 +111,8 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat } else { - UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Unknown filter command: " + name, null); - status.setAttribute(DE.A_NAME, "done"); + UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Unknown filter command: " + name, null); //$NON-NLS-1$ + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ } } else if (subjectType.equals(UNIVERSAL_PROCESS_DESCRIPTOR)) @@ -127,14 +127,14 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat } else { - UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Unsupported process command: " + name, null); - status.setAttribute(DE.A_NAME, "done"); + UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Unsupported process command: " + name, null); //$NON-NLS-1$ + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ } } else { - UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Unsupported subject for command: " + subject, null); - status.setAttribute(DE.A_NAME, "done"); + UniversalServerUtilities.logError(UNIVERSAL_PROCESS_MINER, "Unsupported subject for command: " + subject, null); //$NON-NLS-1$ + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ } return status; @@ -145,12 +145,12 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat */ protected DataElement handleQueryUserName(DataElement subject, DataElement status) { - String encoding = System.getProperty("user.name"); + String encoding = System.getProperty("user.name"); //$NON-NLS-1$ subject.setAttribute(DE.A_VALUE, encoding); _dataStore.refresh(subject); - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _dataStore.refresh(status); return status; } @@ -166,17 +166,17 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat DataElement tempnode = createObjectDescriptor(schemaRoot, UNIVERSAL_PROCESS_TEMP); // define command descriptors - createCommandDescriptor(deUniversalProcessFilter, "Filter", C_PROCESS_FILTER_QUERY_ALL); - createCommandDescriptor(deUniversalProcessObject, "Kill", C_PROCESS_KILL); - createCommandDescriptor(deUniversalProcessObject, "ProcessQueryAllProperties", C_PROCESS_QUERY_ALL_PROPERTIES); - createCommandDescriptor(tempnode, "QueryUsername", C_PROCESS_QUERY_USERNAME); + createCommandDescriptor(deUniversalProcessFilter, "Filter", C_PROCESS_FILTER_QUERY_ALL); //$NON-NLS-1$ + createCommandDescriptor(deUniversalProcessObject, "Kill", C_PROCESS_KILL); //$NON-NLS-1$ + createCommandDescriptor(deUniversalProcessObject, "ProcessQueryAllProperties", C_PROCESS_QUERY_ALL_PROPERTIES); //$NON-NLS-1$ + createCommandDescriptor(tempnode, "QueryUsername", C_PROCESS_QUERY_USERNAME); //$NON-NLS-1$ _dataStore.refresh(schemaRoot); } public void load() { - deKillInfoNode = _dataStore.createObject(_minerData, UNIVERSAL_NODE_DESCRIPTOR, "universal.killinfo"); + deKillInfoNode = _dataStore.createObject(_minerData, UNIVERSAL_NODE_DESCRIPTOR, "universal.killinfo"); //$NON-NLS-1$ deKillInfoNode.setAttribute(DE.A_VALUE, getSignalTypes()); _dataStore.refresh(_minerData); @@ -190,16 +190,14 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat { try { - Process kill = Runtime.getRuntime().exec("kill -l"); + Process kill = Runtime.getRuntime().exec("kill -l"); //$NON-NLS-1$ InputStreamReader isr = new InputStreamReader(kill.getInputStream()); - if (isr == null) return ""; BufferedReader reader = new BufferedReader(isr); - if (reader == null) return ""; String nextLine = reader.readLine(); - String output = ""; + String output = ""; //$NON-NLS-1$ while (nextLine != null) { - output = output + nextLine + "\n"; + output = output + nextLine + "\n"; //$NON-NLS-1$ nextLine = reader.readLine(); } reader.close(); @@ -208,7 +206,7 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat } catch (Exception e) { - return ""; + return ""; //$NON-NLS-1$ } } @@ -223,15 +221,15 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat lookupProcesses(pfs, subject); } catch (Exception e) { e.printStackTrace(); - UniversalServerUtilities.logError("UniversalProcessMiner", "handleQuery()", e); + UniversalServerUtilities.logError("UniversalProcessMiner", "handleQuery()", e); //$NON-NLS-1$ //$NON-NLS-2$ status.setAttribute(DE.A_VALUE, e.getMessage()); - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _dataStore.refresh(status); return status; } _dataStore.refresh(subject); - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ status.setAttribute(DE.A_VALUE, PROCESS_MINER_SUCCESS); return status; @@ -371,7 +369,7 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat private void createDataElement(IRemoteServerProcess process, DataElement subject) { DataElement dsObj = null; - dsObj = _dataStore.createObject(subject, deUniversalProcessObject, "" + process.getPid()); + dsObj = _dataStore.createObject(subject, deUniversalProcessObject, "" + process.getPid()); //$NON-NLS-1$ dsObj.setAttribute(DE.A_VALUE, process.getAllProperties()); } /** @@ -396,19 +394,19 @@ public class UniversalProcessMiner extends Miner implements IUniversalProcessDat if (result == null) _dataStore.deleteObject(subject.getParent(), subject); else { - subject.setAttribute(DE.A_SOURCE, ""); + subject.setAttribute(DE.A_SOURCE, ""); //$NON-NLS-1$ subject.setAttribute(DE.A_VALUE, result.getAllProperties()); } } catch (Exception e) { - UniversalServerUtilities.logError("UniversalProcessMiner", "handleQuery()", e); + UniversalServerUtilities.logError("UniversalProcessMiner", "handleQuery()", e); //$NON-NLS-1$ //$NON-NLS-2$ status.setAttribute(DE.A_VALUE, e.getMessage()); - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _dataStore.refresh(status); return status; } _dataStore.refresh(subject.getParent()); - status.setAttribute(DE.A_NAME, "done"); + status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ status.setAttribute(DE.A_VALUE, PROCESS_MINER_SUCCESS); return status; } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java index fed7236a8c1..2482edc11a7 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java @@ -34,7 +34,7 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple public DStoreShellOutputReader(IHostShell hostShell, DataElement status, boolean isErrorReader) { super(hostShell, isErrorReader); - setName("DStoreShellOutputReader"+getName()); + setName("DStoreShellOutputReader"+getName()); //$NON-NLS-1$ _status = status; if (status != null) { @@ -61,7 +61,7 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple String type = line.getType(); - boolean isError = type.equals("error") || type.equals("stderr"); + boolean isError = type.equals("error") || type.equals("stderr"); //$NON-NLS-1$ //$NON-NLS-2$ if (_isErrorReader && isError) { return new DStoreHostOutput(line); @@ -83,11 +83,11 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple e.printStackTrace(); } } - if (_status.getValue().equals("done")) + if (_status.getValue().equals("done")) //$NON-NLS-1$ { if (!_isErrorReader) { - DataElement dummyLine = _status.getDataStore().createObject(_status, "stdout", ""); + DataElement dummyLine = _status.getDataStore().createObject(_status, "stdout", ""); //$NON-NLS-1$ //$NON-NLS-2$ return new DStoreHostOutput(dummyLine); } else @@ -95,7 +95,7 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple return null; } } - return new SimpleHostOutput(""); + return new SimpleHostOutput(""); //$NON-NLS-1$ } public boolean listeningTo(DomainEvent e) @@ -105,7 +105,7 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple public void domainChanged(DomainEvent event) { - if (_status.getValue().equals("done")) + if (_status.getValue().equals("done")) //$NON-NLS-1$ { if (_status == event.getParent()) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java index 5d10e6e9c86..6ec878adc22 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java @@ -64,10 +64,10 @@ public class DStoreShellThread protected void init() { // make this subsystem a communications listener - DataElement contextDir = _dataStore.createObject(null, "directory", (new File(_cwd)).getName(), _cwd); + DataElement contextDir = _dataStore.createObject(null, "directory", (new File(_cwd)).getName(), _cwd); //$NON-NLS-1$ _dataStore.setObject(contextDir); setRemoteEnvironment(contextDir); - if (_invocation== null || _invocation.equals(">")) + if (_invocation== null || _invocation.equals(">")) //$NON-NLS-1$ { sendShellToMiner(contextDir); } @@ -92,7 +92,7 @@ public class DStoreShellThread String encoding = _encoding; if (encoding != null && encoding.length() > 0) { - DataElement arg = _dataStore.createObject(null, "shell.encoding", encoding); + DataElement arg = _dataStore.createObject(null, "shell.encoding", encoding); //$NON-NLS-1$ _status = _dataStore.command(cmdD, arg, contextDir); } else @@ -111,7 +111,7 @@ public class DStoreShellThread if (invocation != null && invocation.length() > 0) { - DataElement arg = _dataStore.createObject(null, "command", invocation); + DataElement arg = _dataStore.createObject(null, "command", invocation); //$NON-NLS-1$ _status = _dataStore.command(cmdD, arg, contextDir); } else @@ -130,15 +130,15 @@ public class DStoreShellThread if (_envVars != null && _envVars.length > 0) { - DataElement theEnvironment = _dataStore.createObject(null, "Environment Variable", theObject.getName()); + DataElement theEnvironment = _dataStore.createObject(null, "Environment Variable", theObject.getName()); //$NON-NLS-1$ for (int i = 0; i < _envVars.length; i++) { String var = _envVars[i]; - _dataStore.createObject(theEnvironment, "Environment Variable", var, var); + _dataStore.createObject(theEnvironment, "Environment Variable", var, var); //$NON-NLS-1$ } theEnvironment.setAttribute(DE.A_NAME, theObject.getId()); - DataElement contObj = _dataStore.findObjectDescriptor("Container Object"); + DataElement contObj = _dataStore.findObjectDescriptor("Container Object"); //$NON-NLS-1$ DataElement setD = getSetEnvironmentDescriptor(contObj); if (setD != null) { @@ -222,17 +222,17 @@ public class DStoreShellThread protected String getRunShellId() { - return "C_SHELL"; + return "C_SHELL"; //$NON-NLS-1$ } protected String getRunCommandId() { - return "C_COMMAND"; + return "C_COMMAND"; //$NON-NLS-1$ } protected String getSetEnvironmentId() { - return "C_SET_ENVIRONMENT_VARIABLES"; + return "C_SET_ENVIRONMENT_VARIABLES"; //$NON-NLS-1$ } @@ -241,21 +241,21 @@ public class DStoreShellThread DataElement commandElement = _status.getParent(); DataStore dataStore = commandElement.getDataStore(); - if (command.equals("") || command.equals("#break")) + if (command.equals("") || command.equals("#break")) //$NON-NLS-1$ //$NON-NLS-2$ { String cmd = command; - if (cmd.equals("")) - cmd = "#enter"; + if (cmd.equals("")) //$NON-NLS-1$ + cmd = "#enter"; //$NON-NLS-1$ DataElement commandDescriptor = getSendInputDescriptor(commandElement); if (commandDescriptor != null) { - DataElement in = dataStore.createObject(null, "input", cmd); + DataElement in = dataStore.createObject(null, "input", cmd); //$NON-NLS-1$ dataStore.command(commandDescriptor, in, commandElement); } } else { - String[] tokens = command.split("\n\r"); + String[] tokens = command.split("\n\r"); //$NON-NLS-1$ for (int i = 0; i = 8) { String minerId = getMinerId(); - String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); + String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); //$NON-NLS-1$ monitor.beginTask(message, IProgressMonitor.UNKNOWN); DataStore ds = getDataStore(); if (_minerElement == null || _minerElement.getDataStore() != ds) @@ -307,7 +312,7 @@ public abstract class AbstractDStoreService implements IDStoreService /** * For now just a dummy method * @param messageID - * @return + * @return the message */ public SystemMessage getMessage(String messageID) { diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java index 2725b8bf220..183cd73d605 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java @@ -62,17 +62,17 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer private int _bufferDownloadSize = IUniversalDataStoreConstants.BUFFER_SIZE; protected ISystemFileTypes _fileTypeRegistry; - private static String _percentMsg = SystemMessage.sub(SystemMessage.sub(SystemMessage.sub(ServiceResources.DStore_Service_Percent_Complete_Message, "&0", "{0}"), "&1", "{1}"), "&2", "{2}"); + private static String _percentMsg = SystemMessage.sub(SystemMessage.sub(SystemMessage.sub(ServiceResources.DStore_Service_Percent_Complete_Message, "&0", "{0}"), "&1", "{1}"), "&2", "{2}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ private static String[] _filterAttributes = { - "attributes", - "filter", - "filter.id", - "doc", - "", - "", + "attributes", //$NON-NLS-1$ + "filter", //$NON-NLS-1$ + "filter.id", //$NON-NLS-1$ + "doc", //$NON-NLS-1$ + "", //$NON-NLS-1$ + "", //$NON-NLS-1$ DataStoreResources.FALSE, - "2"}; + "2"}; //$NON-NLS-1$ public DStoreFileService(IDataStoreProvider dataStoreProvider, ISystemFileTypes fileTypeRegistry, ISystemMessageProvider msgProvider) { @@ -144,8 +144,8 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer String dataStoreLocalPath = localPath.substring(index + 1); - if (!dataStoreLocalPath.startsWith("/")) - dataStoreLocalPath = "/" + dataStoreLocalPath; + if (!dataStoreLocalPath.startsWith("/")) //$NON-NLS-1$ + dataStoreLocalPath = "/" + dataStoreLocalPath; //$NON-NLS-1$ return dataStoreLocalPath; } @@ -160,7 +160,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer DataElement minerInfo = getMinerElement(); if (_uploadLogElement == null || _uploadLogElement.getDataStore() != getDataStore()) { - _uploadLogElement = getDataStore().find(minerInfo, DE.A_NAME, "universal.uploadlog", 2); + _uploadLogElement = getDataStore().find(minerInfo, DE.A_NAME, "universal.uploadlog", 2); //$NON-NLS-1$ } return _uploadLogElement; } @@ -170,7 +170,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer DataElement attributes = getDataStore().createTransientObject(_filterAttributes); String version = VERSION_1; StringBuffer buffer = new StringBuffer(); - String filter = ((fileNameFilter == null) ? "*" : fileNameFilter); + String filter = ((fileNameFilter == null) ? "*" : fileNameFilter); //$NON-NLS-1$ buffer.append(version).append(TOKEN_SEPARATOR).append(filter).append(TOKEN_SEPARATOR).append(showHidden); attributes.setAttribute(DE.A_SOURCE, buffer.toString()); return attributes; @@ -440,15 +440,15 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer StringBuffer totalSentBuf = new StringBuffer(); totalSentBuf.append((totalSent / KB_IN_BYTES)); - totalSentBuf.append(" KB"); + totalSentBuf.append(" KB"); //$NON-NLS-1$ StringBuffer totalBuf = new StringBuffer(); totalBuf.append(totalBytes / KB_IN_BYTES); - totalBuf.append(" KB"); + totalBuf.append(" KB"); //$NON-NLS-1$ StringBuffer percentBuf = new StringBuffer(); percentBuf.append(percent); - percentBuf.append("%"); + percentBuf.append("%"); //$NON-NLS-1$ monitor.worked(bytesRead); @@ -609,7 +609,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer DataElement localElement = ds.createObject(universaltemp, de.getType(), localFile.getAbsolutePath(), encoding); - DataElement bufferSizeElement = ds.createObject(universaltemp, "buffer_size", "" + getBufferDownloadSize(), ""); + DataElement bufferSizeElement = ds.createObject(universaltemp, "buffer_size", "" + getBufferDownloadSize(), ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ DataElement queryCmd = getCommandDescriptor(de,C_DOWNLOAD_FILE); ArrayList argList = new ArrayList(); @@ -622,7 +622,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer DataElement status = ds.command(queryCmd, argList, subject); if (status == null) { - System.out.println("no download descriptor for "+remoteElement); + System.out.println("no download descriptor for "+remoteElement); //$NON-NLS-1$ } try { @@ -675,7 +675,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer else if (resultChild.getType().equals(DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION)) { localFile.delete(); - SystemMessage msg = getMessage("RSEF1001").makeSubstitution(DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION); + SystemMessage msg = getMessage("RSEF1001").makeSubstitution(DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION); //$NON-NLS-1$ throw new SystemMessageException(msg); } else if (resultChild.getType().equals(DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION)) @@ -690,7 +690,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer else if (resultChild.getType().equals(DOWNLOAD_RESULT_IO_EXCEPTION)) { localFile.delete(); - SystemMessage msg = getMessage("RSEF1001").makeSubstitution(DOWNLOAD_RESULT_IO_EXCEPTION); + SystemMessage msg = getMessage("RSEF1001").makeSubstitution(DOWNLOAD_RESULT_IO_EXCEPTION); //$NON-NLS-1$ throw new SystemMessageException(msg); //IOException e = new IOException(resultChild.getName()); //UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e); @@ -759,7 +759,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer public IHostFile getFile(IProgressMonitor monitor, String remoteParent, String name) { DataElement de = null; - if (name.equals(".") && name.equals(remoteParent)) + if (name.equals(".") && name.equals(remoteParent)) //$NON-NLS-1$ { de = getElementFor(name); } @@ -782,30 +782,30 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer */ protected String getSeparator(String parentPath) { - if (parentPath == null || parentPath.length() < 2) return "/"; + if (parentPath == null || parentPath.length() < 2) return "/"; //$NON-NLS-1$ if (parentPath.endsWith(ArchiveHandlerManager.VIRTUAL_SEPARATOR)) - return ""; + return ""; //$NON-NLS-1$ if (parentPath.endsWith(ArchiveHandlerManager.VIRTUAL_CANONICAL_SEPARATOR)) - return "/"; + return "/"; //$NON-NLS-1$ if (parentPath.charAt(1) == ':') //Windows path if (parentPath.indexOf(ArchiveHandlerManager.VIRTUAL_CANONICAL_SEPARATOR) != -1) - if (parentPath.endsWith("/")) - return ""; //already ends in separator - else return "/"; + if (parentPath.endsWith("/")) //$NON-NLS-1$ + return ""; //already ends in separator //$NON-NLS-1$ + else return "/"; //$NON-NLS-1$ else if (ArchiveHandlerManager.getInstance().isArchive(new File(parentPath))) return ArchiveHandlerManager.VIRTUAL_SEPARATOR; else - if (parentPath.endsWith("\\")) - return ""; //already ends in separator - else return "\\"; + if (parentPath.endsWith("\\")) //$NON-NLS-1$ + return ""; //already ends in separator //$NON-NLS-1$ + else return "\\"; //$NON-NLS-1$ else if (parentPath.charAt(0) == '/') //UNIX path if (ArchiveHandlerManager.getInstance().isArchive(new File(parentPath))) return ArchiveHandlerManager.VIRTUAL_SEPARATOR; else - if (parentPath.endsWith("/")) - return ""; //already ends in separator - else return "/"; - else return "/"; //unrecognized path + if (parentPath.endsWith("/")) //$NON-NLS-1$ + return ""; //already ends in separator //$NON-NLS-1$ + else return "/"; //$NON-NLS-1$ + else return "/"; //unrecognized path //$NON-NLS-1$ } protected IHostFile convertToHostFile(DataElement element) @@ -839,7 +839,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer public IHostFile getUserHome() { - return getFile(null, ".","."); + return getFile(null, ".","."); //$NON-NLS-1$ //$NON-NLS-2$ } public IHostFile createFile(IProgressMonitor monitor, String remoteParent, String fileName) throws SystemMessageException @@ -855,7 +855,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer return new DStoreHostFile(de); else { - throw new SystemMessageException(getMessage("RSEF1302").makeSubstitution(remotePath)); + throw new SystemMessageException(getMessage("RSEF1302").makeSubstitution(remotePath)); //$NON-NLS-1$ } } @@ -871,7 +871,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer return new DStoreHostFile(de); else { - throw new SystemMessageException(getMessage("RSEF1304").makeSubstitution(remotePath)); + throw new SystemMessageException(getMessage("RSEF1304").makeSubstitution(remotePath)); //$NON-NLS-1$ } } @@ -885,7 +885,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer if (de.getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR)) { if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) return true; - else throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); + else throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ } else { @@ -908,7 +908,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer DataElement status = dsStatusCommand(monitor, (DataElement) dataElements.get(0), dataElements, C_DELETE_BATCH); if (status == null) return false; if (FileSystemMessageUtil.getSourceMessage(status).startsWith(IServiceConstants.FAILED)) - throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); + throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ else return true; } @@ -925,7 +925,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer return true; else { - throw new SystemMessageException(getMessage("RSEF1301").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); + throw new SystemMessageException(getMessage("RSEF1301").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ } } @@ -1069,7 +1069,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer { ArrayList args = new ArrayList(); args.add(srcDE); - DataElement nameObj = ds.createObject(null, "name", tgtName); + DataElement nameObj = ds.createObject(null, "name", tgtName); //$NON-NLS-1$ args.add(nameObj); DataElement status = ds.command(cpCmd, args, tgtDE, true); @@ -1080,7 +1080,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer if (status.getAttribute(DE.A_SOURCE).equals(FAILED)) { - throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcName)); + throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcName)); //$NON-NLS-1$ /* // for an unexpected error, we don't have an error message from the server if (errMsg.equals(UNEXPECTED_ERROR)) { @@ -1128,7 +1128,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer getStatusMonitor(ds).waitForUpdate(status, monitor); if (status.getAttribute(DE.A_SOURCE).equals(FAILED)) { - throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcNames[0])); + throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcNames[0])); //$NON-NLS-1$ } } catch (InterruptedException e) @@ -1154,7 +1154,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer DataElement universaltemp = getMinerElement(); // create filter descriptor - DataElement deObj = ds.createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, "", "", "", false); + DataElement deObj = ds.createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, "", "", "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ DataElement[] results = dsQueryCommand(monitor, deObj, C_QUERY_ROOTS); return convertToHostFiles(results); @@ -1196,7 +1196,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer if (element == null || element.isDeleted()) { DataElement universaltemp = getMinerElement(); - element = getDataStore().createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, normalizedPath, normalizedPath, "", false); + element = getDataStore().createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, normalizedPath, normalizedPath, "", false); //$NON-NLS-1$ } return element; } @@ -1211,7 +1211,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer if (deObj == null) { DataElement universaltemp = getMinerElement(); - ds.createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, remoteParent, remoteParent, "", false); + ds.createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, remoteParent, remoteParent, "", false); //$NON-NLS-1$ } DataElement attributes = getAttributes(fileFilter, true); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java index 884525184f3..9bab37168c3 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java @@ -96,7 +96,7 @@ public class DStoreHostFile implements IHostFile String name = _element.getName(); String parentPath = getParentPath(); if (name.length() == 0 && - (parentPath.equals("/") || parentPath.endsWith(":\\"))) + (parentPath.equals("/") || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$ { return parentPath; @@ -166,7 +166,7 @@ public class DStoreHostFile implements IHostFile else { String str = getAttribute(_element.getSource(), ATTRIBUTE_IS_HIDDEN); - return(str.equals("true")); + return(str.equals("true")); //$NON-NLS-1$ } } } @@ -188,7 +188,7 @@ public class DStoreHostFile implements IHostFile String parentPath = _element.getValue(); String name = _element.getName(); if (parentPath == null || parentPath.length() == 0 || - (name.length() == 0 && (parentPath.equals("/") || parentPath.endsWith(":\\"))) + (name.length() == 0 && (parentPath.equals("/") || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$ ) { @@ -254,7 +254,7 @@ public class DStoreHostFile implements IHostFile } else { - return PathUtility.normalizeUnknown(parentPath + "/" + name); + return PathUtility.normalizeUnknown(parentPath + "/" + name); //$NON-NLS-1$ } } @@ -276,11 +276,11 @@ public class DStoreHostFile implements IHostFile { if (isFile()) { - classification = "file"; + classification = "file"; //$NON-NLS-1$ } else { - classification = "directory"; + classification = "directory"; //$NON-NLS-1$ } } return classification; @@ -305,7 +305,7 @@ public class DStoreHostFile implements IHostFile protected static String getAttribute(String attributes, int index) { - String[] str = attributes.split("\\"+IServiceConstants.TOKEN_SEPARATOR); + String[] str = attributes.split("\\"+IServiceConstants.TOKEN_SEPARATOR); //$NON-NLS-1$ if (str.length > index) { return str[index]; @@ -351,12 +351,12 @@ public class DStoreHostFile implements IHostFile public boolean canRead() { String str = getAttribute(_element.getSource(), ATTRIBUTE_CAN_READ); - return(str.equals("true")); + return(str.equals("true")); //$NON-NLS-1$ } public boolean canWrite() { String str = getAttribute(_element.getSource(), ATTRIBUTE_CAN_WRITE); - return(str.equals("true")); + return(str.equals("true")); //$NON-NLS-1$ } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java index e681893c6a5..20002588b6c 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java @@ -77,7 +77,7 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u { setProcess(dataElementObj); String name = dataElementObj.getName(); - _fullyQualifiedProcess = "/proc/" + name; + _fullyQualifiedProcess = "/proc/" + name; //$NON-NLS-1$ // if we already have retrieved file properties // set them now @@ -119,7 +119,7 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u if (s != null && s.length() > 0) { - String[] str = s.split("\\"+TOKEN_SEPARATOR); + String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$ int tokens = str.length; if (tokens > 1) { @@ -159,7 +159,7 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u */ public void setProcess(Object dataElementObj) { - _remoteObj = (DataElement) dataElementObj; + _remoteObj = dataElementObj; } /** @@ -196,7 +196,7 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u if (state == null) { //SystemPlugin.logError("Error in UniversalProcessImpl.getAttributes(): status of process " + getPid() + " is not given."); - return " "; + return " "; //$NON-NLS-1$ } else return state; } @@ -436,7 +436,7 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u */ protected void setVmSizeInKB(long size) { - String sizeStr = ""; + String sizeStr = ""; //$NON-NLS-1$ sizeStr = sizeStr + size; setSubAttribute(PROCESS_ATTRIBUTES_INDEX_VMSIZE, sizeStr); } @@ -446,7 +446,7 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u */ protected void setVmRSSInKB(long size) { - String sizeStr = ""; + String sizeStr = ""; //$NON-NLS-1$ sizeStr = sizeStr + size; setSubAttribute(PROCESS_ATTRIBUTES_INDEX_VMRSS, sizeStr); } @@ -468,9 +468,9 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u if (s != null && s.length() > 0) { - String[] str = s.split("\\"+TOKEN_SEPARATOR); + String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$ if (attIndex >= str.length) return null; - if (str[attIndex] == null || str[attIndex].equals("")) return null; + if (str[attIndex] == null || str[attIndex].equals("")) return null; //$NON-NLS-1$ else return str[attIndex]; } else return null; @@ -493,13 +493,13 @@ public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.u if (s != null && s.length() > 0) { - String[] str = s.split("\\"+TOKEN_SEPARATOR); + String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$ if (attIndex >= str.length) { // SystemPlugin.logError("Error in UniversalProcessImpl.setSubAttribute: Attribute index out of bounds."); return; } - s = ""; + s = ""; //$NON-NLS-1$ str[attIndex] = newSubAttribute; for (int i = 0; i < str.length; i++) { diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java index 55ad93ccf40..0d91d3f2138 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java @@ -75,7 +75,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro // create filter descriptor DataElement deObj; deObj = ds.find(universaltemp, DE.A_NAME, UNIVERSAL_PROCESS_ROOT, 1); - if (deObj == null) deObj = ds.createObject(universaltemp, UNIVERSAL_PROCESS_FILTER, UNIVERSAL_PROCESS_ROOT, "", "", false); + if (deObj == null) deObj = ds.createObject(universaltemp, UNIVERSAL_PROCESS_FILTER, UNIVERSAL_PROCESS_ROOT, "", "", false); //$NON-NLS-1$ //$NON-NLS-2$ deObj.setAttribute(DE.A_SOURCE, filter.toString()); // query @@ -92,7 +92,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro } catch (InterruptedException e) { - throw new SystemMessageException(getMessage("RSEG1067")); + throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$ } // get results List nested = deObj.getNestedData(); @@ -103,12 +103,12 @@ public class DStoreProcessService extends AbstractProcessService implements IPro String message = status.getAttribute(DE.A_VALUE); if (!message.equals(PROCESS_MINER_SUCCESS)) { - throw new SystemMessageException(getMessage("RSEPG1301")); + throw new SystemMessageException(getMessage("RSEPG1301")); //$NON-NLS-1$ } // convert objects to remote files String userName = getRemoteUserName(); - if (userName != null && filter.getUsername().equals("${user.id}")) + if (userName != null && filter.getUsername().equals("${user.id}")) //$NON-NLS-1$ filter.setUsername(getRemoteUserName()); processes = convertObjsToHostProcesses(filter, results); } @@ -169,7 +169,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro { _minerElement = getDataStore() .findMinerInformation( - "org.eclipse.rse.dstore.universal.miners.processes.UniversalProcessMiner"); + "org.eclipse.rse.dstore.universal.miners.processes.UniversalProcessMiner"); //$NON-NLS-1$ } return _minerElement; } @@ -213,8 +213,8 @@ public class DStoreProcessService extends AbstractProcessService implements IPro if (message.equals(PROCESS_MINER_SUCCESS)) return true; else { - SystemMessage msg = getMessage("RSEPG1300"); - msg.makeSubstitution(process.getName() + " (" + process.getPid() + ")", message); + SystemMessage msg = getMessage("RSEPG1300"); //$NON-NLS-1$ + msg.makeSubstitution(process.getName() + " (" + process.getPid() + ")", message); //$NON-NLS-1$ //$NON-NLS-2$ throw new SystemMessageException(msg); } } @@ -225,7 +225,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro } catch (InterruptedException e) { - throw new SystemMessageException(getMessage("RSEG1067")); + throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$ } return false; } @@ -254,7 +254,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro { DataElement sigTypesElement = getSignalTypesMinerElement(); String sigTypesOutput = sigTypesElement.getValue(); - String[] lines = sigTypesOutput.trim().split("\\s+"); + String[] lines = sigTypesOutput.trim().split("\\s+"); //$NON-NLS-1$ if (lines == null) throw new Exception(); return lines; } @@ -267,7 +267,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro protected DataElement getSignalTypesMinerElement() { - return getDataStore().find(_minerElement, DE.A_NAME, "universal.killinfo"); + return getDataStore().find(_minerElement, DE.A_NAME, "universal.killinfo"); //$NON-NLS-1$ } public void initService(IProgressMonitor monitor) @@ -316,7 +316,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro if (getServerVersion() >= 8) { String minerId = getMinerId(); - String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); + String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); //$NON-NLS-1$ monitor.beginTask(message, IProgressMonitor.UNKNOWN); DataStore ds = getDataStore(); if (_minerElement == null || _minerElement.getDataStore() != ds) @@ -341,7 +341,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro { DataStore ds = getDataStore(); - DataElement encodingElement = ds.createObject(null, UNIVERSAL_PROCESS_TEMP, ""); + DataElement encodingElement = ds.createObject(null, UNIVERSAL_PROCESS_TEMP, ""); //$NON-NLS-1$ DataElement queryCmd = ds.localDescriptorQuery(encodingElement.getDescriptor(), C_PROCESS_QUERY_USERNAME); DStoreStatusMonitor monitor = getStatusMonitor(ds); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java index 3d1ecf43ab7..cd078405733 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java @@ -70,7 +70,7 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc DataElement deObj = searchTarget.getDataElement(); DataStore ds = getDataStore(); - DataElement queryCmd = ds.localDescriptorQuery(deObj.getDescriptor(), "C_SEARCH"); + DataElement queryCmd = ds.localDescriptorQuery(deObj.getDescriptor(), "C_SEARCH"); //$NON-NLS-1$ if (queryCmd != null) { @@ -131,7 +131,7 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc DataElement command = status.getParent(); DataStore dataStore = command.getDataStore(); DataElement cmdDescriptor = command.getDescriptor(); - DataElement cancelDescriptor = dataStore.localDescriptorQuery(cmdDescriptor, "C_CANCEL"); + DataElement cancelDescriptor = dataStore.localDescriptorQuery(cmdDescriptor, "C_CANCEL"); //$NON-NLS-1$ if (cancelDescriptor != null) { diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java index fd2b5e8397d..553fafaece2 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java @@ -65,7 +65,7 @@ public class DStoreHostShell extends AbstractHostShell implements IHostShell public void exit() { - writeToShell("exit"); + writeToShell("exit"); //$NON-NLS-1$ _stdoutHandler.finish(); _stderrHandler.finish(); } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java index e3ecb43a4cd..70538dae07e 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java @@ -73,7 +73,7 @@ public class DStoreShellService extends AbstractDStoreService implements IShellS { waitForInitialize(null); } - return new DStoreHostShell(getStatusMonitor(getDataStore()), getDataStore(), initialWorkingDirectory, ">", encoding, environment); + return new DStoreHostShell(getStatusMonitor(getDataStore()), getDataStore(), initialWorkingDirectory, ">", encoding, environment); //$NON-NLS-1$ } public IHostShell runCommand(IProgressMonitor monitor, String initialWorkingDirectory, String command, @@ -105,7 +105,7 @@ public class DStoreShellService extends AbstractDStoreService implements IShellS DataElement envMinerData = ds.findMinerInformation(getEnvSystemMinerId()); if (envMinerData != null) { - DataElement systemEnvironment = ds.find(envMinerData, DE.A_NAME, "System Environment", 1); + DataElement systemEnvironment = ds.find(envMinerData, DE.A_NAME, "System Environment", 1); //$NON-NLS-1$ if (systemEnvironment != null && systemEnvironment.getNestedSize() > 0) { for (int i = 0; i < systemEnvironment.getNestedSize(); i++) @@ -172,7 +172,7 @@ public class DStoreShellService extends AbstractDStoreService implements IShellS if (getServerVersion() >= 8) { String minerId = getEnvSystemMinerId(); - String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); + String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); //$NON-NLS-1$ monitor.beginTask(message, IProgressMonitor.UNKNOWN); DataStore ds = getDataStore(); if (_envMinerElement == null || _envMinerElement.getDataStore() != ds) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java index bbab54b61af..8afb7cc1f46 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java @@ -44,7 +44,7 @@ public class DStoreFileTransferStatusListener extends StatusChangeListener _log = uploadLog; if (_log == null) { - throw new Exception("Could not find log in DataStore."); + throw new Exception("Could not find log in DataStore."); //$NON-NLS-1$ } setStatus(findOrCreateUploadStatus(ds)); } @@ -57,9 +57,9 @@ public class DStoreFileTransferStatusListener extends StatusChangeListener // but also need to handle case where it's been uploaded before in the sessoin (i.e. for reseting values) if (result == null) { - result = _log.getDataStore().createObject(_log, "uploadstatus", _remotePath); - result.setAttribute(DE.A_SOURCE, "running"); - result.setAttribute(DE.A_VALUE, ""); + result = _log.getDataStore().createObject(_log, "uploadstatus", _remotePath); //$NON-NLS-1$ + result.setAttribute(DE.A_SOURCE, "running"); //$NON-NLS-1$ + result.setAttribute(DE.A_VALUE, ""); //$NON-NLS-1$ DataElement cmd = ds.findCommandDescriptor(DataStoreSchema.C_SET); @@ -82,8 +82,8 @@ public class DStoreFileTransferStatusListener extends StatusChangeListener else { - result.setAttribute(DE.A_SOURCE, "running"); - result.setAttribute(DE.A_VALUE, ""); + result.setAttribute(DE.A_SOURCE, "running"); //$NON-NLS-1$ + result.setAttribute(DE.A_VALUE, ""); //$NON-NLS-1$ } _statusElement = result; return result; diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java index 89c9f97afd7..687138e9fa7 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java @@ -173,7 +173,7 @@ public class DStoreStatusMonitor implements IDomainListener */ public boolean determineStatusDone(DataElement status) { - return status.getAttribute(DE.A_VALUE).equals("done") || status.getAttribute(DE.A_NAME).equals("done"); + return status.getAttribute(DE.A_VALUE).equals("done") || status.getAttribute(DE.A_NAME).equals("done"); //$NON-NLS-1$ //$NON-NLS-2$ } /** diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java index b2286455422..d6a2a1d73c8 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java @@ -47,7 +47,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons private long _totalBytesNotified = 0; private long _totalLength; - private static String _percentMsg = SystemMessage.sub(SystemMessage.sub(SystemMessage.sub(ServiceResources.DStore_Service_Percent_Complete_Message, "&0", "{0}"), "&1", "{1}"), "&2", "{2}"); + private static String _percentMsg = SystemMessage.sub(SystemMessage.sub(SystemMessage.sub(ServiceResources.DStore_Service_Percent_Complete_Message, "&0", "{0}"), "&1", "{1}"), "&2", "{2}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ public DownloadListener(IProgressMonitor monitor, DataElement status, File localFile, String remotePath, long totalLength) { @@ -58,7 +58,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons if (_status == null) { - System.out.println("Status is null!"); + System.out.println("Status is null!"); //$NON-NLS-1$ } _dataStore = _status.getDataStore(); @@ -72,7 +72,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons //Process everything on event queue } } - if (_status.getValue().equals("done")) + if (_status.getValue().equals("done")) //$NON-NLS-1$ { updateDownloadState(); setDone(true); @@ -112,7 +112,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons */ public void domainChanged(DomainEvent event) { - if (_status.getValue().equals("done")) + if (_status.getValue().equals("done")) //$NON-NLS-1$ { if (_status == event.getParent()) { @@ -144,15 +144,15 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons StringBuffer current = new StringBuffer(); current.append(currentLength /KB_IN_BYTES); - current.append(" KB"); + current.append(" KB"); //$NON-NLS-1$ StringBuffer total = new StringBuffer(); total.append(_totalLength / KB_IN_BYTES); - total.append(" KB"); + total.append(" KB"); //$NON-NLS-1$ StringBuffer percentBuf = new StringBuffer(); percentBuf.append(percent); - percentBuf.append("%"); + percentBuf.append("%"); //$NON-NLS-1$ String str = MessageFormat.format(_percentMsg, new Object[] {current, total, percentBuf}); @@ -169,7 +169,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons } } - if (!_status.getDataStore().getStatus().getName().equals("okay")) + if (!_status.getDataStore().getStatus().getName().equals("okay")) //$NON-NLS-1$ { _networkDown = true; } @@ -257,7 +257,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons throw new InterruptedException(); } - if (getStatus().getAttribute(DE.A_NAME).equals("done")) + if (getStatus().getAttribute(DE.A_NAME).equals("done")) //$NON-NLS-1$ { setDone(true); } @@ -286,7 +286,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons setDone(true); throw new InterruptedException(); } - if (getStatus().getAttribute(DE.A_NAME).equals("done")) + if (getStatus().getAttribute(DE.A_NAME).equals("done")) //$NON-NLS-1$ { setDone(true); } @@ -308,7 +308,7 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons DataElement command = status.getParent(); DataStore dataStore = command.getDataStore(); DataElement cmdDescriptor = command.getDescriptor(); - DataElement cancelDescriptor = dataStore.localDescriptorQuery(cmdDescriptor, "C_CANCEL"); + DataElement cancelDescriptor = dataStore.localDescriptorQuery(cmdDescriptor, "C_CANCEL"); //$NON-NLS-1$ if (cancelDescriptor != null) { dataStore.command(cancelDescriptor, command); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java index d1d33058414..c7f036f0ad1 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java @@ -24,8 +24,8 @@ public class FileSystemMessageUtil { String source = element.getSource(); if (source == null) return null; - if (source.equals("")) return ""; - int sepIndex = source.indexOf("|"); + if (source.equals("")) return ""; //$NON-NLS-1$ //$NON-NLS-2$ + int sepIndex = source.indexOf("|"); //$NON-NLS-1$ if (sepIndex == -1) return source; else return source.substring(0, sepIndex); } @@ -39,9 +39,9 @@ public class FileSystemMessageUtil { String source = element.getSource(); if (source == null) return null; - if (source.equals("")) return ""; - int sepIndex = source.indexOf("|"); - if (sepIndex == -1) return ""; + if (source.equals("")) return ""; //$NON-NLS-1$ //$NON-NLS-2$ + int sepIndex = source.indexOf("|"); //$NON-NLS-1$ + if (sepIndex == -1) return ""; //$NON-NLS-1$ else return source.substring(sepIndex+1); } } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java index 10aaa1330c7..03313728e88 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java @@ -305,7 +305,7 @@ public class StatusChangeListener implements IDomainListener * @return true if status done, false otherwise. */ protected boolean determineStatusDone() { - return getStatus().getAttribute(DE.A_VALUE).equals("done") || getStatus().getAttribute(DE.A_NAME).equals("done"); + return getStatus().getAttribute(DE.A_VALUE).equals("done") || getStatus().getAttribute(DE.A_NAME).equals("done"); //$NON-NLS-1$ //$NON-NLS-2$ } /**