Package org.eclipse.jgit.ignore

Examples of org.eclipse.jgit.ignore.IgnoreNode


   * @return true if the entry is ignored by an ignore rule.
   * @throws IOException
   *             a relevant ignore rule file exists but cannot be read.
   */
  protected boolean isEntryIgnored(final int pLen) throws IOException {
    IgnoreNode rules = getIgnoreNode();
    if (rules != null) {
      // The ignore code wants path to start with a '/' if possible.
      // If we have the '/' in our path buffer because we are inside
      // a subdirectory include it in the range we convert to string.
      //
      int pOff = pathOffset;
      if (0 < pOff)
        pOff--;
      String p = TreeWalk.pathOf(path, pOff, pLen);
      switch (rules.isIgnored(p, FileMode.TREE.equals(mode))) {
      case IGNORED:
        return true;
      case NOT_IGNORED:
        return false;
      case CHECK_PARENT:
View Full Code Here


      super(Collections.<IgnoreRule> emptyList());
      this.entry = entry;
    }

    IgnoreNode load() throws IOException {
      IgnoreNode r = new IgnoreNode();
      InputStream in = entry.openInputStream();
      try {
        r.parse(in);
      } finally {
        in.close();
      }
      return r.getRules().isEmpty() ? null : r;
    }
View Full Code Here

      this.repository = repository;
    }

    @Override
    IgnoreNode load() throws IOException {
      IgnoreNode r;
      if (entry != null) {
        r = super.load();
        if (r == null)
          r = new IgnoreNode();
      } else {
        r = new IgnoreNode();
      }

      FS fs = repository.getFS();
      String path = repository.getConfig().get(CoreConfig.KEY)
          .getExcludesFile();
      if (path != null) {
        File excludesfile;
        if (path.startsWith("~/"))
          excludesfile = fs.resolve(fs.userHome(), path.substring(2));
        else
          excludesfile = fs.resolve(null, path);
        loadRulesFromFile(r, excludesfile);
      }

      File exclude = fs
          .resolve(repository.getDirectory(), "info/exclude");
      loadRulesFromFile(r, exclude);

      return r.getRules().isEmpty() ? null : r;
    }
View Full Code Here

   * @return true if the entry is ignored by an ignore rule.
   * @throws IOException
   *             a relevant ignore rule file exists but cannot be read.
   */
  protected boolean isEntryIgnored(final int pLen) throws IOException {
    IgnoreNode rules = getIgnoreNode();
    if (rules != null) {
      // The ignore code wants path to start with a '/' if possible.
      // If we have the '/' in our path buffer because we are inside
      // a subdirectory include it in the range we convert to string.
      //
      int pOff = pathOffset;
      if (0 < pOff)
        pOff--;
      String p = TreeWalk.pathOf(path, pOff, pLen);
      switch (rules.isIgnored(p, FileMode.TREE.equals(mode))) {
      case IGNORED:
        return true;
      case NOT_IGNORED:
        return false;
      case CHECK_PARENT:
View Full Code Here

      super(Collections.<IgnoreRule> emptyList());
      this.entry = entry;
    }

    IgnoreNode load() throws IOException {
      IgnoreNode r = new IgnoreNode();
      InputStream in = entry.openInputStream();
      try {
        r.parse(in);
      } finally {
        in.close();
      }
      return r.getRules().isEmpty() ? null : r;
    }
View Full Code Here

      this.repository = repository;
    }

    @Override
    IgnoreNode load() throws IOException {
      IgnoreNode r;
      if (entry != null) {
        r = super.load();
        if (r == null)
          r = new IgnoreNode();
      } else {
        r = new IgnoreNode();
      }

      FS fs = repository.getFS();
      String path = repository.getConfig().get(CoreConfig.KEY)
          .getExcludesFile();
      if (path != null) {
        File excludesfile;
        if (path.startsWith("~/"))
          excludesfile = fs.resolve(fs.userHome(), path.substring(2));
        else
          excludesfile = fs.resolve(null, path);
        loadRulesFromFile(r, excludesfile);
      }

      File exclude = fs
          .resolve(repository.getDirectory(), "info/exclude");
      loadRulesFromFile(r, exclude);

      return r.getRules().isEmpty() ? null : r;
    }
View Full Code Here

   * @return true if the entry is ignored by an ignore rule.
   * @throws IOException
   *             a relevant ignore rule file exists but cannot be read.
   */
  protected boolean isEntryIgnored(final int pLen) throws IOException {
    IgnoreNode rules = getIgnoreNode();
    if (rules != null) {
      // The ignore code wants path to start with a '/' if possible.
      // If we have the '/' in our path buffer because we are inside
      // a subdirectory include it in the range we convert to string.
      //
      int pOff = pathOffset;
      if (0 < pOff)
        pOff--;
      String p = TreeWalk.pathOf(path, pOff, pLen);
      switch (rules.isIgnored(p, FileMode.TREE.equals(mode))) {
      case IGNORED:
        return true;
      case NOT_IGNORED:
        return false;
      case CHECK_PARENT:
View Full Code Here

      super(Collections.<IgnoreRule> emptyList());
      this.entry = entry;
    }

    IgnoreNode load() throws IOException {
      IgnoreNode r = new IgnoreNode();
      InputStream in = entry.openInputStream();
      try {
        r.parse(in);
      } finally {
        in.close();
      }
      return r.getRules().isEmpty() ? null : r;
    }
View Full Code Here

      this.repository = repository;
    }

    @Override
    IgnoreNode load() throws IOException {
      IgnoreNode r;
      if (entry != null) {
        r = super.load();
        if (r == null)
          r = new IgnoreNode();
      } else {
        r = new IgnoreNode();
      }

      FS fs = repository.getFS();
      String path = repository.getConfig().get(CoreConfig.KEY)
          .getExcludesFile();
      if (path != null) {
        File excludesfile;
        if (path.startsWith("~/"))
          excludesfile = fs.resolve(fs.userHome(), path.substring(2));
        else
          excludesfile = fs.resolve(null, path);
        loadRulesFromFile(r, excludesfile);
      }

      File exclude = fs
          .resolve(repository.getDirectory(), "info/exclude");
      loadRulesFromFile(r, exclude);

      return r.getRules().isEmpty() ? null : r;
    }
View Full Code Here

   * @return true if the entry is ignored by an ignore rule.
   * @throws IOException
   *             a relevant ignore rule file exists but cannot be read.
   */
  protected boolean isEntryIgnored(final int pLen) throws IOException {
    IgnoreNode rules = getIgnoreNode();
    if (rules != null) {
      // The ignore code wants path to start with a '/' if possible.
      // If we have the '/' in our path buffer because we are inside
      // a subdirectory include it in the range we convert to string.
      //
      int pOff = pathOffset;
      if (0 < pOff)
        pOff--;
      String p = TreeWalk.pathOf(path, pOff, pLen);
      switch (rules.isIgnored(p, FileMode.TREE.equals(mode))) {
      case IGNORED:
        return true;
      case NOT_IGNORED:
        return false;
      case CHECK_PARENT:
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.ignore.IgnoreNode

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.