1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 10:05:24 +02:00

[cleanup] fix NON-NLS-1 tags

This commit is contained in:
Martin Oberhuber 2006-11-09 10:54:59 +00:00
parent e9720fe010
commit 4f47e316c7
8 changed files with 105 additions and 103 deletions

View file

@ -187,8 +187,8 @@ public class FileTypeMatcher implements IMatcher
{ {
if (name.equals(names[idx])) if (name.equals(names[idx]))
matches = true; matches = true;
else if (names[idx].endsWith(".null") && else if (names[idx].endsWith(".null") && //$NON-NLS-1$
name.equals(names[idx].substring(0,names[idx].indexOf(".null"))) ) name.equals(names[idx].substring(0,names[idx].indexOf(".null"))) ) //$NON-NLS-1$
matches = true; matches = true;
} }
if (matches) if (matches)
@ -212,7 +212,7 @@ public class FileTypeMatcher implements IMatcher
else if (dotIdx == -1) else if (dotIdx == -1)
{ {
for (int idx=0; !matches && (idx<types.length); idx++) for (int idx=0; !matches && (idx<types.length); idx++)
if ("null".equals(types[idx])) if ("null".equals(types[idx])) //$NON-NLS-1$
matches = true; matches = true;
} }
} }
@ -226,16 +226,16 @@ public class FileTypeMatcher implements IMatcher
*/ */
public String toString() public String toString()
{ {
StringBuffer typesBuffer = new StringBuffer(""); StringBuffer typesBuffer = new StringBuffer(""); //$NON-NLS-1$
if (orgTypes != null) if (orgTypes != null)
{ {
for (int idx=0; idx<orgTypes.length; idx++) for (int idx=0; idx<orgTypes.length; idx++)
typesBuffer.append(orgTypes[idx]+","); typesBuffer.append(orgTypes[idx]+","); //$NON-NLS-1$
} }
if (orgNames != null) if (orgNames != null)
{ {
for (int idx=0; idx<orgNames.length; idx++) for (int idx=0; idx<orgNames.length; idx++)
typesBuffer.append(orgNames[idx]+","); typesBuffer.append(orgNames[idx]+","); //$NON-NLS-1$
} }
return typesBuffer.toString(); return typesBuffer.toString();
} }
@ -247,7 +247,7 @@ public class FileTypeMatcher implements IMatcher
*/ */
public static String[] parseTypes(String typeList) public static String[] parseTypes(String typeList)
{ {
StringTokenizer tokens = new StringTokenizer(typeList,","); StringTokenizer tokens = new StringTokenizer(typeList,","); //$NON-NLS-1$
Vector v = new Vector(); Vector v = new Vector();
while (tokens.hasMoreTokens()) while (tokens.hasMoreTokens())
{ {
@ -268,7 +268,7 @@ public class FileTypeMatcher implements IMatcher
*/ */
public static String[] parseNames(String typeList) public static String[] parseNames(String typeList)
{ {
StringTokenizer tokens = new StringTokenizer(typeList,","); StringTokenizer tokens = new StringTokenizer(typeList,","); //$NON-NLS-1$
Vector v = new Vector(); Vector v = new Vector();
while (tokens.hasMoreTokens()) while (tokens.hasMoreTokens())
{ {

View file

@ -24,40 +24,40 @@ public interface IClassifierConstants {
/** /**
* Default type. * Default type.
*/ */
public static final String TYPE_DEFAULT = "file"; public static final String TYPE_DEFAULT = "file"; //$NON-NLS-1$
/** /**
* Link type, "link". * Link type, "link".
*/ */
public static final String TYPE_LINK = "link"; public static final String TYPE_LINK = "link"; //$NON-NLS-1$
/** /**
* Java executable type, "executable(java:*)". * Java executable type, "executable(java:*)".
*/ */
public static final String TYPE_EXECUTABLE_JAVA = "executable(java:*)"; public static final String TYPE_EXECUTABLE_JAVA = "executable(java:*)"; //$NON-NLS-1$
/** /**
* Binary executable type, "executable(binary)". * Binary executable type, "executable(binary)".
*/ */
public static final String TYPE_EXECUTABLE_BINARY = "executable(binary)"; public static final String TYPE_EXECUTABLE_BINARY = "executable(binary)"; //$NON-NLS-1$
/** /**
* Script executable type, "executable(script)". * Script executable type, "executable(script)".
*/ */
public static final String TYPE_EXECUTABLE_SCRIPT = "executable(script)"; public static final String TYPE_EXECUTABLE_SCRIPT = "executable(script)"; //$NON-NLS-1$
/** /**
* Match java executable type, "*executable(java:*)*". * Match java executable type, "*executable(java:*)*".
*/ */
public static final String MATCH_EXECUTABLE_JAVA = "*executable(java:*)*"; public static final String MATCH_EXECUTABLE_JAVA = "*executable(java:*)*"; //$NON-NLS-1$
/** /**
* Match binary executable type, "*executable(java:*)*". * Match binary executable type, "*executable(java:*)*".
*/ */
public static final String MATCH_EXECUTABLE_BINARY = "*executable(binary)*"; public static final String MATCH_EXECUTABLE_BINARY = "*executable(binary)*"; //$NON-NLS-1$
/** /**
* Match script executable type, "*executable(java:*)*". * Match script executable type, "*executable(java:*)*".
*/ */
public static final String MATCH_EXECUTABLE_SCRIPT = "*executable(script)*"; public static final String MATCH_EXECUTABLE_SCRIPT = "*executable(script)*"; //$NON-NLS-1$
} }

View file

@ -30,27 +30,27 @@ public interface IClientServerConstants {
// // Messages // // Messages
// public static final String MSG_PREFIX = RESID_PREFIX+"msg."; // public static final String MSG_PREFIX = RESID_PREFIX+"msg.";
public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$
public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$
public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$
public static final String MSG_EXCEPTION_MOVING = "RSEG1065"; //MSG_EXCEPTION_PREFIX + "Moving"; public static final String MSG_EXCEPTION_MOVING = "RSEG1065"; //MSG_EXCEPTION_PREFIX + "Moving"; //$NON-NLS-1$
public static final String FILEMSG_DELETE_FILE_FAILED = "RSEF1300"; public static final String FILEMSG_DELETE_FILE_FAILED = "RSEF1300"; //$NON-NLS-1$
public static final String FILEMSG_RENAME_FILE_FAILED = "RSEF1301"; public static final String FILEMSG_RENAME_FILE_FAILED = "RSEF1301"; //$NON-NLS-1$
public static final String FILEMSG_CREATE_FILE_FAILED = "RSEF1302"; public static final String FILEMSG_CREATE_FILE_FAILED = "RSEF1302"; //$NON-NLS-1$
public static final String FILEMSG_CREATE_FILE_FAILED_EXIST = "RSEF1303"; public static final String FILEMSG_CREATE_FILE_FAILED_EXIST = "RSEF1303"; //$NON-NLS-1$
public static final String FILEMSG_CREATE_FOLDER_FAILED = "RSEF1304"; public static final String FILEMSG_CREATE_FOLDER_FAILED = "RSEF1304"; //$NON-NLS-1$
public static final String FILEMSG_CREATE_FOLDER_FAILED_EXIST = "RSEF1309"; public static final String FILEMSG_CREATE_FOLDER_FAILED_EXIST = "RSEF1309"; //$NON-NLS-1$
public static final String FILEMSG_CREATE_RESOURCE_NOTVISIBLE = "RSEF1310"; public static final String FILEMSG_CREATE_RESOURCE_NOTVISIBLE = "RSEF1310"; //$NON-NLS-1$
public static final String FILEMSG_RENAME_RESOURCE_NOTVISIBLE = "RSEF1311"; public static final String FILEMSG_RENAME_RESOURCE_NOTVISIBLE = "RSEF1311"; //$NON-NLS-1$
public static final String FILEMSG_ERROR_NOFILETYPES = "RSEF1010"; public static final String FILEMSG_ERROR_NOFILETYPES = "RSEF1010"; //$NON-NLS-1$
public static final String FILEMSG_COPY_FILE_FAILED = "RSEF1306"; public static final String FILEMSG_COPY_FILE_FAILED = "RSEF1306"; //$NON-NLS-1$
public static final String FILEMSG_MOVE_FILE_FAILED = "RSEF1307"; public static final String FILEMSG_MOVE_FILE_FAILED = "RSEF1307"; //$NON-NLS-1$
public static final String FILEMSG_MOVE_TARGET_EQUALS_SOURCE = "RSEF1308"; public static final String FILEMSG_MOVE_TARGET_EQUALS_SOURCE = "RSEF1308"; //$NON-NLS-1$
public static final String FILEMSG_ARCHIVE_CORRUPTED = "RSEG1122"; public static final String FILEMSG_ARCHIVE_CORRUPTED = "RSEG1122"; //$NON-NLS-1$
public static final String FILEMSG_NO_PERMISSION = "RSEF5001"; public static final String FILEMSG_NO_PERMISSION = "RSEF5001"; //$NON-NLS-1$
public static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006"; public static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006"; //$NON-NLS-1$
/** /**
* Flag to indicate "include files only, not folders" * Flag to indicate "include files only, not folders"
*/ */

View file

@ -58,7 +58,7 @@ public class NamePatternMatcher implements IMatcher
* Wildcard character: * * Wildcard character: *
*/ */
public static final char WILDCARD = '*'; public static final char WILDCARD = '*';
private static final String WILDCARD_DOUBLED = "**"; private static final String WILDCARD_DOUBLED = "**"; //$NON-NLS-1$
/** /**
* Example: Quoted name delimiter: " * Example: Quoted name delimiter: "
*/ */
@ -104,7 +104,8 @@ public class NamePatternMatcher implements IMatcher
// used in writeInfo debugging method // used in writeInfo debugging method
private static final int[] TYPES_IDX = {SCALAR,ALL,WILDCARD_END,WILDCARD_START,WILDCARD_MIDDLE, private static final int[] TYPES_IDX = {SCALAR,ALL,WILDCARD_END,WILDCARD_START,WILDCARD_MIDDLE,
WILDCARD_START_END,WILDCARD_MIDDLE_END,WILDCARD_START_MIDDLE,WILDCARD_MIDDLE_MIDDLE}; WILDCARD_START_END,WILDCARD_MIDDLE_END,WILDCARD_START_MIDDLE,WILDCARD_MIDDLE_MIDDLE};
private static final String[] TYPES = {"SCALAR","ALL","END","START","MIDDLE","START_END","MIDDLE_END","START_MIDDLE","MIDDLE_MIDDLE"}; private static final String[] TYPES = {"SCALAR","ALL","END","START","MIDDLE", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
"START_END","MIDDLE_END","START_MIDDLE","MIDDLE_MIDDLE"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
private String genericName, part1, part2, part3; private String genericName, part1, part2, part3;
private int part1len,part2len,part3len,part12len,part123len; private int part1len,part2len,part3len,part12len,part123len;
@ -174,7 +175,7 @@ public class NamePatternMatcher implements IMatcher
{ {
this.caseSensitive = caseSensitive; this.caseSensitive = caseSensitive;
if (genericName == null) if (genericName == null)
genericName = "*"; genericName = "*"; //$NON-NLS-1$
int len = 0; int len = 0;
// determine if given a null name // determine if given a null name
if ((genericName == null) || (genericName.length()==0)) if ((genericName == null) || (genericName.length()==0))
@ -194,8 +195,8 @@ public class NamePatternMatcher implements IMatcher
if (validName) if (validName)
{ {
// change *BLANK into 10 blanks // change *BLANK into 10 blanks
if (genericName.equals("*BLANK")) if (genericName.equals("*BLANK")) //$NON-NLS-1$
genericName = " "; genericName = " "; //$NON-NLS-1$
// away we go... // away we go...
int firstCharPos = quotedName ? 1 : 0; int firstCharPos = quotedName ? 1 : 0;
int lastCharPos = quotedName ? len-2 : len-1; int lastCharPos = quotedName ? len-2 : len-1;
@ -209,7 +210,7 @@ public class NamePatternMatcher implements IMatcher
} }
else if (wildcardOccurrences==1) else if (wildcardOccurrences==1)
{ {
if ((!quotedName && (len == 1)) || (quotedName && (len ==3)) || genericName.equals("*ALL") || genericName.equals("\"*ALL\"") || genericName.equals("*LIBL")) if ((!quotedName && (len == 1)) || (quotedName && (len ==3)) || genericName.equals("*ALL") || genericName.equals("\"*ALL\"") || genericName.equals("*LIBL")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
patternType = ALL; patternType = ALL;
else if (firstChar == WILDCARD) else if (firstChar == WILDCARD)
{ {
@ -406,10 +407,10 @@ public class NamePatternMatcher implements IMatcher
*/ */
public void writeInfo(PrintWriter stream) public void writeInfo(PrintWriter stream)
{ {
stream.println("GENERIC NAME: " + genericName); stream.println("GENERIC NAME: " + genericName); //$NON-NLS-1$
stream.println(" isValid: " + isValid()); stream.println(" isValid: " + isValid()); //$NON-NLS-1$
stream.println(" isGeneric: " + isGeneric()); stream.println(" isGeneric: " + isGeneric()); //$NON-NLS-1$
stream.println(" isQuoted: " + isQuoted()); stream.println(" isQuoted: " + isQuoted()); //$NON-NLS-1$
int type = getPatternType(); int type = getPatternType();
int typeidx = 0; int typeidx = 0;
boolean match=false; boolean match=false;
@ -419,13 +420,13 @@ public class NamePatternMatcher implements IMatcher
typeidx = idx; typeidx = idx;
match = true; match = true;
} }
stream.println(" patternType: " + TYPES[typeidx]); stream.println(" patternType: " + TYPES[typeidx]); //$NON-NLS-1$
if (part1 != null) if (part1 != null)
stream.println(" part1: " + part1); stream.println(" part1: " + part1); //$NON-NLS-1$
if (part2 != null) if (part2 != null)
stream.println(" part2: " + part2); stream.println(" part2: " + part2); //$NON-NLS-1$
if (part3 != null) if (part3 != null)
stream.println(" part3: " + part3); stream.println(" part3: " + part3); //$NON-NLS-1$
stream.println(); stream.println();
stream.flush(); stream.flush();
} }

View file

@ -33,7 +33,7 @@ public class PathUtility
if (path == null || path.length() < 2) { if (path == null || path.length() < 2) {
return path; return path;
} }
boolean endsWithSlash = (path.endsWith("\\") || path.endsWith("/")); boolean endsWithSlash = (path.endsWith("\\") || path.endsWith("/")); //$NON-NLS-1$ //$NON-NLS-2$
if (badSlashPatternWin.matcher(path).find()) { if (badSlashPatternWin.matcher(path).find()) {
//Replace /->\, then replace \\->\ //Replace /->\, then replace \\->\
StringBuffer buf = new StringBuffer(path.length()); StringBuffer buf = new StringBuffer(path.length());
@ -72,7 +72,7 @@ public class PathUtility
if (path == null || path.length() < 2) { if (path == null || path.length() < 2) {
return path; return path;
} }
boolean endsWithSlash = (path.endsWith("\\") || path.endsWith("/")); boolean endsWithSlash = (path.endsWith("\\") || path.endsWith("/")); //$NON-NLS-1$ //$NON-NLS-2$
if (badSlashPatternUnix.matcher(path).find()) { if (badSlashPatternUnix.matcher(path).find()) {
//Replace \->/, then replace //->/ //Replace \->/, then replace //->/
StringBuffer buf = new StringBuffer(path.length()); StringBuffer buf = new StringBuffer(path.length());

View file

@ -28,7 +28,7 @@ import java.io.InputStreamReader;
public class SystemEncodingUtil { public class SystemEncodingUtil {
private static SystemEncodingUtil instance; private static SystemEncodingUtil instance;
public static String ENCODING_UTF_8 = "UTF-8"; public static String ENCODING_UTF_8 = "UTF-8"; //$NON-NLS-1$
/** /**
* Constructor to create the utility class. * Constructor to create the utility class.
@ -56,7 +56,7 @@ public class SystemEncodingUtil {
* @return the evironment encoding. * @return the evironment encoding.
*/ */
public String getEnvironmentEncoding() { public String getEnvironmentEncoding() {
return System.getProperty("file.encoding"); return System.getProperty("file.encoding"); //$NON-NLS-1$
} }
/** /**
@ -66,7 +66,7 @@ public class SystemEncodingUtil {
*/ */
public boolean isXML(String filePath) { public boolean isXML(String filePath) {
int index = filePath.lastIndexOf("."); int index = filePath.lastIndexOf("."); //$NON-NLS-1$
// check if there is a "." // check if there is a "."
if (index == -1) { if (index == -1) {
@ -81,7 +81,7 @@ public class SystemEncodingUtil {
else { else {
String extension = filePath.substring(index+1); String extension = filePath.substring(index+1);
if (extension.equalsIgnoreCase("xml") || extension.equalsIgnoreCase("xmi")) { if (extension.equalsIgnoreCase("xml") || extension.equalsIgnoreCase("xmi")) { //$NON-NLS-1$ //$NON-NLS-2$
return true; return true;
} }
else { else {
@ -158,7 +158,7 @@ public class SystemEncodingUtil {
// in big-endian order and ASCII characters encoded as ASCII values (the encoding // in big-endian order and ASCII characters encoded as ASCII values (the encoding
// declaration must be read to determine which) // declaration must be read to determine which)
else if (temp[0] == 0x00 && temp[1] == 0x3C && temp[2] == 0x00 && temp[3] == 0x3F) { else if (temp[0] == 0x00 && temp[1] == 0x3C && temp[2] == 0x00 && temp[3] == 0x3F) {
encodingGuess = "UnicodeBigUnmarked"; encodingGuess = "UnicodeBigUnmarked"; //$NON-NLS-1$
} }
@ -166,14 +166,14 @@ public class SystemEncodingUtil {
// in little-endian order and ASCII characters encoded as ASCII values (the encoding // in little-endian order and ASCII characters encoded as ASCII values (the encoding
// declaration must be read to determine which) // declaration must be read to determine which)
else if (temp[0] == 0x3C && temp[1] == 0x00 && temp[2] == 0x3F && temp[3] == 0x00) { else if (temp[0] == 0x3C && temp[1] == 0x00 && temp[2] == 0x3F && temp[3] == 0x00) {
encodingGuess = "UnicodeLittleUnmarked"; encodingGuess = "UnicodeLittleUnmarked"; //$NON-NLS-1$
} }
// EBCDIC (in some flavor; the full encoding declaration must be read to tell which // EBCDIC (in some flavor; the full encoding declaration must be read to tell which
// code page is in use) // code page is in use)
else if (temp[0] == 0x4C && temp[1] == 0x6F && temp[2] == 0xA7 && temp[3] == 0x94) { else if (temp[0] == 0x4C && temp[1] == 0x6F && temp[2] == 0xA7 && temp[3] == 0x94) {
encodingGuess = "Cp037"; encodingGuess = "Cp037"; //$NON-NLS-1$
} }
@ -218,7 +218,7 @@ public class SystemEncodingUtil {
while (line != null) { while (line != null) {
int encodingIndex = line.indexOf("encoding"); int encodingIndex = line.indexOf("encoding"); //$NON-NLS-1$
// look for the encoding attribute // look for the encoding attribute
if (encodingIndex != -1) { if (encodingIndex != -1) {
@ -320,8 +320,8 @@ public class SystemEncodingUtil {
// check if our initial guess was UTF-8 or UTF-16 // check if our initial guess was UTF-8 or UTF-16
// those do not have to have an encoding declaration // those do not have to have an encoding declaration
if (encodingGuess.equals(SystemEncodingUtil.ENCODING_UTF_8) || encodingGuess.startsWith("UnicodeBig") || if (encodingGuess.equals(SystemEncodingUtil.ENCODING_UTF_8) || encodingGuess.startsWith("UnicodeBig") || //$NON-NLS-1$
encodingGuess.equals("UnicodeLittle")) { encodingGuess.equals("UnicodeLittle")) { //$NON-NLS-1$
encoding = encodingGuess; encoding = encodingGuess;
} }
} }
@ -385,11 +385,11 @@ public class SystemEncodingUtil {
} }
// UTF-16, big-endian order // UTF-16, big-endian order
else if (bomBytes[0] == 0xFE && bomBytes[1] == 0xFF && !(bomBytes[2] == 0x00 && bomBytes[3] == 0x00)) { else if (bomBytes[0] == 0xFE && bomBytes[1] == 0xFF && !(bomBytes[2] == 0x00 && bomBytes[3] == 0x00)) {
return "UnicodeBig"; return "UnicodeBig"; //$NON-NLS-1$
} }
// UTF-16, little-endian order // UTF-16, little-endian order
else if (bomBytes[0] == 0xFF && bomBytes[1] == 0xFE && !(bomBytes[2] == 0x00 && bomBytes[3] == 0x00)) { else if (bomBytes[0] == 0xFF && bomBytes[1] == 0xFE && !(bomBytes[2] == 0x00 && bomBytes[3] == 0x00)) {
return "UnicodeLittle"; return "UnicodeLittle"; //$NON-NLS-1$
} }
// not a BOM // not a BOM
else { else {

View file

@ -107,7 +107,7 @@ public class SystemFileClassifier {
protected String classifyNonVirtual(String absolutePath) { protected String classifyNonVirtual(String absolutePath) {
// default type // default type
String type = "file"; String type = "file"; //$NON-NLS-1$
File file = new File(absolutePath); File file = new File(absolutePath);
@ -117,41 +117,41 @@ public class SystemFileClassifier {
} }
// find out if we are on Windows // find out if we are on Windows
boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("win"); boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("win"); //$NON-NLS-1$ //$NON-NLS-2$
// for Windows, we only detect *.exe and *.dll files // for Windows, we only detect *.exe and *.dll files
if (isWindows) if (isWindows)
{ {
absolutePath = absolutePath.toLowerCase(); absolutePath = absolutePath.toLowerCase();
// classify *.class file // classify *.class file
if (absolutePath.endsWith(".class")) { if (absolutePath.endsWith(".class")) { //$NON-NLS-1$
type = classifyClassFile(absolutePath); type = classifyClassFile(absolutePath);
} }
// *.exe files are binary executables // *.exe files are binary executables
else if (absolutePath.endsWith(".exe")) { else if (absolutePath.endsWith(".exe")) { //$NON-NLS-1$
type = "executable(binary)"; type = "executable(binary)"; //$NON-NLS-1$
} }
// *.dll files are of type "module" // *.dll files are of type "module"
else if (absolutePath.endsWith(".dll")) { else if (absolutePath.endsWith(".dll")) { //$NON-NLS-1$
type = "module"; type = "module"; //$NON-NLS-1$
} }
return type; return type;
} }
// get specified encoding if any // get specified encoding if any
String encoding = System.getProperty("dstore.stdin.encoding"); String encoding = System.getProperty("dstore.stdin.encoding"); //$NON-NLS-1$
// otherwise, default to system encoding // otherwise, default to system encoding
if (encoding == null || encoding.equals("")) { if (encoding == null || encoding.equals("")) { //$NON-NLS-1$
encoding = System.getProperty("file.encoding"); encoding = System.getProperty("file.encoding"); //$NON-NLS-1$
} }
// create command "sh -c file <absolutePath>" // create command "sh -c file <absolutePath>"
String args[] = new String[3]; String args[] = new String[3];
args[0] = "sh"; args[0] = "sh"; //$NON-NLS-1$
args[1] = "-c"; args[1] = "-c"; //$NON-NLS-1$
args[2] = "file \"" + absolutePath + "\""; args[2] = "file \"" + absolutePath + "\""; //$NON-NLS-1$ //$NON-NLS-2$
BufferedReader poutReader = null; BufferedReader poutReader = null;
@ -173,9 +173,9 @@ public class SystemFileClassifier {
poutReader.close(); poutReader.close();
// if it a symbolic link, then get the canonical path and classify it as well // if it a symbolic link, then get the canonical path and classify it as well
if (type.equals("link")) { if (type.equals("link")) { //$NON-NLS-1$
String canonicalPath = file.getCanonicalPath(); String canonicalPath = file.getCanonicalPath();
return type + "(" + classifyNonVirtual(canonicalPath) + ")" + ":" + canonicalPath; return type + "(" + classifyNonVirtual(canonicalPath) + ")" + ":" + canonicalPath; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} }
else { else {
return type; return type;
@ -203,10 +203,10 @@ public class SystemFileClassifier {
protected String getClassification(String absolutePath, String line) { protected String getClassification(String absolutePath, String line) {
// default type // default type
String type = "file"; String type = "file"; //$NON-NLS-1$
String name = line; String name = line;
String fulltype = ""; String fulltype = ""; //$NON-NLS-1$
// Look for colon. Name appears before colon. Full type appears after the colon // Look for colon. Name appears before colon. Full type appears after the colon
int colon = line.indexOf(':'); int colon = line.indexOf(':');
@ -217,27 +217,27 @@ public class SystemFileClassifier {
// if it is a *.class file, then we look for main method and qulaified class name // if it is a *.class file, then we look for main method and qulaified class name
// as part of the classification // as part of the classification
if (name.endsWith(".class")) { if (name.endsWith(".class")) { //$NON-NLS-1$
type = classifyClassFile(absolutePath); type = classifyClassFile(absolutePath);
} }
// check if it is a shared library // check if it is a shared library
boolean matchesLib = (fulltype.indexOf("shared object") > -1) || boolean matchesLib = (fulltype.indexOf("shared object") > -1) || //$NON-NLS-1$
(fulltype.indexOf("object module") > -1) || (fulltype.indexOf("object module") > -1) || //$NON-NLS-1$
(fulltype.indexOf("archive") > -1); (fulltype.indexOf("archive") > -1); //$NON-NLS-1$
// check if it is an executable // check if it is an executable
boolean matchesExe = (fulltype.indexOf("executable") > -1); boolean matchesExe = (fulltype.indexOf("executable") > -1); //$NON-NLS-1$
// check if it is a script // check if it is a script
boolean matchesScript = (fulltype.indexOf("script") > -1); boolean matchesScript = (fulltype.indexOf("script") > -1); //$NON-NLS-1$
// shared library // shared library
if (matchesLib) { if (matchesLib) {
// all *.a, *.so and *.so.* files are of type "module" // all *.a, *.so and *.so.* files are of type "module"
if (name.endsWith(".a") || name.endsWith(".so") || (name.indexOf(".so.") > 0)) { if (name.endsWith(".a") || name.endsWith(".so") || (name.indexOf(".so.") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
type = "module"; type = "module"; //$NON-NLS-1$
} }
} }
@ -246,27 +246,27 @@ public class SystemFileClassifier {
// an executable script file // an executable script file
if (matchesExe) { if (matchesExe) {
type = "executable(script)"; type = "executable(script)"; //$NON-NLS-1$
} }
// non-executable script file // non-executable script file
else { else {
type = "script"; type = "script"; //$NON-NLS-1$
} }
} }
// binary executable // binary executable
else if (matchesExe) { else if (matchesExe) {
type = "executable(binary)"; type = "executable(binary)"; //$NON-NLS-1$
} }
// on iSeries we look for "OS/400 object" as a type // on iSeries we look for "OS/400 object" as a type
else if (fulltype.indexOf("OS/400 object") > -1) { else if (fulltype.indexOf("OS/400 object") > -1) { //$NON-NLS-1$
type = "OS/400 object"; type = "OS/400 object"; //$NON-NLS-1$
} }
// finally, if the full type contains the symbolic link string, then type is simply "link" // finally, if the full type contains the symbolic link string, then type is simply "link"
else if (fulltype.startsWith("symbolic link to")) { else if (fulltype.startsWith("symbolic link to")) { //$NON-NLS-1$
type = "link"; type = "link"; //$NON-NLS-1$
} }
return type; return type;
@ -280,7 +280,7 @@ public class SystemFileClassifier {
protected String classifyClassFile(String absolutePath) { protected String classifyClassFile(String absolutePath) {
// default type // default type
String type = "file"; String type = "file"; //$NON-NLS-1$
// input stream to file // input stream to file
FileInputStream stream = null; FileInputStream stream = null;
@ -305,19 +305,20 @@ public class SystemFileClassifier {
// we assume not executable // we assume not executable
isExecutable = false; isExecutable = false;
return type;
} }
// if it is executable, then also get qualified class name // if it is executable, then also get qualified class name
if (isExecutable) { if (isExecutable) {
type = "executable(java"; type = "executable(java"; //$NON-NLS-1$
String qualifiedClassName = parser.getQualifiedClassName(); String qualifiedClassName = parser.getQualifiedClassName();
if (qualifiedClassName != null) { if (qualifiedClassName != null) {
type = type + ":" + qualifiedClassName; type = type + ":" + qualifiedClassName; //$NON-NLS-1$
} }
type = type + ")"; type = type + ")"; //$NON-NLS-1$
} }
return type; return type;

View file

@ -50,7 +50,7 @@ public class SystemSearchString {
String fileNamesString, boolean isFileNamesRegex, boolean includeArchives, String fileNamesString, boolean isFileNamesRegex, boolean includeArchives,
boolean includeSubfolders) { boolean includeSubfolders) {
this(textString, isCaseSensitive, isTextStringRegex, fileNamesString, isFileNamesRegex, includeArchives, this(textString, isCaseSensitive, isTextStringRegex, fileNamesString, isFileNamesRegex, includeArchives,
includeSubfolders, ""); includeSubfolders, ""); //$NON-NLS-1$
} }
/** /**
@ -146,8 +146,8 @@ public class SystemSearchString {
* @see java.lang.Object#toString() * @see java.lang.Object#toString()
*/ */
public String toString() { public String toString() {
return textString + " - " + isCaseSensitive + " - " + isTextStringRegex + " - " + return textString + " - " + isCaseSensitive + " - " + isTextStringRegex + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
fileNamesString + " - " + isFileNamesRegex + " - " + includeArchives + " - " + fileNamesString + " - " + isFileNamesRegex + " - " + includeArchives + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
includeSubfolders + " - " + classificationString; includeSubfolders + " - " + classificationString; //$NON-NLS-1$
} }
} }