allow to override ProjectSettingsStepBase.findSequentNonExistingUntitled

This commit is contained in:
Sergey Ignatov
2016-10-09 00:28:49 +03:00
parent 8c48b99b6b
commit 90d23de459
2 changed files with 4 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -299,7 +299,8 @@ public class ProjectSettingsStepBase extends AbstractActionWithPanel implements
return LabeledComponent.create(myLocationField, BundleBase.replaceMnemonicAmpersand("&Location"), BorderLayout.WEST);
}
private static File findSequentNonExistingUntitled() {
@NotNull
protected File findSequentNonExistingUntitled() {
return FileUtil.findSequentNonexistentFile(new File(ProjectUtil.getBaseDir()), "untitled", "");
}
}
@@ -625,6 +625,7 @@ public class FileUtil extends FileUtilRt {
return findSequentNonexistentFile(aParentFolder, aFilePrefix, aExtension).getName();
}
@NotNull
public static File findSequentNonexistentFile(@NotNull File parentFolder, @NotNull String filePrefix, @NotNull String extension) {
int postfix = 0;
String ext = extension.isEmpty() ? "" : '.' + extension;