1 package com.bull.eclipse.jonas; 2 3 import java.io.File ; 4 import java.io.IOException ; 5 import java.util.StringTokenizer ; 6 7 import com.bull.eclipse.jonas.utils.Zipper; 8 9 public class JonasProjectZipper extends Zipper { 10 11 private boolean acceptSource = false; 12 13 19 public JonasProjectZipper(File outputFile, File directory, boolean acceptSource, ExtraResourcesEntries extraList) 20 throws IOException { 21 super(outputFile, directory, extraList); 22 this.acceptSource = acceptSource; 23 } 24 25 28 protected boolean acceptDir(File dir) { 29 30 if (dir.getName().equals("jsp")) { 31 if(dir.getParentFile().getName().equals("apache")) { 32 if(dir.getParentFile().getParentFile().getName().equals("org")) { 33 return false; 34 } 35 } 36 } 37 38 39 String excludeString = JonasPluginResources.PROJECT_WAREXPORT_EXCLUDE_DIRECTORIES; 40 StringTokenizer tokenizer = new StringTokenizer (excludeString, ";"); 41 while (tokenizer.hasMoreTokens()) { 42 String eachDir = tokenizer.nextToken(); 43 if (dir.getName().equals(eachDir)) { 44 return false; 45 } 46 } 47 48 return true; 49 } 50 51 54 protected boolean acceptFile(File file) { 55 56 if (file.getName().endsWith(".java")) { 57 return acceptSource; 58 } 59 60 String excludeString = JonasPluginResources.PROJECT_WAREXPORT_EXCLUDE_FILES; 61 StringTokenizer tokenizer = new StringTokenizer (excludeString, ";"); 62 while (tokenizer.hasMoreTokens()) { 63 if (file.getName().equals(tokenizer.nextToken())) { 64 return false; 65 } 66 } 67 68 return true; 69 } 70 71 } 72 | Popular Tags |