private void loadLocalOrDeviceBootClassPathEntry(@Nonnull String entry) throws IOException, PathEntryLoader.NoDexException, NotFoundException { // first, see if the entry is a valid local path if (loadLocalClassPathEntry(entry)) { return; } // It's not a local path, so let's try to resolve it as a device path, relative to one of the provided // directories List<String> pathComponents = splitDevicePath(entry); Joiner pathJoiner = Joiner.on(File.pathSeparatorChar); for (String directory: classPathDirs) { File directoryFile = new File(directory); if (!directoryFile.exists()) { continue; } for (int i=0; i<pathComponents.size(); i++) { String partialPath = pathJoiner.join(pathComponents.subList(i, pathComponents.size())); File entryFile = new File(directoryFile, partialPath); if (entryFile.exists() && entryFile.isFile()) { pathEntryLoader.loadEntry(entryFile, true); return; } } } throw new NotFoundException("Could not find classpath entry %s", entry); }
private void loadLocalOrDeviceBootClassPathEntry(@Nonnull String entry) throws IOException, PathEntryLoader.NoDexException, NotFoundException { // first, see if the entry is a valid local path if (loadLocalClassPathEntry(entry)) { return; } // It's not a local path, so let's try to resolve it as a device path, relative to one of the provided // directories List<String> pathComponents = splitDevicePath(entry); Joiner pathJoiner = Joiner.on(File.pathSeparatorChar); for (String directory: classPathDirs) { File directoryFile = new File(directory); if (!directoryFile.exists()) { continue; } for (int i=0; i<pathComponents.size(); i++) { String partialPath = pathJoiner.join(pathComponents.subList(i, pathComponents.size())); File entryFile = new File(directoryFile, partialPath); if (entryFile.exists() && entryFile.isFile()) { pathEntryLoader.loadEntry(entryFile, true); return; } } } throw new NotFoundException("Could not find classpath entry %s", entry); }