1 6 7 package com.memoire.vainstall; 8 9 import java.io.File ; 10 import java.io.FileOutputStream ; 11 import java.io.IOException ; 12 import java.io.PrintWriter ; 13 14 18 19 public class VALinkDebian 20 { 21 public static boolean create() throws IOException  22 { 23 boolean r=false; 24 25 27 File f=new File (System.getProperty("user.home")+ 28 System.getProperty("file.separator")+ 29 ".menu"); 30 31 if(f.canWrite()) 32 { 33 String p="local.vai."+ 34 VAGlobals.APP_NAME.toLowerCase().replace(' ','_'); 35 36 f=new File (f,p); 37 { 39 PrintWriter out=new PrintWriter (new FileOutputStream (f)); 40 41 String s=VAGlobals.LINK_SECTION_NAME; 42 if("" .equals(s)) s="Misc"; 43 if("Applications".equals(s)) s="Misc"; 44 if("Development" .equals(s)) s="Programming"; 45 if("Internet" .equals(s)) s="Net"; 46 if("Multimedia" .equals(s)) s="Sound"; 47 if("Utilities" .equals(s)) s="Tools"; 48 s="Apps/"+s; 49 50 s="?package("+p+"):needs=\"X11\" section=\""+s+"\" title=\""+ 51 VAGlobals.LINK_ENTRY_NAME+"\" command=\""+ 52 VAGlobals.APP_NAME.toLowerCase(); 53 out.println(s); 54 out.close(); 55 } 56 57 r=true; 58 } 59 60 return r; 61 } 62 63 public static boolean delete() throws IOException  64 { 65 boolean r=true; 66 67 File f=new File (System.getProperty("user.home")+ 68 System.getProperty("file.separator")+ 69 ".menu"); 70 71 if(f.canWrite()) 72 { 73 String p="local.vai."+ 74 VAGlobals.APP_NAME.toLowerCase().replace(' ','_'); 75 76 f=new File (f,p); 77 if(f.exists()) { f.delete(); r=true; } 78 } 79 80 return r; 81 } 82 } 83 84 85
| Popular Tags
|