MCPcopy Index your code
hub / github.com/davidgiven/luje / genTempFile

Method genTempFile

lib/java/io/File.java:1307–1324  ·  view source on GitHub ↗
(String prefix, String suffix, File directory)

Source from the content-addressed store, hash-verified

1305 }
1306
1307 private static File genTempFile(String prefix, String suffix, File directory) {
1308 int identify = 0;
1309 synchronized (tempFileLocker) {
1310 if (counter == 0) {
1311 int newInt = new Random().nextInt();
1312 counter = ((newInt / 65535) & 0xFFFF) + 0x2710;
1313 counterBase = counter;
1314 }
1315 identify = counter++;
1316 }
1317
1318 StringBuilder newName = new StringBuilder();
1319 newName.append(prefix);
1320 newName.append(counterBase);
1321 newName.append(identify);
1322 newName.append(suffix);
1323 return new File(directory, newName.toString());
1324 }
1325
1326 /**
1327 * Returns a string representing the proper path for this file. If this file

Callers 1

createTempFileMethod · 0.95

Calls 3

appendMethod · 0.95
toStringMethod · 0.95
nextIntMethod · 0.80

Tested by

no test coverage detected