示例#1
0
 public boolean interestedInScript(File script, AntSession session) {
   FileObject projfile = FileUtil.toFileObject(FileUtil.normalizeFile(script));
   if (projfile == null) return false;
   Project proj = FileOwnerQuery.getOwner(projfile);
   if (proj == null) return false;
   AntProjectHelper helper = proj.getLookup().lookup(AntProjectHelper.class);
   if (helper == null) return false;
   String sourceRoot = helper.getStandardPropertyEvaluator().getProperty("src.dir"); // NOI18N
   if (sourceRoot == null) return false;
   File srcRoot = helper.resolveFile(sourceRoot);
   if (srcRoot == null) return false;
   HashMap<File, String> roots = (HashMap) session.getCustomData(this);
   if (roots == null) {
     roots = new HashMap();
     session.putCustomData(this, roots);
   }
   roots.put(
       script, srcRoot.getAbsolutePath().replaceAll(CHARSTOESCAPE, ESCAPESEQUENCE) + separator);
   return true;
 }
 public FileObject getRootFolder() {
   return helper.resolveFileObject(
       helper.getStandardPropertyEvaluator().getProperty("src.dir")); // NOI18N
 }