Skip to content

Instantly share code, notes, and snippets.

@sonOfRa
Created November 14, 2019 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sonOfRa/c246b5ef84776691d6bb088fb59aa73d to your computer and use it in GitHub Desktop.
Save sonOfRa/c246b5ef84776691d6bb088fb59aa73d to your computer and use it in GitHub Desktop.
private void createFile(String path) {
int suffix = 0;
String realPath = path;
while (realPath.exists()) {
realPath = path + "-" + suffix;
suffix++;
}
createFile(path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment