Changeset 2233
- Timestamp:
- 12/08/17 09:36:26 (7 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
r2232 r2233 537 537 if (oldLogDir.exists() && oldLogDir.isDirectory() && (oldLogDir.listFiles() != null)) { 538 538 boolean allFilesRenamed = true; 539 for (File oldLogFile : oldLogDir.listFiles()) { 540 allFilesRenamed &= oldLogFile.renameTo(new File(newLogDir, oldLogFile.getName())); 539 File[] children = oldLogDir.listFiles(); 540 541 if (children != null) { 542 for (File oldLogFile : children) { 543 allFilesRenamed &= oldLogFile.renameTo(new File(newLogDir, oldLogFile.getName())); 544 } 541 545 } 542 546 -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcorrectHTMLLogDirs.java
r2232 r2233 133 133 Console.println("moved " + file + " to " + destination); 134 134 135 if ((file.getParentFile().list() == null) || 136 (file.getParentFile().list().length == 0)) 137 { 135 String[] children = file.getParentFile().list(); 136 if ((children == null) || (children.length == 0)) { 138 137 if (file.getParentFile().delete()) { 139 138 Console.println("removed directory " + file.getParentFile()); -
trunk/autoquest-plugin-http-test/src/test/java/de/ugoe/cs/autoquest/http/HTTPLogParserTest.java
r2217 r2233 263 263 if (file.exists()) { 264 264 if (file.isDirectory()) { 265 for (File child : file.listFiles()) { 266 deleteFiles(child); 265 File[] children = file.listFiles(); 266 if (children != null) { 267 for (File child : file.listFiles()) { 268 deleteFiles(child); 269 } 267 270 } 268 271 } -
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/commands/CMDparseDirHTTP.java
r1599 r2233 89 89 if (file.isDirectory()) { 90 90 String[] children = file.list(); 91 Arrays.sort(children);92 91 93 for (String child : children) { 94 File childFile = new File(file, child); 95 parseFile(childFile, parser); 92 if (children != null) { 93 Arrays.sort(children); 94 95 for (String child : children) { 96 File childFile = new File(file, child); 97 parseFile(childFile, parser); 98 } 96 99 } 97 100 } -
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SimpleSOAPEventType.java
r2215 r2233 267 267 System.out.print("fu!"); 268 268 } 269 return hashCode + calledMethod.hashCode() + serviceName.hashCode() + clientName.hashCode(); 269 return hashCode + 270 (calledMethod != null ? calledMethod.hashCode() : 0) + 271 (serviceName != null ? serviceName.hashCode() : 0) + 272 (clientName != null ? clientName.hashCode() : 0); 270 273 } 271 274 -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDcorrectDirOldJFC.java
r927 r2233 69 69 String absolutPath = folder.getAbsolutePath(); 70 70 String absolutDestPath = destfolder.getAbsolutePath(); 71 for (String filename : folder.list()) { 72 String source = absolutPath + "/" + filename; 73 String dest = absolutDestPath + "/" + filename; 74 Console.traceln(Level.INFO, "Processing file: " + source); 71 String[] children = folder.list(); 72 73 if (children != null) { 74 for (String filename : folder.list()) { 75 String source = absolutPath + "/" + filename; 76 String dest = absolutDestPath + "/" + filename; 77 Console.traceln(Level.INFO, "Processing file: " + source); 75 78 76 corrector.correctFile(source, dest); 79 corrector.correctFile(source, dest); 80 } 77 81 } 78 82 } -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDparseDirJFC.java
r1179 r2233 69 69 70 70 String absolutPath = folder.getAbsolutePath(); 71 for (String filename : folder.list()) { 72 String source = absolutPath + File.separator + filename; 73 Console.traceln(Level.INFO, "Processing file: " + source); 71 String[] children = folder.list(); 72 73 if (children != null) { 74 for (String filename : children) { 75 String source = absolutPath + File.separator + filename; 76 Console.traceln(Level.INFO, "Processing file: " + source); 74 77 75 try { 76 parser.parseFile(source); 77 } 78 catch (Exception e) { 79 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 80 } 78 try { 79 parser.parseFile(source); 80 } 81 catch (Exception e) { 82 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 83 } 84 } 81 85 } 82 86 -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDparseDirOldJFC.java
r1179 r2233 69 69 70 70 String absolutPath = folder.getAbsolutePath(); 71 for (String filename : folder.list()) { 72 String source = absolutPath + File.separator + filename; 73 Console.traceln(Level.INFO, "Processing file: " + source); 71 String[] children = folder.list(); 72 73 if (children != null) { 74 for (String filename : children) { 75 String source = absolutPath + File.separator + filename; 76 Console.traceln(Level.INFO, "Processing file: " + source); 74 77 75 try { 76 parser.parseFile(source); 77 } 78 catch (Exception e) { 79 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 78 try { 79 parser.parseFile(source); 80 } 81 catch (Exception e) { 82 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 83 } 80 84 } 81 85 } -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDparseJFCDirwithJacaretoIndices.java
r1946 r2233 83 83 84 84 String absolutPath = folder.getAbsolutePath(); 85 for (String filename : folder.list()) { 86 String source = absolutPath + File.separator + filename; 87 Console.traceln(Level.INFO, "Processing file: " + source); 88 89 try { 90 parser.parseFile(source); 91 } 92 catch (Exception e) { 93 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 85 String[] children = folder.list(); 86 87 if (children != null) { 88 for (String filename : children) { 89 String source = absolutPath + File.separator + filename; 90 Console.traceln(Level.INFO, "Processing file: " + source); 91 92 try { 93 parser.parseFile(source); 94 } 95 catch (Exception e) { 96 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 97 } 94 98 } 95 99 } -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDpreprocessDirJFC.java
r927 r2233 69 69 String absolutPathTarget = targetFolder.getAbsolutePath(); 70 70 71 for (String filename : sourceFolder.list()) { 72 String source = absolutPathSource + "/" + filename; 73 Console.traceln(Level.INFO, "Preprocessing file: " + source); 74 File file = new File(source); 75 InputStreamReader reader; 76 try { 77 FileInputStream fis = new FileInputStream(file); 78 reader = new InputStreamReader(fis, "UTF-16"); 79 } catch (FileNotFoundException e) { 80 Console.printerrln(e.getMessage()); 81 return; 82 } catch (UnsupportedEncodingException e) { 83 Console.printerrln(e.getMessage()); 84 return; 85 } 86 char[] buffer = new char[(int) file.length()]; 87 try { 88 reader.read(buffer); 89 reader.close(); 90 } catch (IOException e) { 91 Console.printerrln(e.getMessage()); 92 return; 93 } 71 String[] children = sourceFolder.list(); 72 73 if (children != null) { 74 for (String filename : children) { 75 String source = absolutPathSource + "/" + filename; 76 Console.traceln(Level.INFO, "Preprocessing file: " + source); 77 File file = new File(source); 78 InputStreamReader reader; 79 try { 80 FileInputStream fis = new FileInputStream(file); 81 reader = new InputStreamReader(fis, "UTF-16"); 82 } catch (FileNotFoundException e) { 83 Console.printerrln(e.getMessage()); 84 return; 85 } catch (UnsupportedEncodingException e) { 86 Console.printerrln(e.getMessage()); 87 return; 88 } 89 char[] buffer = new char[(int) file.length()]; 90 try { 91 reader.read(buffer); 92 reader.close(); 93 } catch (IOException e) { 94 Console.printerrln(e.getMessage()); 95 return; 96 } 94 97 95 String content = new String(buffer).trim();98 String content = new String(buffer).trim(); 96 99 97 int index = filename.lastIndexOf('.');98 String target = absolutPathTarget + "/"99 + filename.substring(0, index) + ".xml";100 int index = filename.lastIndexOf('.'); 101 String target = absolutPathTarget + "/" 102 + filename.substring(0, index) + ".xml"; 100 103 101 Console.traceln(Level.INFO, " Saving as: " + target);104 Console.traceln(Level.INFO, " Saving as: " + target); 102 105 103 OutputStreamWriter writer; 104 try { 105 FileOutputStream fos = new FileOutputStream(target); 106 writer = new OutputStreamWriter(fos, "UTF-8"); 107 } catch (IOException e) { 108 Console.printerrln(e.getMessage()); 109 return; 110 } 111 try { 112 writer.write(content); 113 if (!content.endsWith("</sessions>")) { 114 writer.write("</sessions>"); 115 } 116 writer.close(); 117 } catch (IOException e) { 118 Console.printerrln(e.getMessage()); 119 } 106 OutputStreamWriter writer; 107 try { 108 FileOutputStream fos = new FileOutputStream(target); 109 writer = new OutputStreamWriter(fos, "UTF-8"); 110 } catch (IOException e) { 111 Console.printerrln(e.getMessage()); 112 return; 113 } 114 try { 115 writer.write(content); 116 if (!content.endsWith("</sessions>")) { 117 writer.write("</sessions>"); 118 } 119 writer.close(); 120 } catch (IOException e) { 121 Console.printerrln(e.getMessage()); 122 } 123 } 120 124 } 121 125 } -
trunk/autoquest-plugin-mfc-test/src/test/java/de/ugoe/cs/autoquest/plugin/mfc/EventGenerationRuleTest.java
r1425 r2233 422 422 Console.printerrln("Invalid rules file."); 423 423 e.printStackTrace(); 424 return null; 424 425 } 425 426 catch (IOException e) { 426 427 Console.printerrln("Invalid rules file."); 427 428 e.printStackTrace(); 429 return null; 428 430 } 429 431 -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/LogPreprocessor.java
r927 r2233 144 144 } 145 145 String absolutPath = folder.getAbsolutePath(); 146 for (String filename : folder.list()) { 147 String source = absolutPath + "/" + filename; 148 Console.traceln(Level.INFO, "Processing file: " + source); 149 processFile(source, targetFile); 150 } 146 147 String[] filenames = folder.list(); 148 if (filenames != null) { 149 for (String filename : filenames) { 150 String source = absolutPath + "/" + filename; 151 Console.traceln(Level.INFO, "Processing file: " + source); 152 processFile(source, targetFile); 153 } 154 } 151 155 152 156 if (sessionOpen) { -
trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java
r2071 r2233 414 414 if (file.exists()) { 415 415 if (file.isDirectory()) { 416 for (File child : file.listFiles()) { 417 deleteFiles(child); 416 File[] children = file.listFiles(); 417 if (children != null) { 418 for (File child : children) { 419 deleteFiles(child); 420 } 418 421 } 419 422 } -
trunk/autoquest-ui-core/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDls.java
r1332 r2233 52 52 53 53 File[] filesList = dir.listFiles(); 54 for (File file : filesList) { 55 if (file.isFile()) { 56 Console.println(" " + file.getName()); 57 } else { 58 if (file.isDirectory()) { 59 Console.println("(d) " + file.getName()); 54 if (filesList != null) { 55 for (File file : filesList) { 56 if (file.isFile()) { 57 Console.println(" " + file.getName()); 58 } else { 59 if (file.isDirectory()) { 60 Console.println("(d) " + file.getName()); 61 } 60 62 } 61 63 } -
trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java
r1355 r2233 269 269 270 270 if (packageDir.isDirectory()) { 271 for (File classFile : packageDir.listFiles(filter)) { 272 String className = classFile.getName().substring 273 (0, classFile.getName().lastIndexOf('.')); 274 classNames.add(packageName + "." + className); 275 } 271 File[] classFiles = packageDir.listFiles(filter); 272 if (classFiles != null) { 273 for (File classFile : classFiles) { 274 String className = classFile.getName().substring 275 (0, classFile.getName().lastIndexOf('.')); 276 classNames.add(packageName + "." + className); 277 } 278 } 276 279 } 277 280 else {
Note: See TracChangeset
for help on using the changeset viewer.