MCPcopy Create free account
hub / github.com/ReadyTalk/avian / File

Class File

classpath/java/io/File.java:13–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11package java.io;
12
13public class File implements Serializable {
14 private static final String FileSeparator
15 = System.getProperty("file.separator");
16
17 public static final String separator = FileSeparator;
18
19 public static final char separatorChar = FileSeparator.charAt(0);
20
21 private static final String PathSeparator
22 = System.getProperty("path.separator");
23
24 public static final String pathSeparator = PathSeparator;
25
26 public static final char pathSeparatorChar = PathSeparator.charAt(0);
27
28 // static {
29 // System.loadLibrary("natives");
30 // }
31
32 private final String path;
33
34 public File(String path) {
35 if (path == null) throw new NullPointerException();
36 this.path = normalize(path);
37 }
38
39 public File(String parent, String child) {
40 this(parent + FileSeparator + child);
41 }
42
43 public File(File parent, String child) {
44 this(parent.getPath() + FileSeparator + child);
45 }
46
47 public static File createTempFile(String prefix, String suffix)
48 throws IOException
49 {
50 return createTempFile(prefix, suffix, null);
51 }
52
53 public static File createTempFile(String prefix, String suffix,
54 File directory)
55 throws IOException
56 {
57 if(directory == null) {
58 directory = new File(System.getProperty("java.io.tmpdir"));
59 }
60 if(suffix == null) {
61 suffix = ".tmp";
62 }
63 File ret;
64 long state = System.currentTimeMillis();
65
66 do {
67 ret = generateFile(directory, prefix, state, suffix);
68 state *= 7;
69 state += 3;
70 } while(ret == null);

Callers

nothing calls this directly

Calls 2

getPropertyMethod · 0.95
charAtMethod · 0.65

Tested by

no test coverage detected