Package com.uic.ase.proj.xbn.util

Examples of com.uic.ase.proj.xbn.util.DirFile


  public s_acs_acs[] getPackageDependencies(String s_baseDir, int i_subDirLevels, Outputter optr_dbg, String[] as_acceptPkgPre, boolean b_crashIfSelfDependent, FileFilter file_filter)  {
    if(file_filter == null)  {
      file_filter = (new FFJava());
    }

    DirFile df = new DirFile(s_baseDir, i_subDirLevels, file_filter, optr_dbg);

    //Validate as_acceptPkgPre, and crash if bad.
    PASString pass = new PASString(as_acceptPkgPre,
      new PARString(
        new PARDupNullLen(false, true, (new RCLength(1, -1, false))),
        new PAROrderDir(true)));
    pass.isValid("xbn.util.Utility.getPackageDependencies", "as_acceptPkgPre");

    VWString acsAcceptPre = new VWString(true);
    if(as_acceptPkgPre != null)  {
      acsAcceptPre.addArray(as_acceptPkgPre);
    }

    //Get all the fully-qualified package names, in ascending
    //order.

    if(!s_baseDir.endsWith(File.separator))  {
      throwAX("getPackageDependencies:  s_baseDir ('" + s_baseDir + "') does not end with File.separator ('" + File.separator + "').");
    }

    //Get the index of the *second* to last file separator.
    int iIdxSlashB4Pkg = (new SOBString(s_baseDir)).lastIndexOf(File.separator, (s_baseDir.length() - File.separator.length()), true);

    if(iIdxSlashB4Pkg == -1)  {
      throwAX("getPackageDependencies:  No instance of File.separator ('" + File.separator + "') found in s_baseDir ('" + s_baseDir + "'), at least one must exist.");
    }

    optr_dbg.write("Getting all fully-qualified class names...");
    ACSDepends acsdAllPkgs = getAllPackages(df, (new ACSDepends()), iIdxSlashB4Pkg, optr_dbg);
    optr_dbg.write("...SUCCESS");

    //To prevent wasted processing
    if(optr_dbg.isOn())  {
      optr_dbg.write("------------------\nGetting dependencies...START\n------------------");
      optr_dbg.write(df.toString());
    }

    acsdAllPkgs = analyzeDependencies(acsdAllPkgs, optr_dbg, df, getPackageName(df, iIdxSlashB4Pkg), iIdxSlashB4Pkg, acsAcceptPre, b_crashIfSelfDependent, (new SOBStringBuffer(sES)), (new UtilSOB()));

    optr_dbg.write("------------------\nGetting dependencies...END\n------------------");
View Full Code Here


      acsd_pkgsSoFar.addPackage(sPkg);
      optr_dbg.write("\t" + sPkg);
    }

    for(int i = 0; i < dir_file.getCountSubDirs(); i++)  {
      DirFile dfSub = dir_file.getSubDir(i);

      String sPkg = getPackageName(dfSub, i_idx2nd2LastSlash);
      acsd_pkgsSoFar.addPackage(sPkg);
      optr_dbg.write("\t" + sPkg);
View Full Code Here

        }
      }
    }

    for(int i = 0; i < dir_file.getCountSubDirs(); i++)  {
      DirFile dfSub = dir_file.getSubDir(i);
      String sPkg = getPackageName(dfSub, i_idxSlashB4Pkg);
      optr_dbg.write(sDebugPre + "[" + sPkg + "]");
      acs_depends = analyzeDependencies(acs_depends, optr_dbg, dfSub, sPkg, i_idxSlashB4Pkg, acs_acceptPre, b_crashIfSelfDependent, sob_sb, util_sob);
    }
View Full Code Here

    //Get all sub-files/dirs...START
      VWObject acoSubDirs = new VWObject();
      VWObject acoSubFiles = new VWObject();


      DirFile df = null;

      String sRelDirForSub = null;
      if(aFTD.hasMoreFiles()  ||  aFTD.hasMoreDirs())  {
        if(getRelDir().length() < 1)  {
          sRelDirForSub = sES;
        else  {
          sRelDirForSub = getRelDir() + File.separator;
        }

        sRelDirForSub +=  getFileObjThis().getName();
      }

      //First:  Process all sub-files.
      while(aFTD.hasMoreFiles())  {
        File fFile = aFTD.getNextFile();
        //This is a file.
        //A what?  A file.  A what?  A file.  Oh, a file.

        o_utputter.writeNoln(".");

        //The final "null" parameter is the FileFilter.  We're
        //definitely not going to analyze sub-files (files don't
        //*have* sub-files!), so there's no need to provide a
        //FileFilter.
        df = new DirFile(getFileObjBaseDir(), sRelDirForSub, fFile, getLevelsToAnalyze(), (getLevelsBelowBaseDir() + 1), null, o_utputter);

        acoSubFiles.add(df);
      }
      //All sub-files have been processed.


      //Second, process all sub-directories.
      while(aFTD.hasMoreDirs())  {
        File fDir = aFTD.getNextDir();

        //Do we need to analyze the contents of this
        //directory?
        int iLevelsToAnalyzeInSubObjects = -2;
        boolean bNeedToAnalyzeSubDir = false;
        if(getLevelsToAnalyze() > 0)  {
          //We definitely need to analyze at least the
          //contents of this directory.
          iLevelsToAnalyzeInSubObjects = getLevelsToAnalyze() - 1;
          bNeedToAnalyzeSubDir = true;

        else if(getLevelsToAnalyze() == -1)  {
          //Analyze everything, no matter how deep.
          iLevelsToAnalyzeInSubObjects = -1;
          bNeedToAnalyzeSubDir = true;
        }

        if(bNeedToAnalyzeSubDir)  {
          //We want to analyze this directory.  Not
          //necessarily it's contents, but definitely *it*.

          df = new DirFile(getFileObjBaseDir(), sRelDirForSub, fDir, iLevelsToAnalyzeInSubObjects, (getLevelsBelowBaseDir() + 1), file_filter, o_utputter);

          acoSubDirs.add(df);
        }

      }
View Full Code Here

    optr.write(sLS + sLS + sDASHES + sLS + "LOADING CODE FILES..." + sLS + sDASHES + sLS);

    optr.write(sLS + sDASHES);

    optr.getOConfig().getMsgFormat().setIndent("\t");
    DirFile df = new DirFile(s_dirToAnalyze, -1, (new FFJavaAndSummary()), optr);
    optr.getOConfig().getMsgFormat().setIndent(null);

    optr.write("...SUCCESS" + sLS + sDASHES + sLS + "STARTING ANALYSIS..." + sLS + sDASHES + sLS);

    JDCArray jdca = null;
    if(b_analyzeJDLCodes)  {
      optr.write("Loading doclet class map:  '" + s_docletClassMapFile + "'...");
      jdca = getJDCAFromMapFile(s_docletClassMapFile);
      optr.write("...SUCCESS");
    }

    StringBuffer sbSCLReport = null;
    if(b_listAllSCLs)  {
      sbSCLReport = new StringBuffer(sES);
    }

    optr.write("   df.toString()=" + df.toString());

      StringBuffer sbErrors = new StringBuffer(sES);
      VWString vws = new VWString();

      optr.getOConfig().getMsgFormat().setIndent("\t");
View Full Code Here

TOP

Related Classes of com.uic.ase.proj.xbn.util.DirFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.