0

I am working in eclipse plugin application. I need to change existing directory icon in my project explorer. I am new in java. Any solution can be so helpful thanks in advance

enter image description here

File theFile=new File(selectedPath);
            Wini ini=new Wini(theFile);
            System.out.println("path== "+selectedPath);
            String field = "soc.gif" + ",0";
            ini.put(".ShellClassInfo", "IconResource", field);
            ini.store();
            System.out.println("path2== "+selectedPath);

            Runtime.getRuntime().exec("attrib -h +s " + theFile.getAbsolutePath());

i am using above code to change directory icon but it show me exception java.io.FileNotFoundException: directory path (Access is denied)

Sumeet Vishwas
  • 585
  • 1
  • 6
  • 18
  • Possible duplicate of [Java - How to change icon of folder](http://stackoverflow.com/questions/9330512/java-how-to-change-icon-of-folder) – ParkerHalo Mar 07 '16 at 13:09
  • 1
    https://eclipse.org/articles/Article-Decorators/decorators.html – andrucz Mar 07 '16 at 13:18
  • File theFile=new File(selectedPath); Wini ini=new Wini(theFile); System.out.println("path== "+selectedPath); //String iconPath = theFile.getParent() + ".ico"; String field = "soc.gif" + ",0"; ini.put(".ShellClassInfo", "IconResource", field); ini.store(); System.out.println("path2== "+selectedPath); Runtime.getRuntime().exec("attrib -h +s " + theFile.getAbsolutePath()); I am using this code but is show in error in directory path – Sumeet Vishwas Mar 08 '16 at 05:45

0 Answers0