Package com.google.devtools.depan.filesystem.graph

Examples of com.google.devtools.depan.filesystem.graph.DirectoryElement


   *
   * @param treeFile path name to directory within the analysis tree
   * @throws IOException
   */
  protected DirectoryElement visitDirectory(File treeFile) throws IOException {
    DirectoryElement parentNode = createDirectory(treeFile);
    return parentNode;
  }
View Full Code Here


      return;
    }

    // If it's a directory, traverse the full tree
    if (treeFile.isDirectory()) {
      DirectoryElement parentNode = visitDirectory(treeFile);
      traverseTree(parentNode, treeFile);
      return;
    }

    // Hmmm .. something unexpected
View Full Code Here

  }

  private DirectoryElement createDirectory(File directory)
      throws IOException {
    String dirPath = getElementPath(directory);
    return new DirectoryElement(dirPath);
  }
View Full Code Here

    super(path);
  }

  @Override
  public GraphNode createNode() {
    return new DirectoryElement(getFilePath().getPath());
  }
View Full Code Here

    assertDirectoryPath(parentFile, childFile, packageLabel);
  }

  private void assertDirectoryPath(
      File parentFile, File childFile, String packageLabel) {
    DirectoryElement parentNode = getDirectoryElement(parentFile);
    DirectoryElement childNode = getDirectoryElement(childFile);
    PackageElement packageNode = getPackageElement(packageLabel);

    assertEdge(FileSystemRelation.CONTAINS_DIR, parentNode, childNode);
    assertEdge(JavaRelation.PACKAGEDIR, parentNode, packageNode);
  }
View Full Code Here

  }

  private void assertDirectoryBase(
      String parentPath, String packageLabel) {
    File parentFile = new File(parentPath);
    DirectoryElement parentNode = getDirectoryElement(parentFile);
    PackageElement packageNode = getPackageElement(packageLabel);

    assertEdge(JavaRelation.PACKAGEDIR, parentNode, packageNode);
  }
View Full Code Here

  private void assertEdge(Relation kind, GraphNode head, GraphNode tail) {
    assertNotNull(graph.findEdge(kind, head, tail));
  }

  private DirectoryElement getDirectoryElement(File dirPath) {
    DirectoryElement dirNode = (DirectoryElement) graph.findNode(
        FileSystemElement.FILESYSTEM_ID_PREFIX + ":" + dirPath.getPath());
    return dirNode;
  }
View Full Code Here

      if (null == packageFile) {
        return;
      }

      PackageElement childNode = packageNode;
      DirectoryElement childDir = packageDir;

      createPackageDir(packageFile, treePath.getTreePath());

      builder.newDep(packageNode, childNode, JavaRelation.PACKAGE);
      builder.newDep(packageDir, childDir, FileSystemRelation.CONTAINS_DIR);
View Full Code Here

   * @param treePath path to directory
   */
  private void createPackageDir(File packageFile, String treePath) {
    packageNode = createPackage(packageFile);

    packageDir = new DirectoryElement(treePath);
    builder.newDep(packageDir, packageNode, JavaRelation.PACKAGEDIR);
  }
View Full Code Here

      GraphNode entryNode = createEntryNode(entry);
      String parent = new File(name).getParent();
      if (null == parent) {
        builder.newNode(entryNode);
      } else {
        DirectoryElement parentNode = new DirectoryElement(parent);
        if (entry.isDirectory()) {
          builder.newDep(parentNode, entryNode, FileSystemRelation.CONTAINS_DIR);
        } else {
          builder.newDep(parentNode, entryNode, FileSystemRelation.CONTAINS_FILE);
        }
View Full Code Here

TOP

Related Classes of com.google.devtools.depan.filesystem.graph.DirectoryElement

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.