mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 12:55:40 +02:00
removing dstore compiler warnings
This commit is contained in:
parent
11098079b2
commit
0ee5f80598
33 changed files with 626 additions and 753 deletions
|
@ -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
|
||||
|
|
|
@ -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) {}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
|
|
|
@ -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', ' ');
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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 {
|
||||
|
|
|
@ -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$
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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 <tokens.length; i++)
|
||||
{
|
||||
String cmd = tokens[i];
|
||||
|
@ -265,7 +265,7 @@ public class DStoreShellThread
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,9 +100,14 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("no query command for "+ subject); //$NON-NLS-1$
|
||||
}
|
||||
return new DataElement[0];
|
||||
}
|
||||
|
||||
|
@ -274,7 +279,7 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
|
||||
}
|
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ public class StatusChangeListener implements IDomainListener
|
|||
* @return <code>true</code> if status done, <code>false</code> 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$
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue