Examples of FS


Examples of org.eclipse.jgit.util.FS

    try {
      ol.copyTo(channel);
    } finally {
      channel.close();
    }
    FS fs = repo.getFS();
    WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY);
    if (opt.isFileMode() && fs.supportsExecute()) {
      if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) {
        if (!fs.canExecute(tmpFile))
          fs.setExecute(tmpFile, true);
      } else {
        if (fs.canExecute(tmpFile))
          fs.setExecute(tmpFile, false);
      }
    }
    if (!tmpFile.renameTo(f)) {
      // tried to rename which failed. Let' delete the target file and try
      // again
View Full Code Here

Examples of org.eclipse.jgit.util.FS

   *            directory to begin searching in.
   * @return {@code this} (for chaining calls).
   */
  public B findGitDir(File current) {
    if (getGitDir() == null) {
      FS tryFS = safeFS();
      while (current != null) {
        File dir = new File(current, DOT_GIT);
        if (FileKey.isGitRepository(dir, tryFS)) {
          setGitDir(dir);
          break;
View Full Code Here

Examples of org.eclipse.jgit.util.FS

   * the listeners only when it differs.
   */
  private final AtomicInteger lastNotifiedModCnt = new AtomicInteger();

  RefDirectory(final FileRepository db) {
    final FS fs = db.getFS();
    parent = db;
    gitDir = db.getDirectory();
    refsDir = fs.resolve(gitDir, R_REFS);
    logsDir = fs.resolve(gitDir, LOGS);
    logsRefsDir = fs.resolve(gitDir, LOGS + '/' + R_REFS);
    packedRefsFile = fs.resolve(gitDir, PACKED_REFS);

    looseRefs.set(RefList.<LooseRef> emptyList());
    packedRefs.set(PackedRefList.NO_PACKED_REFS);
  }
View Full Code Here

Examples of org.eclipse.jgit.util.FS

          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

Examples of org.eclipse.jgit.util.FS

      throw new NotSupportedException(
          "only --list option is currently supported");
  }

  private void list() throws IOException, ConfigInvalidException {
    final FS fs = getRepository().getFS();
    if (configFile != null) {
      list(new FileBasedConfig(configFile, fs));
      return;
    }
    if (system || isListAll())
      list(SystemReader.getInstance().openSystemConfig(null, fs));
    if (global || isListAll())
      list(SystemReader.getInstance().openUserConfig(null, fs));
    if (local || isListAll())
      list(new FileBasedConfig(fs.resolve(getRepository().getDirectory(),
          Constants.CONFIG), fs));
  }
View Full Code Here

Examples of org.eclipse.jgit.util.FS

    try {
      ol.copyTo(channel);
    } finally {
      channel.close();
    }
    FS fs = repo.getFS();
    WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY);
    if (opt.isFileMode() && fs.supportsExecute()) {
      if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) {
        if (!fs.canExecute(tmpFile))
          fs.setExecute(tmpFile, true);
      } else {
        if (fs.canExecute(tmpFile))
          fs.setExecute(tmpFile, false);
      }
    }
    if (!tmpFile.renameTo(f)) {
      // tried to rename which failed. Let' delete the target file and try
      // again
View Full Code Here

Examples of org.eclipse.jgit.util.FS

   *            directory to begin searching in.
   * @return {@code this} (for chaining calls).
   */
  public B findGitDir(File current) {
    if (getGitDir() == null) {
      FS tryFS = safeFS();
      while (current != null) {
        File dir = new File(current, DOT_GIT);
        if (FileKey.isGitRepository(dir, tryFS)) {
          setGitDir(dir);
          break;
View Full Code Here

Examples of org.eclipse.jgit.util.FS

   * @throws IOException
   */
  public static long fsTick(File lastFile) throws InterruptedException,
      IOException {
    long sleepTime = 1;
    FS fs = FS.DETECTED;
    if (lastFile != null && !fs.exists(lastFile))
      throw new FileNotFoundException(lastFile.getPath());
    File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null);
    try {
      long startTime = (lastFile == null) ? fs.lastModified(tmp) : fs
          .lastModified(lastFile);
      long actTime = fs.lastModified(tmp);
      while (actTime <= startTime) {
        Thread.sleep(sleepTime);
        sleepTime *= 5;
        fs.setLastModified(tmp, System.currentTimeMillis());
        actTime = fs.lastModified(tmp);
      }
      return actTime;
    } finally {
      FileUtils.delete(tmp);
    }
View Full Code Here

Examples of org.eclipse.jgit.util.FS

   * the listeners only when it differs.
   */
  private final AtomicInteger lastNotifiedModCnt = new AtomicInteger();

  RefDirectory(final FileRepository db) {
    final FS fs = db.getFS();
    parent = db;
    gitDir = db.getDirectory();
    refsDir = fs.resolve(gitDir, R_REFS);
    logsDir = fs.resolve(gitDir, LOGS);
    logsRefsDir = fs.resolve(gitDir, LOGS + '/' + R_REFS);
    packedRefsFile = fs.resolve(gitDir, PACKED_REFS);

    looseRefs.set(RefList.<LooseRef> emptyList());
    packedRefs.set(PackedRefList.NO_PACKED_REFS);
  }
View Full Code Here

Examples of org.eclipse.jgit.util.FS

   * the listeners only when it differs.
   */
  private final AtomicInteger lastNotifiedModCnt = new AtomicInteger();

  RefDirectory(final FileRepository db) {
    final FS fs = db.getFS();
    parent = db;
    gitDir = db.getDirectory();
    refsDir = fs.resolve(gitDir, R_REFS);
    logsDir = fs.resolve(gitDir, LOGS);
    logsRefsDir = fs.resolve(gitDir, LOGS + '/' + R_REFS);
    packedRefsFile = fs.resolve(gitDir, PACKED_REFS);

    looseRefs.set(RefList.<LooseRef> emptyList());
    packedRefs.set(PackedRefList.NO_PACKED_REFS);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.