/** * 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); }
/** * 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; }
/** * 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); } }
FileUtils.mkdir(rewrittenDir, false); walk.reset(); walk.setRevFilter(RevFilter.MERGE_BASE);
FileUtils.mkdir(dst.getParentFile(), true); try { Files.move(FileUtils.toPath(tmp), FileUtils.toPath(dst),
/** * 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); }
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()); } } }
/** * 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); }
/** * 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; }
FileUtils.mkdir(rebaseState.getDir(), true);
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; }
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()); } } }