1 7 package com.bull.eclipse.jonas.utils; 8 9 import java.io.File ; 10 import java.io.IOException ; 11 12 import org.eclipse.core.resources.IProject; 13 import org.eclipse.core.runtime.IPath; 14 15 import com.bull.eclipse.jonas.JonasLauncherPlugin; 16 import com.bull.eclipse.jonas.JonasProject; 17 18 24 public class RarManagement { 25 26 static public String [] searchRarInProject(JonasProject prj) { 27 String [] rarDir = null; 28 IPath rarPath = prj.getProject().getLocation().append("resourceAdapter"); 29 if (rarPath.toFile().exists()) { 30 rarDir = rarPath.toFile().list(); 31 } 32 return rarDir; 33 } 34 35 static public void buildRarFile(String pathRar, IProject prj) throws IOException { 36 String outputDirectory = prj.getLocation().toOSString() + File.separator + "output" + File.separator + "rars"; 37 File pathFile = new File (pathRar); 38 File outputFile = new File (outputDirectory); 39 if (!outputFile.exists()) 40 outputFile.mkdirs(); 41 Zipper zipper = new Zipper(new File (outputDirectory + File.separator + pathFile.getName() + ".rar"),pathFile); 42 zipper.zip(); 43 FileUtil.copy(new File (outputDirectory + File.separator + pathFile.getName() + ".rar"),new File (JonasLauncherPlugin.getDefault().getBaseDir().concat(File.separator).concat("rars").concat(File.separator).concat(pathFile.getName() + ".rar"))); 44 } 45 } 46 | Popular Tags |