Changeset 18193 for greenstone3
- Timestamp:
- 2008-12-12T14:45:53+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/src/java/org/greenstone/admin/gui/Mat.java
r18172 r18193 443 443 String action = actionElement.getAttribute("action"); 444 444 445 if(!action.equalsIgnoreCase(command) && !action.equalsIgnoreCase("uninstall")){445 if(!action.equalsIgnoreCase(command)){ 446 446 447 447 String status = actionElement.getAttribute("status"); 448 if(status=="true"){ 449 actionElement.setAttribute("status", "false"); 450 } 451 else{ 452 actionElement.setAttribute("status", "true"); 453 } 448 actionElement.setAttribute("status", "true"); 454 449 } 455 450 } 456 451 } 457 452 } 453 454 else if(command.equalsIgnoreCase("uninstall")){ 455 Node x = actionList.item(0); 456 NodeList stepList = x.getChildNodes(); 457 458 for(int i = 0; i<stepList.getLength(); i++){ 459 Node n = stepList.item(i); 460 if(n instanceof Element){ 461 Element actionElement = (Element) n; 462 463 String action = actionElement.getAttribute("action"); 464 465 if(!action.equalsIgnoreCase("download")){ 466 467 String status = actionElement.getAttribute("status"); 468 actionElement.setAttribute("status", "false"); 469 } 470 } 471 } 472 } 458 473 459 474 try{ … … 577 592 String msg = createInfoMsg(button.getName()); 578 593 String timestamp = getTimestamp(); 579 updateLOG("Unistall", msg , timestamp); 594 uninstallExtension(); 595 adaptee.setCommandStatus("Uninstall"); 596 updateLOG("Unistall", msg , timestamp); 580 597 } 581 598 else if(button.getName().equalsIgnoreCase("disable")){ … … 591 608 } 592 609 610 public void uninstallExtension(){ 611 File temp = new File(adaptee.extension_path); 612 deleteDir(temp); 613 } 614 615 private static boolean deleteDir(File dir) { 616 617 if (dir.isDirectory()) { 618 String[] children = dir.list(); 619 for (int i=0; i<children.length; i++) { 620 boolean success = deleteDir(new File(dir, children[i])); 621 if (!success) { 622 return false; 623 } 624 } 625 } 626 return dir.delete(); 627 } 628 629 593 630 public void downloadExtension(){ 594 631 System.out.println("start downloading");
Note:
See TracChangeset
for help on using the changeset viewer.