mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 23:55:26 +02:00
[cleanup] fix NON-NLS-1 tags
This commit is contained in:
parent
e9720fe010
commit
4f47e316c7
8 changed files with 105 additions and 103 deletions
|
@ -187,8 +187,8 @@ public class FileTypeMatcher implements IMatcher
|
|||
{
|
||||
if (name.equals(names[idx]))
|
||||
matches = true;
|
||||
else if (names[idx].endsWith(".null") &&
|
||||
name.equals(names[idx].substring(0,names[idx].indexOf(".null"))) )
|
||||
else if (names[idx].endsWith(".null") && //$NON-NLS-1$
|
||||
name.equals(names[idx].substring(0,names[idx].indexOf(".null"))) ) //$NON-NLS-1$
|
||||
matches = true;
|
||||
}
|
||||
if (matches)
|
||||
|
@ -212,7 +212,7 @@ public class FileTypeMatcher implements IMatcher
|
|||
else if (dotIdx == -1)
|
||||
{
|
||||
for (int idx=0; !matches && (idx<types.length); idx++)
|
||||
if ("null".equals(types[idx]))
|
||||
if ("null".equals(types[idx])) //$NON-NLS-1$
|
||||
matches = true;
|
||||
}
|
||||
}
|
||||
|
@ -226,16 +226,16 @@ public class FileTypeMatcher implements IMatcher
|
|||
*/
|
||||
public String toString()
|
||||
{
|
||||
StringBuffer typesBuffer = new StringBuffer("");
|
||||
StringBuffer typesBuffer = new StringBuffer(""); //$NON-NLS-1$
|
||||
if (orgTypes != null)
|
||||
{
|
||||
for (int idx=0; idx<orgTypes.length; idx++)
|
||||
typesBuffer.append(orgTypes[idx]+",");
|
||||
typesBuffer.append(orgTypes[idx]+","); //$NON-NLS-1$
|
||||
}
|
||||
if (orgNames != null)
|
||||
{
|
||||
for (int idx=0; idx<orgNames.length; idx++)
|
||||
typesBuffer.append(orgNames[idx]+",");
|
||||
typesBuffer.append(orgNames[idx]+","); //$NON-NLS-1$
|
||||
}
|
||||
return typesBuffer.toString();
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ public class FileTypeMatcher implements IMatcher
|
|||
*/
|
||||
public static String[] parseTypes(String typeList)
|
||||
{
|
||||
StringTokenizer tokens = new StringTokenizer(typeList,",");
|
||||
StringTokenizer tokens = new StringTokenizer(typeList,","); //$NON-NLS-1$
|
||||
Vector v = new Vector();
|
||||
while (tokens.hasMoreTokens())
|
||||
{
|
||||
|
@ -268,7 +268,7 @@ public class FileTypeMatcher implements IMatcher
|
|||
*/
|
||||
public static String[] parseNames(String typeList)
|
||||
{
|
||||
StringTokenizer tokens = new StringTokenizer(typeList,",");
|
||||
StringTokenizer tokens = new StringTokenizer(typeList,","); //$NON-NLS-1$
|
||||
Vector v = new Vector();
|
||||
while (tokens.hasMoreTokens())
|
||||
{
|
||||
|
|
|
@ -24,40 +24,40 @@ public interface IClassifierConstants {
|
|||
/**
|
||||
* Default type.
|
||||
*/
|
||||
public static final String TYPE_DEFAULT = "file";
|
||||
public static final String TYPE_DEFAULT = "file"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* 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:*)".
|
||||
*/
|
||||
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)".
|
||||
*/
|
||||
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)".
|
||||
*/
|
||||
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:*)*".
|
||||
*/
|
||||
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:*)*".
|
||||
*/
|
||||
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:*)*".
|
||||
*/
|
||||
public static final String MATCH_EXECUTABLE_SCRIPT = "*executable(script)*";
|
||||
public static final String MATCH_EXECUTABLE_SCRIPT = "*executable(script)*"; //$NON-NLS-1$
|
||||
}
|
|
@ -30,27 +30,27 @@ public interface IClientServerConstants {
|
|||
// // Messages
|
||||
// public static final String MSG_PREFIX = RESID_PREFIX+"msg.";
|
||||
|
||||
public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003";
|
||||
public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004";
|
||||
public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming";
|
||||
public static final String MSG_EXCEPTION_MOVING = "RSEG1065"; //MSG_EXCEPTION_PREFIX + "Moving";
|
||||
public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$
|
||||
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"; //$NON-NLS-1$
|
||||
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_RENAME_FILE_FAILED = "RSEF1301";
|
||||
public static final String FILEMSG_CREATE_FILE_FAILED = "RSEF1302";
|
||||
public static final String FILEMSG_CREATE_FILE_FAILED_EXIST = "RSEF1303";
|
||||
public static final String FILEMSG_CREATE_FOLDER_FAILED = "RSEF1304";
|
||||
public static final String FILEMSG_CREATE_FOLDER_FAILED_EXIST = "RSEF1309";
|
||||
public static final String FILEMSG_CREATE_RESOURCE_NOTVISIBLE = "RSEF1310";
|
||||
public static final String FILEMSG_RENAME_RESOURCE_NOTVISIBLE = "RSEF1311";
|
||||
public static final String FILEMSG_ERROR_NOFILETYPES = "RSEF1010";
|
||||
public static final String FILEMSG_COPY_FILE_FAILED = "RSEF1306";
|
||||
public static final String FILEMSG_MOVE_FILE_FAILED = "RSEF1307";
|
||||
public static final String FILEMSG_MOVE_TARGET_EQUALS_SOURCE = "RSEF1308";
|
||||
public static final String FILEMSG_ARCHIVE_CORRUPTED = "RSEG1122";
|
||||
public static final String FILEMSG_NO_PERMISSION = "RSEF5001";
|
||||
public static final String FILEMSG_DELETE_FILE_FAILED = "RSEF1300"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_RENAME_FILE_FAILED = "RSEF1301"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_CREATE_FILE_FAILED = "RSEF1302"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_CREATE_FILE_FAILED_EXIST = "RSEF1303"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_CREATE_FOLDER_FAILED = "RSEF1304"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_CREATE_FOLDER_FAILED_EXIST = "RSEF1309"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_CREATE_RESOURCE_NOTVISIBLE = "RSEF1310"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_RENAME_RESOURCE_NOTVISIBLE = "RSEF1311"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_ERROR_NOFILETYPES = "RSEF1010"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_COPY_FILE_FAILED = "RSEF1306"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_MOVE_FILE_FAILED = "RSEF1307"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_MOVE_TARGET_EQUALS_SOURCE = "RSEF1308"; //$NON-NLS-1$
|
||||
public static final String FILEMSG_ARCHIVE_CORRUPTED = "RSEG1122"; //$NON-NLS-1$
|
||||
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"
|
||||
*/
|
||||
|
|
|
@ -58,7 +58,7 @@ public class NamePatternMatcher implements IMatcher
|
|||
* Wildcard character: *
|
||||
*/
|
||||
public static final char WILDCARD = '*';
|
||||
private static final String WILDCARD_DOUBLED = "**";
|
||||
private static final String WILDCARD_DOUBLED = "**"; //$NON-NLS-1$
|
||||
/**
|
||||
* Example: Quoted name delimiter: "
|
||||
*/
|
||||
|
@ -104,7 +104,8 @@ public class NamePatternMatcher implements IMatcher
|
|||
// used in writeInfo debugging method
|
||||
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};
|
||||
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 int part1len,part2len,part3len,part12len,part123len;
|
||||
|
@ -174,7 +175,7 @@ public class NamePatternMatcher implements IMatcher
|
|||
{
|
||||
this.caseSensitive = caseSensitive;
|
||||
if (genericName == null)
|
||||
genericName = "*";
|
||||
genericName = "*"; //$NON-NLS-1$
|
||||
int len = 0;
|
||||
// determine if given a null name
|
||||
if ((genericName == null) || (genericName.length()==0))
|
||||
|
@ -194,8 +195,8 @@ public class NamePatternMatcher implements IMatcher
|
|||
if (validName)
|
||||
{
|
||||
// change *BLANK into 10 blanks
|
||||
if (genericName.equals("*BLANK"))
|
||||
genericName = " ";
|
||||
if (genericName.equals("*BLANK")) //$NON-NLS-1$
|
||||
genericName = " "; //$NON-NLS-1$
|
||||
// away we go...
|
||||
int firstCharPos = quotedName ? 1 : 0;
|
||||
int lastCharPos = quotedName ? len-2 : len-1;
|
||||
|
@ -209,7 +210,7 @@ public class NamePatternMatcher implements IMatcher
|
|||
}
|
||||
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;
|
||||
else if (firstChar == WILDCARD)
|
||||
{
|
||||
|
@ -406,10 +407,10 @@ public class NamePatternMatcher implements IMatcher
|
|||
*/
|
||||
public void writeInfo(PrintWriter stream)
|
||||
{
|
||||
stream.println("GENERIC NAME: " + genericName);
|
||||
stream.println(" isValid: " + isValid());
|
||||
stream.println(" isGeneric: " + isGeneric());
|
||||
stream.println(" isQuoted: " + isQuoted());
|
||||
stream.println("GENERIC NAME: " + genericName); //$NON-NLS-1$
|
||||
stream.println(" isValid: " + isValid()); //$NON-NLS-1$
|
||||
stream.println(" isGeneric: " + isGeneric()); //$NON-NLS-1$
|
||||
stream.println(" isQuoted: " + isQuoted()); //$NON-NLS-1$
|
||||
int type = getPatternType();
|
||||
int typeidx = 0;
|
||||
boolean match=false;
|
||||
|
@ -419,13 +420,13 @@ public class NamePatternMatcher implements IMatcher
|
|||
typeidx = idx;
|
||||
match = true;
|
||||
}
|
||||
stream.println(" patternType: " + TYPES[typeidx]);
|
||||
stream.println(" patternType: " + TYPES[typeidx]); //$NON-NLS-1$
|
||||
if (part1 != null)
|
||||
stream.println(" part1: " + part1);
|
||||
stream.println(" part1: " + part1); //$NON-NLS-1$
|
||||
if (part2 != null)
|
||||
stream.println(" part2: " + part2);
|
||||
stream.println(" part2: " + part2); //$NON-NLS-1$
|
||||
if (part3 != null)
|
||||
stream.println(" part3: " + part3);
|
||||
stream.println(" part3: " + part3); //$NON-NLS-1$
|
||||
stream.println();
|
||||
stream.flush();
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class PathUtility
|
|||
if (path == null || path.length() < 2) {
|
||||
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()) {
|
||||
//Replace /->\, then replace \\->\
|
||||
StringBuffer buf = new StringBuffer(path.length());
|
||||
|
@ -72,7 +72,7 @@ public class PathUtility
|
|||
if (path == null || path.length() < 2) {
|
||||
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()) {
|
||||
//Replace \->/, then replace //->/
|
||||
StringBuffer buf = new StringBuffer(path.length());
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.io.InputStreamReader;
|
|||
public class SystemEncodingUtil {
|
||||
|
||||
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.
|
||||
|
@ -56,7 +56,7 @@ public class SystemEncodingUtil {
|
|||
* @return the evironment encoding.
|
||||
*/
|
||||
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) {
|
||||
|
||||
int index = filePath.lastIndexOf(".");
|
||||
int index = filePath.lastIndexOf("."); //$NON-NLS-1$
|
||||
|
||||
// check if there is a "."
|
||||
if (index == -1) {
|
||||
|
@ -81,7 +81,7 @@ public class SystemEncodingUtil {
|
|||
else {
|
||||
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;
|
||||
}
|
||||
else {
|
||||
|
@ -158,7 +158,7 @@ public class SystemEncodingUtil {
|
|||
// in big-endian order and ASCII characters encoded as ASCII values (the encoding
|
||||
// declaration must be read to determine which)
|
||||
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
|
||||
// declaration must be read to determine which)
|
||||
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
|
||||
// code page is in use)
|
||||
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) {
|
||||
|
||||
int encodingIndex = line.indexOf("encoding");
|
||||
int encodingIndex = line.indexOf("encoding"); //$NON-NLS-1$
|
||||
|
||||
// look for the encoding attribute
|
||||
if (encodingIndex != -1) {
|
||||
|
@ -320,8 +320,8 @@ public class SystemEncodingUtil {
|
|||
|
||||
// check if our initial guess was UTF-8 or UTF-16
|
||||
// those do not have to have an encoding declaration
|
||||
if (encodingGuess.equals(SystemEncodingUtil.ENCODING_UTF_8) || encodingGuess.startsWith("UnicodeBig") ||
|
||||
encodingGuess.equals("UnicodeLittle")) {
|
||||
if (encodingGuess.equals(SystemEncodingUtil.ENCODING_UTF_8) || encodingGuess.startsWith("UnicodeBig") || //$NON-NLS-1$
|
||||
encodingGuess.equals("UnicodeLittle")) { //$NON-NLS-1$
|
||||
encoding = encodingGuess;
|
||||
}
|
||||
}
|
||||
|
@ -385,11 +385,11 @@ public class SystemEncodingUtil {
|
|||
}
|
||||
// UTF-16, big-endian order
|
||||
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
|
||||
else if (bomBytes[0] == 0xFF && bomBytes[1] == 0xFE && !(bomBytes[2] == 0x00 && bomBytes[3] == 0x00)) {
|
||||
return "UnicodeLittle";
|
||||
return "UnicodeLittle"; //$NON-NLS-1$
|
||||
}
|
||||
// not a BOM
|
||||
else {
|
||||
|
|
|
@ -107,7 +107,7 @@ public class SystemFileClassifier {
|
|||
protected String classifyNonVirtual(String absolutePath) {
|
||||
|
||||
// default type
|
||||
String type = "file";
|
||||
String type = "file"; //$NON-NLS-1$
|
||||
|
||||
File file = new File(absolutePath);
|
||||
|
||||
|
@ -117,41 +117,41 @@ public class SystemFileClassifier {
|
|||
}
|
||||
|
||||
// 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
|
||||
if (isWindows)
|
||||
{
|
||||
absolutePath = absolutePath.toLowerCase();
|
||||
// classify *.class file
|
||||
if (absolutePath.endsWith(".class")) {
|
||||
if (absolutePath.endsWith(".class")) { //$NON-NLS-1$
|
||||
type = classifyClassFile(absolutePath);
|
||||
}
|
||||
// *.exe files are binary executables
|
||||
else if (absolutePath.endsWith(".exe")) {
|
||||
type = "executable(binary)";
|
||||
else if (absolutePath.endsWith(".exe")) { //$NON-NLS-1$
|
||||
type = "executable(binary)"; //$NON-NLS-1$
|
||||
}
|
||||
// *.dll files are of type "module"
|
||||
else if (absolutePath.endsWith(".dll")) {
|
||||
type = "module";
|
||||
else if (absolutePath.endsWith(".dll")) { //$NON-NLS-1$
|
||||
type = "module"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
// 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
|
||||
if (encoding == null || encoding.equals("")) {
|
||||
encoding = System.getProperty("file.encoding");
|
||||
if (encoding == null || encoding.equals("")) { //$NON-NLS-1$
|
||||
encoding = System.getProperty("file.encoding"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// create command "sh -c file <absolutePath>"
|
||||
String args[] = new String[3];
|
||||
args[0] = "sh";
|
||||
args[1] = "-c";
|
||||
args[2] = "file \"" + absolutePath + "\"";
|
||||
args[0] = "sh"; //$NON-NLS-1$
|
||||
args[1] = "-c"; //$NON-NLS-1$
|
||||
args[2] = "file \"" + absolutePath + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
BufferedReader poutReader = null;
|
||||
|
||||
|
@ -173,9 +173,9 @@ public class SystemFileClassifier {
|
|||
poutReader.close();
|
||||
|
||||
// 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();
|
||||
return type + "(" + classifyNonVirtual(canonicalPath) + ")" + ":" + canonicalPath;
|
||||
return type + "(" + classifyNonVirtual(canonicalPath) + ")" + ":" + canonicalPath; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
else {
|
||||
return type;
|
||||
|
@ -203,10 +203,10 @@ public class SystemFileClassifier {
|
|||
protected String getClassification(String absolutePath, String line) {
|
||||
|
||||
// default type
|
||||
String type = "file";
|
||||
String type = "file"; //$NON-NLS-1$
|
||||
|
||||
String name = line;
|
||||
String fulltype = "";
|
||||
String fulltype = ""; //$NON-NLS-1$
|
||||
|
||||
// Look for colon. Name appears before colon. Full type appears after the colon
|
||||
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
|
||||
// as part of the classification
|
||||
if (name.endsWith(".class")) {
|
||||
if (name.endsWith(".class")) { //$NON-NLS-1$
|
||||
type = classifyClassFile(absolutePath);
|
||||
}
|
||||
|
||||
// check if it is a shared library
|
||||
boolean matchesLib = (fulltype.indexOf("shared object") > -1) ||
|
||||
(fulltype.indexOf("object module") > -1) ||
|
||||
(fulltype.indexOf("archive") > -1);
|
||||
boolean matchesLib = (fulltype.indexOf("shared object") > -1) || //$NON-NLS-1$
|
||||
(fulltype.indexOf("object module") > -1) || //$NON-NLS-1$
|
||||
(fulltype.indexOf("archive") > -1); //$NON-NLS-1$
|
||||
|
||||
// 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
|
||||
boolean matchesScript = (fulltype.indexOf("script") > -1);
|
||||
boolean matchesScript = (fulltype.indexOf("script") > -1); //$NON-NLS-1$
|
||||
|
||||
// shared library
|
||||
if (matchesLib) {
|
||||
|
||||
// all *.a, *.so and *.so.* files are of type "module"
|
||||
if (name.endsWith(".a") || name.endsWith(".so") || (name.indexOf(".so.") > 0)) {
|
||||
type = "module";
|
||||
if (name.endsWith(".a") || name.endsWith(".so") || (name.indexOf(".so.") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
type = "module"; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,27 +246,27 @@ public class SystemFileClassifier {
|
|||
|
||||
// an executable script file
|
||||
if (matchesExe) {
|
||||
type = "executable(script)";
|
||||
type = "executable(script)"; //$NON-NLS-1$
|
||||
}
|
||||
// non-executable script file
|
||||
else {
|
||||
type = "script";
|
||||
type = "script"; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
// binary executable
|
||||
else if (matchesExe) {
|
||||
type = "executable(binary)";
|
||||
type = "executable(binary)"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// on iSeries we look for "OS/400 object" as a type
|
||||
else if (fulltype.indexOf("OS/400 object") > -1) {
|
||||
type = "OS/400 object";
|
||||
else if (fulltype.indexOf("OS/400 object") > -1) { //$NON-NLS-1$
|
||||
type = "OS/400 object"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// finally, if the full type contains the symbolic link string, then type is simply "link"
|
||||
else if (fulltype.startsWith("symbolic link to")) {
|
||||
type = "link";
|
||||
else if (fulltype.startsWith("symbolic link to")) { //$NON-NLS-1$
|
||||
type = "link"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return type;
|
||||
|
@ -280,7 +280,7 @@ public class SystemFileClassifier {
|
|||
protected String classifyClassFile(String absolutePath) {
|
||||
|
||||
// default type
|
||||
String type = "file";
|
||||
String type = "file"; //$NON-NLS-1$
|
||||
|
||||
// input stream to file
|
||||
FileInputStream stream = null;
|
||||
|
@ -305,19 +305,20 @@ public class SystemFileClassifier {
|
|||
|
||||
// we assume not executable
|
||||
isExecutable = false;
|
||||
return type;
|
||||
}
|
||||
|
||||
// if it is executable, then also get qualified class name
|
||||
if (isExecutable) {
|
||||
type = "executable(java";
|
||||
type = "executable(java"; //$NON-NLS-1$
|
||||
|
||||
String qualifiedClassName = parser.getQualifiedClassName();
|
||||
|
||||
if (qualifiedClassName != null) {
|
||||
type = type + ":" + qualifiedClassName;
|
||||
type = type + ":" + qualifiedClassName; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
type = type + ")";
|
||||
type = type + ")"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return type;
|
||||
|
|
|
@ -50,7 +50,7 @@ public class SystemSearchString {
|
|||
String fileNamesString, boolean isFileNamesRegex, boolean includeArchives,
|
||||
boolean includeSubfolders) {
|
||||
this(textString, isCaseSensitive, isTextStringRegex, fileNamesString, isFileNamesRegex, includeArchives,
|
||||
includeSubfolders, "");
|
||||
includeSubfolders, ""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,8 +146,8 @@ public class SystemSearchString {
|
|||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
return textString + " - " + isCaseSensitive + " - " + isTextStringRegex + " - " +
|
||||
fileNamesString + " - " + isFileNamesRegex + " - " + includeArchives + " - " +
|
||||
includeSubfolders + " - " + classificationString;
|
||||
return textString + " - " + isCaseSensitive + " - " + isTextStringRegex + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
fileNamesString + " - " + isFileNamesRegex + " - " + includeArchives + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
includeSubfolders + " - " + classificationString; //$NON-NLS-1$
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue