Obtain all the dex path.

@see com.android.support.MultiDex#loadExistingExtractions(Context, String)
@see com.android.support.MultiDex#clearOldDexDir(Context)
194151
public static List<String> getDexFilePaths(Context context) {
        ApplicationInfo appInfo = context.getApplicationInfo();
        File sourceApk = new File(appInfo.sourceDir);

        List<String> sourcePaths = new ArrayList<>();
        sourcePaths.add(appInfo.sourceDir);

        if (!isVMMultidexCapable()) {
            String extractedFilePrefix = sourceApk.getName() + EXTRACTED_NAME_EXT;
            int totalDexNumber = getMultiDexPreferences(context).getInt(KEY_DEX_NUMBER, 1);
            File dexDir = new File(appInfo.dataDir, CODE_CACHE_SECONDARY_DIRECTORY);

            for (int secondaryNumber = 2; secondaryNumber <= totalDexNumber; secondaryNumber++) {
                String fileName = extractedFilePrefix + secondaryNumber + EXTRACTED_SUFFIX;
                File extractedFile = new File(dexDir, fileName);
                if (extractedFile.isFile()) {
                    sourcePaths.add(extractedFile.getAbsolutePath());
                }
            }
        }

        if (AndServer.isDebug()) {
            sourcePaths.addAll(loadInstantRunDexFile(appInfo));
        }
        return sourcePaths;
    }
1187217
public void setExludedDirMapperDirs(Set<String> exludedDirMapperDirs) {
		if (null != exludedDirMapperDirs)
			this.excludedDirMapperDirs = PathNormalizer.normalizePaths(exludedDirMapperDirs);
	}
664758
public static List getClasspathDirectories()
    {
        List directories = new ArrayList();
        List components = getClasspathComponents();
        for (Iterator i = components.iterator(); i.hasNext();)
        {
            String possibleDir = (String) i.next();
            File file = new File(possibleDir);
            if (file.isDirectory())
            {
                directories.add(possibleDir);
            }
        }
        List tomcatPaths = getTomcatPaths();
        if (tomcatPaths != null)
        {
            directories.addAll(tomcatPaths);
        }
        return directories;
    }
705640
private static PathStrategy parsePathStrategy(Context context, String authority)
      throws IOException, XmlPullParserException {
    final SimplePathStrategy strat = new SimplePathStrategy(authority);

    final ProviderInfo info =
        context.getPackageManager().resolveContentProvider(authority, PackageManager.GET_META_DATA);
    final XmlResourceParser in =
        info.loadXmlMetaData(context.getPackageManager(), META_DATA_FILE_PROVIDER_PATHS);
    if (in == null) {
      throw new IllegalArgumentException("Missing " + META_DATA_FILE_PROVIDER_PATHS + " meta-data");
    }

    int type;
    while ((type = in.next()) != END_DOCUMENT) {
      if (type == START_TAG) {
        final String tag = in.getName();

        final String name = in.getAttributeValue(null, ATTR_NAME);
        String path = in.getAttributeValue(null, ATTR_PATH);

        File target = null;
        if (TAG_ROOT_PATH.equals(tag)) {
          target = buildPath(DEVICE_ROOT, path);
        } else if (TAG_FILES_PATH.equals(tag)) {
          target = buildPath(context.getFilesDir(), path);
        } else if (TAG_CACHE_PATH.equals(tag)) {
          target = buildPath(context.getCacheDir(), path);
        } else if (TAG_EXTERNAL.equals(tag)) {
          target = buildPath(Environment.getExternalStorageDirectory(), path);
        } else if (TAG_EXTERNAL_APP.equals(tag)) {
          target = buildPath(context.getExternalFilesDir(null), path);
        }

        if (target != null) {
          strat.addRoot(name, target);
        }
      }
    }

    return strat;
  }
365185
private void readProductExtFeatureLocations() {
        if (productExtNameInfoMap != null) {
            return;
        }

        productExtNameInfoMap = new HashMap<String, ProductExtensionInfo>();
        File installDir = Utils.getInstallDir();
        Iterator<ProductExtensionInfo> productExtensions = ProductExtension.getProductExtensions(installDir).iterator();

        while (productExtensions.hasNext()) {
            ProductExtensionInfo prodExt = productExtensions.next();
            String prodName = prodExt.getName();
            String prodLocation = prodExt.getLocation();
            productExtNameInfoMap.put(prodName, prodExt);

            if (prodLocation != null && !prodLocation.isEmpty()) {
                String normalizedPath = PathUtils.normalize(prodLocation);

                if (PathUtils.pathIsAbsolute(normalizedPath) == false) {
                    File parentfile = installDir.getParentFile();
                    String parentPath = parentfile.getAbsolutePath();
                    normalizedPath = parentPath + "/" + prodLocation + "/";
                    normalizedPath = PathUtils.normalize(normalizedPath);
                }

                if (normalizedPath != null) {
                    File productInstallDir = new File(normalizedPath);

                    if (productInstallDir.exists()) {
                        BundleRepositoryRegistry.addBundleRepository(normalizedPath, prodName);
                    }
                }
            }
        }
    }
1342136
private Set<String> findExclusionPaths(ServletContext servletContext) {
        Set<String> exclusions = new TreeSet<String>();
        
        // Let other handlers deal with folders that do not reside in the WEB-INF or META-INF
        Set<String> resourcePaths = servletContext.getResourcePaths("/");
        
        // This most certainly should not be null!
        // It means that the server cannot read files at all
        if (resourcePaths == null) throw new InitException("ServletContext cannot read files. Reason is unknown");
        
        resourcePaths.removeIf( path -> path.contains("-INF") || path.contains("-inf"));
    
        // We still need to also remove the views folder from being processed by other handlers
        resourcePaths.removeIf( path -> path.contains(TemplateEngine.TEMPLATES_FOLDER));
        
        // Add the remaining paths to exclusions
        for (String path : resourcePaths) {
            // add leading slash
            if (path.charAt(0) != '/')
                path = '/' + path;
            
            // remove the last slash
            if (path.charAt(path.length()-1) == '/')
                path = path.substring(0, path.length()-1);
            exclusions.add(path);
        }
        
        return exclusions;
    }
456059
protected void clearCoRoutine(SAXException ex)
  {
    if(null != ex)
      m_transformer.setExceptionThrown(ex);
    
    if(m_dtm instanceof SAX2DTM)
    {
      if(DEBUG)
        System.err.println("In clearCoRoutine...");
      try
      {
        SAX2DTM sax2dtm = ((SAX2DTM)m_dtm);          
        if(null != m_contentHandler 
           && m_contentHandler instanceof IncrementalSAXSource_Filter)
        {
          IncrementalSAXSource_Filter sp =
            (IncrementalSAXSource_Filter)m_contentHandler;
          // This should now be all that's needed.
          sp.deliverMoreNodes(false);
        }
        
        sax2dtm.clearCoRoutine(true);
        m_contentHandler = null;
        m_dtdHandler = null;
        m_entityResolver = null;
        m_errorHandler = null;
        m_lexicalHandler = null;
      }
      catch(Throwable throwable)
      {
        throwable.printStackTrace();
      }
      
      if(DEBUG)
        System.err.println("...exiting clearCoRoutine");
    }
  }
1072157
public static String adjustToAbsoluteDirectoryContext(String path) {
        // Return nulls
        if (path == null) {
            return path;
        }

        // Add prefic slash
        final String prefixedPath = optionallyPrependSlash(path);
        // Add end of context slash
        final String addedPostfix = optionallyAppendSlash(prefixedPath);

        // Return
        return addedPostfix;
    }
869089
public static String adjustToRelativeDirectoryContext(final String path) {
        // Return nulls
        if (path == null) {
            return path;
        }

        // Strip absolute form
        final String removedPrefix = optionallyRemovePrecedingSlash(path);
        // Add end of context slash
        final String addedPostfix = optionallyAppendSlash(removedPrefix);

        // Return
        return addedPostfix;
    }
485078
@TargetApi(8)
    public static File getExternalCacheDir(Context context) {
        // Do we have a built-in external cache dir method.
        if (Android.isAPI(8)) {
            File cacheDir = context.getExternalCacheDir();
            if (cacheDir != null) {
                return cacheDir;
            }
        }

        // Before Froyo we need to construct the external cache dir ourselves
        final String cacheDir = "/Android/data/" + context.getPackageName() + "/cache/";
        return new File(Environment.getExternalStorageDirectory().getPath() + cacheDir);
    }
468448
public String getXPath(NamespaceContext context, String xml, String xPathExpr) {
        return (String) evaluateXpath(context, xml, xPathExpr, null);
    }
565781
private void cleanupOldPaths(String oldSitepath, String newSitepath) {

        // use a separate list to avoid concurrent changes
        List<CmsClientSitemapEntry> entries = new ArrayList<CmsClientSitemapEntry>(m_entriesById.values());
        for (CmsClientSitemapEntry entry : entries) {
            if (entry.getSitePath().startsWith(oldSitepath)) {
                String currentPath = entry.getSitePath();
                String updatedSitePath = CmsStringUtil.joinPaths(
                    newSitepath,
                    currentPath.substring(oldSitepath.length()));
                entry.updateSitePath(updatedSitePath, this);
            }
        }
    }
1183768
public static List<String> getAllClasses() throws PackageManager.NameNotFoundException, IOException {
        List<String> classNames = new ArrayList<>();
        for (String path : getSourcePaths()) {
            try {
                DexFile dexfile;
                if (path.endsWith(EXTRACTED_SUFFIX)) {
                    //NOT use new DexFile(path), because it will throw "permission error in /data/dalvik-cache"
                    dexfile = DexFile.loadDex(path, path + ".tmp", 0);
                } else {
                    dexfile = new DexFile(path);
                }
                Enumeration<String> dexEntries = dexfile.entries();
                while (dexEntries.hasMoreElements()) {
                    classNames.add(dexEntries.nextElement());
                }
            } catch (IOException e) {
                throw new IOException("Error at loading dex file '" + path + "'");
            }
        }
        return classNames;
    }
172574
public static String getCurrentAbsolutPathWithoutDotAndSlash()
	{
		final File currentAbsolutPath = new File(".");
		return currentAbsolutPath.getAbsolutePath().substring(0,
			currentAbsolutPath.getAbsolutePath().length() - 2);
	}
396439
private static List<String> tryLoadInstantRunDexFile(ApplicationInfo applicationInfo) {
        List<String> instantRunSourcePaths = new ArrayList<>();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && null != applicationInfo.splitSourceDirs) {
            // add the split apk, normally for InstantRun, and newest version.
            instantRunSourcePaths.addAll(Arrays.asList(applicationInfo.splitSourceDirs));
            Log.d(Consts.TAG, "Found InstantRun support");
        } else {
            try {
                // This man is reflection from Google instant run sdk, he will tell me where the dex files go.
                Class pathsByInstantRun = Class.forName("com.android.tools.fd.runtime.Paths");
                Method getDexFileDirectory = pathsByInstantRun.getMethod("getDexFileDirectory", String.class);
                String instantRunDexPath = (String) getDexFileDirectory.invoke(null, applicationInfo.packageName);

                File instantRunFilePath = new File(instantRunDexPath);
                if (instantRunFilePath.exists() && instantRunFilePath.isDirectory()) {
                    File[] dexFile = instantRunFilePath.listFiles();
                    for (File file : dexFile) {
                        if (null != file && file.exists() && file.isFile() && file.getName().endsWith(".dex")) {
                            instantRunSourcePaths.add(file.getAbsolutePath());
                        }
                    }
                    Log.d(Consts.TAG, "Found InstantRun support");
                }

            } catch (Exception e) {
                Log.e(Consts.TAG, "InstantRun support error, " + e.getMessage());
            }
        }

        return instantRunSourcePaths;
    }
905506
private synchronized void loadExistingData() {
        for (ChildData childData : _pathCache.getCurrentData()) {
            addNode(childData.getPath(), parseChildData(childData));
        }
    }
526252
protected String getContextPath(){

        if(context != null) return context;

        if(get("context_path") == null){
            throw new ViewException("context_path missing - red alarm!");
        }
        return  get("context_path").toString();
    }