From 48b45595df81af56a8606bee47647eeb5eb1fbf3 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 3 Jan 2007 17:36:42 +0000 Subject: [PATCH] removing some compile warnings --- .../files/ui/resources/ExtractToDialog.java | 13 ++-- .../files/core/AbstractLanguageUtility.java | 3 +- .../files/core/ILanguageUtility.java | 6 +- .../rse/subsystems/files/core/Activator.java | 2 +- .../core/model/ISystemFileRemoteTypes.java | 12 ++-- .../ISystemFileTransferModeRegistry.java | 62 +++++++++---------- .../core/model/RemoteFileFilterString.java | 26 ++++---- .../files/core/model/RemotePath.java | 3 +- .../files/core/model/RemotePathUtil.java | 6 +- .../model/SystemFileTransferModeMapping.java | 8 +-- .../model/SystemFileTransferModeRegistry.java | 24 +++---- .../FileServiceSubSystem.java | 19 +++--- .../IRemoteFileExceptionMessages.java | 10 +-- .../files/core/subsystems/RemoteFile.java | 14 ++--- .../core/subsystems/RemoteFileEmpty.java | 2 +- .../files/core/subsystems/RemoteFileRoot.java | 2 +- .../core/subsystems/RemoteFileSubSystem.java | 46 ++++++-------- .../core/util/ValidatorFileFilterString.java | 2 +- .../core/util/ValidatorFileUniqueName.java | 2 +- 19 files changed, 128 insertions(+), 134 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ExtractToDialog.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ExtractToDialog.java index 46ebb62f3b3..8afa6ddb590 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ExtractToDialog.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ExtractToDialog.java @@ -24,21 +24,20 @@ import org.eclipse.swt.widgets.Shell; public class ExtractToDialog extends SystemSelectRemoteFileOrFolderDialog { + + + private ExtractToForm form; + /** * Constructor * * @param shell The shell to hang the dialog off of - * @param fileMode True if selecting files, false if selecting folders * */ - - private ExtractToForm form; - - public ExtractToDialog(Shell shell) { super(shell, false); - setHelp(RSEUIPlugin.HELPPREFIX + "exdi0000"); + setHelp(RSEUIPlugin.HELPPREFIX + "exdi0000"); //$NON-NLS-1$ } /** * Constructor when you want to supply your own title. @@ -50,7 +49,7 @@ public class ExtractToDialog extends SystemSelectRemoteFileOrFolderDialog { public ExtractToDialog(Shell shell, String title) { super(shell, title, false); - setHelp(RSEUIPlugin.HELPPREFIX + "exdi0000"); + setHelp(RSEUIPlugin.HELPPREFIX + "exdi0000"); //$NON-NLS-1$ } protected SystemSelectRemoteFileOrFolderForm getForm(boolean fileMode) diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/AbstractLanguageUtility.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/AbstractLanguageUtility.java index d97b14f40a1..b9421a995dd 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/AbstractLanguageUtility.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/AbstractLanguageUtility.java @@ -49,8 +49,7 @@ public abstract class AbstractLanguageUtility implements ILanguageUtility { /** * Sets the language to which this utility applies. It could be one of * LANGUAGE_JAVA, LANGUAGE_C, and LANGUAGE_CPP, or - * another language. - * @return the language. + * another language. */ private void setLanguage(String language) { this.language = language; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/ILanguageUtility.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/ILanguageUtility.java index 90c72db4ce6..927950a883a 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/ILanguageUtility.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/ILanguageUtility.java @@ -27,17 +27,17 @@ public interface ILanguageUtility { /** * Constant for Java language. */ - public static final String LANGUAGE_JAVA = "Java"; + public static final String LANGUAGE_JAVA = "Java"; //$NON-NLS-1$ /** * Constant for C language. */ - public static final String LANGUAGE_C = "C"; + public static final String LANGUAGE_C = "C"; //$NON-NLS-1$ /** * Constant for C++ language. */ - public static final String LANGUAGE_CPP = "C++"; + public static final String LANGUAGE_CPP = "C++"; //$NON-NLS-1$ /** * Returns the subsystem with which the utility is associated. diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/Activator.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/Activator.java index cea6575e314..210af4dc0e7 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/Activator.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/Activator.java @@ -65,6 +65,6 @@ public class Activator extends AbstractUIPlugin { * @return the image descriptor */ public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.subsystems.files.core", path); + return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.subsystems.files.core", path); //$NON-NLS-1$ } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileRemoteTypes.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileRemoteTypes.java index d83f3649c5c..0f47208a055 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileRemoteTypes.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileRemoteTypes.java @@ -30,12 +30,12 @@ public interface ISystemFileRemoteTypes * There is only one type category for remote files. * It is "files". */ - public static final String TYPECATEGORY = "files"; + public static final String TYPECATEGORY = "files"; //$NON-NLS-1$ /** * There is only one type category for remote cmds. * It is "cmds". */ - public static final String TYPECMDCATEGORY = "cmds"; + public static final String TYPECMDCATEGORY = "cmds"; //$NON-NLS-1$ // ----------- // TYPES... @@ -44,11 +44,11 @@ public interface ISystemFileRemoteTypes /** * A folder object */ - public static final String TYPE_FOLDER = "folder"; + public static final String TYPE_FOLDER = "folder"; //$NON-NLS-1$ /** * A file object */ - public static final String TYPE_FILE = "file"; + public static final String TYPE_FILE = "file"; //$NON-NLS-1$ // ----------- // SUBTYPES... @@ -57,10 +57,10 @@ public interface ISystemFileRemoteTypes /** * A folder object */ - public static final String SUBTYPE_SUBFOLDER = "subfolder"; + public static final String SUBTYPE_SUBFOLDER = "subfolder"; //$NON-NLS-1$ /** * A root object */ - public static final String SUBTYPE_ROOT = "root"; + public static final String SUBTYPE_ROOT = "root"; //$NON-NLS-1$ } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileTransferModeRegistry.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileTransferModeRegistry.java index 46799713f13..ac09797a3f9 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileTransferModeRegistry.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileTransferModeRegistry.java @@ -27,25 +27,25 @@ public interface ISystemFileTransferModeRegistry extends ISystemFileTypes { // Default text file names - public static final String[] DEFAULT_TEXT_FILE_NAMES = {"application.xml", "build.properties", "fragment.xml", - "install.xml", "plugin.xml", "server-cfg.xml", "web.xml"}; + public static final String[] DEFAULT_TEXT_FILE_NAMES = {"application.xml", "build.properties", "fragment.xml", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + "install.xml", "plugin.xml", "server-cfg.xml", "web.xml"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ // Default text file types - public static final String[] DEFAULT_TEXT_FILE_EXTENSIONS = {"conxmi", "css", "dad", "dadx", "dbxmi", "dtd", - "ent", "htm", "html", "html-ss", "jardesc", - "java", "jhtml", "jpage", "jsp", "nst", - "properties", "schxmi", "shtm", "shtml", "tblxmi", - "tld", "txt", "wsdl", "xhtml", "xmi", "xml", - "xsd", "xsl"}; + public static final String[] DEFAULT_TEXT_FILE_EXTENSIONS = {"conxmi", "css", "dad", "dadx", "dbxmi", "dtd", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + "ent", "htm", "html", "html-ss", "jardesc", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + "java", "jhtml", "jpage", "jsp", "nst", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + "properties", "schxmi", "shtm", "shtml", "tblxmi", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + "tld", "txt", "wsdl", "xhtml", "xmi", "xml", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + "xsd", "xsl"}; //$NON-NLS-1$ //$NON-NLS-2$ // Default text file types that only we recognize through LPEX - public static final String[] DEFAULT_LPEX_TEXT_FILE_EXTENSIONS = {"app", "asm", "c", "c++", "cbl", "cc", "ccs", - "cmd", "cpp", "cpy", "cxx", "f", "f90", "f95", - "h", "h++", "hh", "hla", "hpp", "htm", "html", - "hxx", "inc", "inl", "jav", "java", "jcl", - "jj", "lx", "lxl", "lxu", "mac", "pli", "pro", - "properties", "rc", "rex", "rexx", "s", "sqc", - "sql", "sqlj", "xml", "xsl"}; + public static final String[] DEFAULT_LPEX_TEXT_FILE_EXTENSIONS = {"app", "asm", "c", "c++", "cbl", "cc", "ccs", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ + "cmd", "cpp", "cpy", "cxx", "f", "f90", "f95", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ + "h", "h++", "hh", "hla", "hpp", "htm", "html", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ + "hxx", "inc", "inl", "jav", "java", "jcl", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + "jj", "lx", "lxl", "lxu", "mac", "pli", "pro", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ + "properties", "rc", "rex", "rexx", "s", "sqc", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + "sql", "sqlj", "xml", "xsl"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ // the following need to match what is in plugin.xml! */ /* scrubbed by phil 10/16/2002... removed old code/400 extensions not used anymore, and added .cpy for cobol on ifs @@ -61,26 +61,26 @@ public interface ISystemFileTransferModeRegistry extends ISystemFileTypes "sir", "sqlc", "sqlcbl", "sqlcblle", "sqlcpple", "sqlrpg", "sqlrpgle", "srg"}; */ - public static final String[] DEFAULT_ISERIES_LPEX_TEXT_FILE_EXTENSIONS = {"c", "cbl", "cblle", "cicsc", - "cicscbl", "cicscblle", "cicssqlcbl", - "cl", "cle", "clle", "clp", "cmd", - "cob", - "cpp", "cpple", "cpy", "dspf", - "icff", - "lf", "mbr", "mnudds", - "pcml", - "pf", "pnlgrp", - "prtf", "rpg", "rpg36", - "rpg38", "rpgle", "rpgleinc", "rpt", - "sqlc", "sqlcbl", "sqlcblle", - "sqlcpple", "sqlrpg", "sqlrpgle", + public static final String[] DEFAULT_ISERIES_LPEX_TEXT_FILE_EXTENSIONS = {"c", "cbl", "cblle", "cicsc", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + "cicscbl", "cicscblle", "cicssqlcbl", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + "cl", "cle", "clle", "clp", "cmd", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + "cob", //$NON-NLS-1$ + "cpp", "cpple", "cpy", "dspf", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + "icff", //$NON-NLS-1$ + "lf", "mbr", "mnudds", //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ + "pcml", //$NON-NLS-1$ + "pf", "pnlgrp", //$NON-NLS-1$ //$NON-NLS-2$ + "prtf", "rpg", "rpg36", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + "rpg38", "rpgle", "rpgleinc", "rpt", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + "sqlc", "sqlcbl", "sqlcblle", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + "sqlcpple", "sqlrpg", "sqlrpgle", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }; /* added by phil 10/16/2002... */ - public static final String[] DEFAULT_UNIX_LPEX_TEXT_FILE_EXTENSIONS = {"csh", "ksh", "mak", "pl", "profile", "py", + public static final String[] DEFAULT_UNIX_LPEX_TEXT_FILE_EXTENSIONS = {"csh", "ksh", "mak", "pl", "profile", "py", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ }; - public static final String[] DEFAULT_BINARY_FILE_EXTENSIONS = {"xml", "jar", "zip", "tar", "exe", "gz", "z", - "gif","jpg"}; + public static final String[] DEFAULT_BINARY_FILE_EXTENSIONS = {"xml", "jar", "zip", "tar", "exe", "gz", "z", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ + "gif","jpg"}; //$NON-NLS-1$ //$NON-NLS-2$ // Get all file transfer mode mappings diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileFilterString.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileFilterString.java index 422f5f2c088..f653591b68e 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileFilterString.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileFilterString.java @@ -54,9 +54,9 @@ public class RemoteFileFilterString implements Cloneable //private RemoteFileSubSystemConfiguration subsysFactory; protected String PATH_SEP = java.io.File.separator; public static final char TYPE_SEP = ','; - public static final String TYPE_SEP_STRING = ","; - public static final String SWITCH_NOSUBDIRS = " /ns"; - public static final String SWITCH_NOFILES = " /nf"; + public static final String TYPE_SEP_STRING = ","; //$NON-NLS-1$ + public static final String SWITCH_NOSUBDIRS = " /ns"; //$NON-NLS-1$ + public static final String SWITCH_NOFILES = " /nf"; //$NON-NLS-1$ /** * Constructor to use for a filter to list roots when used absolutely, or list all contents @@ -64,7 +64,7 @@ public class RemoteFileFilterString implements Cloneable */ public RemoteFileFilterString() { - file = "*"; + file = "*"; //$NON-NLS-1$ subdirs = true; files = true; } @@ -81,7 +81,7 @@ public class RemoteFileFilterString implements Cloneable public RemoteFileFilterString(IRemoteFileSubSystemConfiguration subsysFactory) { PATH_SEP = subsysFactory.getSeparator(); - file = "*"; + file = "*"; //$NON-NLS-1$ subdirs = true; files = true; } @@ -172,9 +172,9 @@ public class RemoteFileFilterString implements Cloneable */ public static String getTypesString(String[] typesArray) { - StringBuffer typesBuffer = new StringBuffer(""); + StringBuffer typesBuffer = new StringBuffer(""); //$NON-NLS-1$ for (int idx=0; idx0) { path = input.substring(0,pathidx); - if (path.endsWith(":")) // special case: eg, given e: + if (path.endsWith(":")) // special case: eg, given e: //$NON-NLS-1$ path = path + PATH_SEP; // need it to be e:\ !! if (pathidx == (input.length()-1)) - file = "*"; + file = "*"; //$NON-NLS-1$ else //file = input.substring(pathidx+1); parseFileOrTypes(input.substring(pathidx+1)); @@ -322,7 +322,7 @@ public class RemoteFileFilterString implements Cloneable types = null; if ((filter == null) || (filter.length()==0)) { - file = "*"; + file = "*"; //$NON-NLS-1$ } else if (filter.endsWith(TYPE_SEP_STRING)) { diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java index 8bd09c147ca..d42ffacc2e7 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java @@ -235,8 +235,7 @@ public class RemotePath implements IRemotePath { remoteFile = subsys.getRemoteFileObject(absolutePath); } catch (SystemMessageException e) { - SystemBasePlugin.logError("Error occured trying to get remote file", e); - remoteFile = null; + SystemBasePlugin.logError("Error occured trying to get remote file", e); //$NON-NLS-1$ } return remoteFile; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePathUtil.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePathUtil.java index 911bcefc51d..7cdba240b47 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePathUtil.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePathUtil.java @@ -57,7 +57,7 @@ public class RemotePathUtil { * is not available. */ public IPath getClientTempLocationForFile(IRemotePath remotePath) { - String tempDirString = System.getProperty("java.io.tmpdir"); + String tempDirString = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$ IPath tempPath = new Path(tempDirString); @@ -69,7 +69,7 @@ public class RemotePathUtil { String absolutePath = remotePath.getAbsolutePath(); // try '/' first - String sep = "/"; + String sep = "/"; //$NON-NLS-1$ boolean isVirtual = remotePath.isVirtual(); @@ -87,7 +87,7 @@ public class RemotePathUtil { return null; } - sep = "\\"; + sep = "\\"; //$NON-NLS-1$ newPath = appendRemoteFileNameToPath(newPath, absolutePath, sep); diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeMapping.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeMapping.java index 75070beaf3c..25e9a1e703d 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeMapping.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeMapping.java @@ -36,7 +36,7 @@ public class SystemFileTransferModeMapping * Constructor for SystemFileTransferModeMapping */ public SystemFileTransferModeMapping(String extension) { - this("*", extension); + this("*", extension); //$NON-NLS-1$ } @@ -46,7 +46,7 @@ public class SystemFileTransferModeMapping public SystemFileTransferModeMapping(String name, String extension) { if ((name == null) || (name.length() < 1)) { - setName("*"); + setName("*"); //$NON-NLS-1$ } else { setName(name); @@ -69,7 +69,7 @@ public class SystemFileTransferModeMapping * @see ISystemFileTransferModeMapping#getLabel() */ public String getLabel() { - return (name + "." + extension); + return (name + "." + extension); //$NON-NLS-1$ } @@ -135,7 +135,7 @@ public class SystemFileTransferModeMapping public Object clone() { try { - return ((SystemFileTransferModeMapping)(super.clone())); + return super.clone(); } catch (CloneNotSupportedException e) { return null; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeRegistry.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeRegistry.java index 513ecdf92d2..3d7740bf4c2 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeRegistry.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/SystemFileTransferModeRegistry.java @@ -61,15 +61,15 @@ public class SystemFileTransferModeRegistry private RSEUIPlugin plugin; // Constants for reading from and writing to xml file - private static final String FILENAME = "fileTransferMode.xml"; + private static final String FILENAME = "fileTransferMode.xml"; //$NON-NLS-1$ private static final String ENCODING = SystemEncodingUtil.ENCODING_UTF_8; - private static final String ROOT_NODE = "mode"; - private static final String INFO_NODE = "info"; - private static final String NAME_ATTRIBUTE = "name"; - private static final String EXTENSION_ATTRIBUTE = "extension"; - private static final String MODE_ATTRIBUTE = "mode"; - private static final String BINARY_VALUE = "binary"; - private static final String TEXT_VALUE = "text"; + private static final String ROOT_NODE = "mode"; //$NON-NLS-1$ + private static final String INFO_NODE = "info"; //$NON-NLS-1$ + private static final String NAME_ATTRIBUTE = "name"; //$NON-NLS-1$ + private static final String EXTENSION_ATTRIBUTE = "extension"; //$NON-NLS-1$ + private static final String MODE_ATTRIBUTE = "mode"; //$NON-NLS-1$ + private static final String BINARY_VALUE = "binary"; //$NON-NLS-1$ + private static final String TEXT_VALUE = "text"; //$NON-NLS-1$ /** @@ -525,7 +525,7 @@ public class SystemFileTransferModeRegistry result = true; } catch (Exception e) { - SystemBasePlugin.logError("Could not read transfer mode xml file", e); + SystemBasePlugin.logError("Could not read transfer mode xml file", e); //$NON-NLS-1$ result = false; } finally { @@ -536,7 +536,7 @@ public class SystemFileTransferModeRegistry reader.close(); } catch (Exception e) { - SystemBasePlugin.logError("Could not close reader for transfer mode xml file", e); + SystemBasePlugin.logError("Could not close reader for transfer mode xml file", e); //$NON-NLS-1$ } } @@ -573,7 +573,7 @@ public class SystemFileTransferModeRegistry memento.save(writer); } catch (Exception e) { - SystemBasePlugin.logError("Could not write to transfer mode xml file", e); + SystemBasePlugin.logError("Could not write to transfer mode xml file", e); //$NON-NLS-1$ } finally { @@ -583,7 +583,7 @@ public class SystemFileTransferModeRegistry writer.close(); } catch (Exception e) { - SystemBasePlugin.logError("Could not close writer for transfer mode xml file", e); + SystemBasePlugin.logError("Could not close writer for transfer mode xml file", e); //$NON-NLS-1$ } } } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java index 09ed421d53a..2ac8de3225f 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java @@ -328,17 +328,18 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I parentPath = "/"; //$NON-NLS-1$ } - if (!parent.canRead()) + if (parent != null && !parent.canRead()) { SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath); throw new SystemMessageException(msg); } - IHostFile[] results = getFilesAndFolders(monitor, parentPath, fileNameFilter); + IHostFile[] results = getFilesAndFolders(monitor, parentPath, fileNameFilter); - IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results); + IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results); + if (parent != null) parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr); - return farr; + return farr; } /** @@ -358,7 +359,7 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I parentPath = "/"; //$NON-NLS-1$ } - if (!parent.canRead()) + if (parent != null && !parent.canRead()) { SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath); throw new SystemMessageException(msg); @@ -374,7 +375,8 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I } IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results); - parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr); + if (parent != null) + parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr); return farr; } @@ -394,7 +396,7 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I parentPath = "/"; //$NON-NLS-1$ } - if (!parent.canRead()) + if (parent != null && !parent.canRead()) { SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath); throw new SystemMessageException(msg); @@ -409,7 +411,8 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I { } IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results); - parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr); + if (parent != null) + parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr); return farr; } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileExceptionMessages.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileExceptionMessages.java index 6ff78c0e2c3..cf2f28bee8f 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileExceptionMessages.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileExceptionMessages.java @@ -27,11 +27,11 @@ public interface IRemoteFileExceptionMessages //public static final String FILEMSG_PREFIX = PLUGIN_ID+".ui.filemsg."; // Messages - public static final String FILEMSG_IO_ERROR = "RSEF1001"; - public static final String FILEMSG_SECURITY_ERROR = "RSEF1002"; + public static final String FILEMSG_IO_ERROR = "RSEF1001"; //$NON-NLS-1$ + public static final String FILEMSG_SECURITY_ERROR = "RSEF1002"; //$NON-NLS-1$ - public static final String FILEMSG_FOLDER_NOTEMPTY = "RSEF1003"; - public static final String FILEMSG_FOLDER_NOTFOUND = "RSEF1004"; + public static final String FILEMSG_FOLDER_NOTEMPTY = "RSEF1003"; //$NON-NLS-1$ + public static final String FILEMSG_FOLDER_NOTFOUND = "RSEF1004"; //$NON-NLS-1$ - public static final String FILEMSG_FILE_NOTFOUND = "RSEF1005"; + public static final String FILEMSG_FILE_NOTFOUND = "RSEF1005"; //$NON-NLS-1$ } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java index b81ada9e191..7d3eb66703e 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java @@ -178,7 +178,7 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable // _context.getParentRemoteFile(); String pathOnly = getParentPath(); - if ((parentFile == null) && (pathOnly != null)) + if (pathOnly != null) { IRemoteFileSubSystem ss = _context.getParentRemoteFileSubSystem(); if (ss != null) @@ -188,19 +188,19 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable if (pathOnly.length() == 0) parentFile = ss.getRemoteFileObject(pathOnly); else if (pathOnly.length() == 1) - parentFile = null; + { + // parentFile is already null + //parentFile = null; + } else if (!(pathOnly.charAt(pathOnly.length()-1)==sep)) parentFile = ss.getRemoteFileObject(pathOnly+sep); else parentFile = ss.getRemoteFileObject(pathOnly); } catch (SystemMessageException e) { - SystemBasePlugin.logError("RemoteFileImpl.getParentRemoteFile()", e); + SystemBasePlugin.logError("RemoteFileImpl.getParentRemoteFile()", e); //$NON-NLS-1$ } } } - else if (parentFile != null) - { - } else { } @@ -1124,7 +1124,7 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable String otherPath = other.getAbsolutePath(); String path = this.getAbsolutePath(); - String otherHost = other.getHostName(); + //String otherHost = other.getHostName(); String alias1 = this.getParentRemoteFileSubSystem().getHostAliasName(); String alias2 = other.getParentRemoteFileSubSystem().getHostAliasName(); diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileEmpty.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileEmpty.java index 0f1029d5779..973f2d7c79a 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileEmpty.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileEmpty.java @@ -38,7 +38,7 @@ public class RemoteFileEmpty extends RemoteFile public String getName() { - return "dummy"; + return "dummy"; //$NON-NLS-1$ } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileRoot.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileRoot.java index 009b8633e0b..26e92d1f96c 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileRoot.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileRoot.java @@ -71,7 +71,7 @@ public class RemoteFileRoot extends RemoteFile public String getName() { - return "dummy"; + return "dummy"; //$NON-NLS-1$ } public int compareTo(Object o) diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java index a3e6fd1151a..f43d12153b6 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java @@ -295,7 +295,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi for (int idx = 0; !would && (idx < strings.length); idx++) { // for "Drives" filter on Windows, only return match if the absolute path is a drive letter - if (strings[idx].equals("*")) { + if (strings[idx].equals("*")) { //$NON-NLS-1$ IPath path = new Path(remoteObjectAbsoluteName); if (path.segmentCount() == 0) { @@ -458,8 +458,8 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi boolean success = false; if (filterStrings == null) { - System.out.println("filterStrings==null!"); - System.out.println("connection == "+getHostAliasName()); + System.out.println("filterStrings==null!"); //$NON-NLS-1$ + System.out.println("connection == "+getHostAliasName()); //$NON-NLS-1$ return null; } @@ -613,7 +613,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi IRemoteFileSubSystemConfiguration rfssf = getParentRemoteFileSubSystemConfiguration(); boolean windows = !rfssf.isUnixStyle(); if (debugMode) - SystemBasePlugin.logInfo("INTERNALRESOLVEFILTERSTRING: INPUT FILTERSTRING: " + filterString); + SystemBasePlugin.logInfo("INTERNALRESOLVEFILTERSTRING: INPUT FILTERSTRING: " + filterString); //$NON-NLS-1$ if (filterString.startsWith("/") && windows) // request to list root files? //$NON-NLS-1$ { // convert to request to list drives on Windows int len = filterString.length(); @@ -622,12 +622,12 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi else filterString = filterString.substring(1); if (debugMode) - SystemBasePlugin.logInfo("...FINAL FILTERSTRING: " + filterString); + SystemBasePlugin.logInfo("...FINAL FILTERSTRING: " + filterString); //$NON-NLS-1$ } RemoteFileFilterString fs = new RemoteFileFilterString(rfssf, filterString); currFilterString = fs; if (debugMode) - SystemBasePlugin.logInfo("...LISTROOTS = " + fs.listRoots()); + SystemBasePlugin.logInfo("...LISTROOTS = " + fs.listRoots()); //$NON-NLS-1$ if (fs.listRoots()) return listRoots(new RemoteFileContext(this, null, fs), monitor); else @@ -639,7 +639,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi path = path + rfssf.getSeparatorChar(); String filter = fs.getFileOrTypes(); if (debugMode) - SystemBasePlugin.logInfo("...path='" + path + "', filter='" + filter + "', showDirs=" + showDirs + ", showFiles=" + showFiles); + SystemBasePlugin.logInfo("...path='" + path + "', filter='" + filter + "', showDirs=" + showDirs + ", showFiles=" + showFiles); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ IRemoteFile parent = null; try @@ -656,8 +656,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi } catch (SystemMessageException e) { - SystemBasePlugin.logError("RemoteFileSubSystemImpl.logError()", e); - parent = null; + SystemBasePlugin.logError("RemoteFileSubSystemImpl.logError()", e); //$NON-NLS-1$ } boolean parentExists = true; @@ -812,7 +811,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi addResolvedFilterStringObjects(vChildren, children, allStrings, idx); } } - if (!onlyOne) + if (!onlyOne && vChildren != null) { children = new Object[vChildren.size()]; for (int cdx = 0; cdx < children.length; cdx++) @@ -836,13 +835,8 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi { fs = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration(), filterString); } - if (fs != null) - { - return internalResolveOneFilterString(monitor, parent, fs, true); + return internalResolveOneFilterString(monitor, parent, fs, true); } - else - return new Object[] { - };} catch (SystemMessageException e) { @@ -940,7 +934,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi */ public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException { - fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; + fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; //$NON-NLS-1$ String parentPath = parent.getAbsolutePath(); IRemoteFileSubSystemConfiguration config = getParentRemoteFileSubSystemConfiguration(); RemoteFileFilterString filterString = new RemoteFileFilterString(config, parentPath, fileNameFilter); @@ -971,7 +965,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException { String path = parent.getAbsolutePath(); - fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; + fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; //$NON-NLS-1$ IRemoteFileSubSystemConfiguration config = getParentRemoteFileSubSystemConfiguration(); RemoteFileFilterString filterString = new RemoteFileFilterString(config, path, fileNameFilter); filterString.setShowFiles(true); @@ -1465,7 +1459,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi try { if (debug) - SystemBasePlugin.logInfo("Running local command: " + cmd); + SystemBasePlugin.logInfo("Running local command: " + cmd); //$NON-NLS-1$ process = Runtime.getRuntime().exec(cmd); } catch (IOException exc) @@ -1475,7 +1469,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi String msg = exc.getMessage(); if (msg == null) msg = exc.getClass().getName(); - SystemBasePlugin.logInfo("...Unexpected error running command '" + cmd + "'. Error msg: " + msg); + SystemBasePlugin.logInfo("...Unexpected error running command '" + cmd + "'. Error msg: " + msg); //$NON-NLS-1$ //$NON-NLS-2$ } throw exc; } @@ -1487,7 +1481,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi while ((line = berr.readLine()) != null) { if (debug) - SystemBasePlugin.logInfo("...System.err: " + line); + SystemBasePlugin.logInfo("...System.err: " + line); //$NON-NLS-1$ if ((lines != null) && (line.trim().length() > 0)) lines.addElement(line); } @@ -1502,7 +1496,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi while ((line = bin.readLine()) != null) { if (debug) - SystemBasePlugin.logInfo("...System out: " + line); + SystemBasePlugin.logInfo("...System out: " + line); //$NON-NLS-1$ if ((lines != null) && (line.trim().length() > 0)) lines.addElement(line); } @@ -1570,7 +1564,8 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi } // preserve persistent information from old file to new - oldFile.copyContentsTo(file); + if (oldFile != null) + oldFile.copyContentsTo(file); } _cachedRemoteFiles.put(path, file); @@ -1641,8 +1636,8 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi } } + _cachedRemoteFiles.remove(file.getAbsolutePath()); } - _cachedRemoteFiles.remove(file.getAbsolutePath()); } protected void removeCachedRemoteFile(String path) @@ -1720,8 +1715,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi addr = InetAddress.getLocalHost(); } catch (UnknownHostException e) { - SystemBasePlugin.logError("Error occured trying to get local host address", e); - addr = null; + SystemBasePlugin.logError("Error occured trying to get local host address", e); //$NON-NLS-1$ } // if the address is the loopback address diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java index 9912d8b7d5b..d32eb376ac7 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java @@ -204,7 +204,7 @@ public class ValidatorFileFilterString public String toString() { - return "ValidatorFileFilterString class"; + return "ValidatorFileFilterString class"; //$NON-NLS-1$ } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java index ce34613c5b8..1ef3a3b8253 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java @@ -159,6 +159,6 @@ public class ValidatorFileUniqueName public String toString() { - return "ValidatorFileFilterString class"; + return "ValidatorFileFilterString class"; //$NON-NLS-1$ } } \ No newline at end of file