1 7 package com.bull.eclipse.jonas.utils; 8 9 import java.io.File ; 10 import java.io.FileInputStream ; 11 import java.io.FileOutputStream ; 12 import java.io.IOException ; 13 import java.util.Properties ; 14 15 import org.eclipse.core.resources.IProject; 16 import org.eclipse.core.resources.IResource; 17 import org.eclipse.core.runtime.CoreException; 18 19 import com.bull.eclipse.jonas.JonasLauncherPlugin; 20 import com.bull.eclipse.jonas.JonasProject; 21 22 28 public class UpdatePropsFile { 29 public static void updatePropsProject(JonasProject prj) throws CoreException,IOException { 30 File buildProp = new File (prj.getProject().getLocation().append("/build.properties").toOSString()); 31 if (buildProp.exists()) { 32 FileInputStream fis = new FileInputStream (buildProp); 33 Properties props = new Properties (); 34 props.load(fis); 35 fis.close(); 36 props.setProperty("jonas.root", JonasLauncherPlugin.getDefault().getJonasDir()); 37 props.setProperty("jonas.base", JonasLauncherPlugin.getDefault().getBaseDir()); 38 props.setProperty("webcontextroot", prj.getWebContext()); 39 props.setProperty("projectLocation", prj.getProject().getLocation().toOSString()); 40 props.setProperty("webservicesClientSrc", prj.getProject().getLocation().append("webservicessrc").toOSString()); 41 FileOutputStream fos = new FileOutputStream (buildProp); 42 props.store(fos,null); 43 fos.close(); 44 prj.getProject().refreshLocal( IResource.DEPTH_INFINITE, null ); 45 } 46 47 } 48 49 } 50 | Popular Tags |