org.eclipse.jgit.util.FileUtils.mkdir()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.eclipse.jgit.util.FileUtils.mkdir()方法的一些代码示例,展示了FileUtils.mkdir()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.mkdir()方法的具体详情如下:
包路径:org.eclipse.jgit.util.FileUtils
类名称:FileUtils
方法名:mkdir

FileUtils.mkdir介绍

[英]Creates the directory named by this abstract pathname.
[中]创建以此抽象路径名命名的目录。

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/** {@inheritDoc} */
@Override
public void create() throws IOException {
  FileUtils.mkdirs(objects);
  FileUtils.mkdir(infoDirectory);
  FileUtils.mkdir(packDirectory);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Creates the directory named by this abstract pathname.
 *
 * @param d
 *            directory to be created
 * @throws java.io.IOException
 *             if creation of {@code d} fails. This may occur if {@code d}
 *             did exist when the method was called. This can therefore
 *             cause java.io.IOExceptions during race conditions when
 *             multiple concurrent threads all try to create the same
 *             directory.
 */
public static void mkdir(File d)
    throws IOException {
  mkdir(d, false);
}

代码示例来源:origin: berlam/github-bucket

/** {@inheritDoc} */
@Override
public void create() throws IOException {
  FileUtils.mkdirs(objects);
  FileUtils.mkdir(infoDirectory);
  FileUtils.mkdir(packDirectory);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Create the log directories.
 *
 * @throws java.io.IOException
 * @return this writer.
 */
public ReflogWriter create() throws IOException {
  FileUtils.mkdir(refdb.logsDir);
  FileUtils.mkdir(refdb.logsRefsDir);
  FileUtils.mkdir(
      new File(refdb.logsRefsDir, R_HEADS.substring(R_REFS.length())));
  return this;
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

@Override
public void create() throws IOException {
  FileUtils.mkdirs(objects);
  FileUtils.mkdir(infoDirectory);
  FileUtils.mkdir(packDirectory);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/** {@inheritDoc} */
@Override
public void create() throws IOException {
  FileUtils.mkdir(refsDir);
  FileUtils.mkdir(new File(refsDir, R_HEADS.substring(R_REFS.length())));
  FileUtils.mkdir(new File(refsDir, R_TAGS.substring(R_REFS.length())));
  newLogWriter(false).create();
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

objectDatabase.create();
FileUtils.mkdir(new File(getDirectory(), "branches")); //$NON-NLS-1$
FileUtils.mkdir(new File(getDirectory(), "hooks")); //$NON-NLS-1$

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Deletes old pack file, unless 'preserve-oldpacks' is set, in which case it
 * moves the pack file to the preserved directory
 *
 * @param packFile
 * @param packName
 * @param ext
 * @param deleteOptions
 * @throws IOException
 */
private void removeOldPack(File packFile, String packName, PackExt ext,
    int deleteOptions) throws IOException {
  if (pconfig != null && pconfig.isPreserveOldPacks()) {
    File oldPackDir = repo.getObjectDatabase().getPreservedDirectory();
    FileUtils.mkdir(oldPackDir, true);
    String oldPackName = "pack-" + packName + ".old-" + ext.getExtension();  //$NON-NLS-1$ //$NON-NLS-2$
    File oldPackFile = new File(oldPackDir, oldPackName);
    FileUtils.rename(packFile, oldPackFile);
  } else {
    FileUtils.delete(packFile, deleteOptions);
  }
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

FileUtils.mkdir(rewrittenDir, false);
walk.reset();
walk.setRevFilter(RevFilter.MERGE_BASE);

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

FileUtils.mkdir(dst.getParentFile(), true);
try {
  Files.move(FileUtils.toPath(tmp), FileUtils.toPath(dst),

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * Creates the directory named by this abstract pathname.
 *
 * @param d
 *            directory to be created
 * @throws IOException
 *             if creation of {@code d} fails. This may occur if {@code d}
 *             did exist when the method was called. This can therefore
 *             cause IOExceptions during race conditions when multiple
 *             concurrent threads all try to create the same directory.
 */
public static void mkdir(final File d)
    throws IOException {
  mkdir(d, false);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

private void autoStash() throws GitAPIException, IOException {
  if (repo.getConfig().getBoolean(ConfigConstants.CONFIG_REBASE_SECTION,
      ConfigConstants.CONFIG_KEY_AUTOSTASH, false)) {
    String message = MessageFormat.format(
            AUTOSTASH_MSG,
            Repository
                .shortenRefName(getHeadName(getHead())));
    RevCommit stashCommit = Git.wrap(repo).stashCreate().setRef(null)
        .setWorkingDirectoryMessage(
            message)
        .call();
    if (stashCommit != null) {
      FileUtils.mkdir(rebaseState.getDir());
      rebaseState.createFile(AUTOSTASH, stashCommit.getName());
    }
  }
}

代码示例来源:origin: berlam/github-bucket

/**
 * Creates the directory named by this abstract pathname.
 *
 * @param d
 *            directory to be created
 * @throws java.io.IOException
 *             if creation of {@code d} fails. This may occur if {@code d}
 *             did exist when the method was called. This can therefore
 *             cause java.io.IOExceptions during race conditions when
 *             multiple concurrent threads all try to create the same
 *             directory.
 */
public static void mkdir(File d)
    throws IOException {
  mkdir(d, false);
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * Create the log directories
 *
 * @throws IOException
 * @return this writer
 */
public ReflogWriter create() throws IOException {
  FileUtils.mkdir(logsDir);
  FileUtils.mkdir(logsRefsDir);
  FileUtils.mkdir(new File(logsRefsDir,
      R_HEADS.substring(R_REFS.length())));
  return this;
}

代码示例来源:origin: berlam/github-bucket

/**
 * Create the log directories.
 *
 * @throws java.io.IOException
 * @return this writer.
 */
public ReflogWriter create() throws IOException {
  FileUtils.mkdir(refdb.logsDir);
  FileUtils.mkdir(refdb.logsRefsDir);
  FileUtils.mkdir(
      new File(refdb.logsRefsDir, R_HEADS.substring(R_REFS.length())));
  return this;
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

public void create() throws IOException {
  FileUtils.mkdir(refsDir);
  FileUtils.mkdir(new File(refsDir, R_HEADS.substring(R_REFS.length())));
  FileUtils.mkdir(new File(refsDir, R_TAGS.substring(R_REFS.length())));
  logWriter.create();
}

代码示例来源:origin: berlam/github-bucket

/** {@inheritDoc} */
@Override
public void create() throws IOException {
  FileUtils.mkdir(refsDir);
  FileUtils.mkdir(new File(refsDir, R_HEADS.substring(R_REFS.length())));
  FileUtils.mkdir(new File(refsDir, R_TAGS.substring(R_REFS.length())));
  newLogWriter(false).create();
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

FileUtils.mkdir(rebaseState.getDir(), true);

代码示例来源:origin: org.eclipse.egit/ui

private File createTempFile(RevCommit commit) throws IOException {
  String tmpDir = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$
  String patchName = "egit-patch" + commit.getId().name(); //$NON-NLS-1$
  File patchDir = new File(tmpDir, patchName);
  int counter = 1;
  while(patchDir.exists()) {
    patchDir = new File(tmpDir, patchName + "_" + counter); //$NON-NLS-1$
    counter++;
  }
  FileUtils.mkdir(patchDir);
  patchDir.deleteOnExit();
  File patchFile;
  String suggestedFileName = CreatePatchOperation
      .suggestFileName(commit);
  patchFile = new File(patchDir, suggestedFileName);
  return patchFile;
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

private void autoStash() throws GitAPIException, IOException {
  if (repo.getConfig().getBoolean(ConfigConstants.CONFIG_REBASE_SECTION,
      ConfigConstants.CONFIG_KEY_AUTOSTASH, false)) {
    String message = MessageFormat.format(
            AUTOSTASH_MSG,
            Repository
                .shortenRefName(getHeadName(getHead())));
    RevCommit stashCommit = Git.wrap(repo).stashCreate().setRef(null)
        .setWorkingDirectoryMessage(
            message)
        .call();
    if (stashCommit != null) {
      FileUtils.mkdir(rebaseState.getDir());
      rebaseState.createFile(AUTOSTASH, stashCommit.getName());
    }
  }
}

相关文章