FileSystem.java
3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package com.squareup.okhttp.internal.io;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import okio.Okio;
import okio.Sink;
import okio.Source;
public abstract interface FileSystem
{
public static final FileSystem SYSTEM = new FileSystem()
{
public final Sink appendingSink(File paramAnonymousFile)
throws FileNotFoundException
{
try
{
Sink localSink = Okio.appendingSink(paramAnonymousFile);
return localSink;
}
catch (FileNotFoundException localFileNotFoundException)
{
paramAnonymousFile.getParentFile().mkdirs();
}
return Okio.appendingSink(paramAnonymousFile);
}
public final void delete(File paramAnonymousFile)
throws IOException
{
if ((!paramAnonymousFile.delete()) && (paramAnonymousFile.exists())) {
throw new IOException("failed to delete " + paramAnonymousFile);
}
}
public final void deleteContents(File paramAnonymousFile)
throws IOException
{
File[] arrayOfFile = paramAnonymousFile.listFiles();
if (arrayOfFile == null) {
throw new IOException("not a readable directory: " + paramAnonymousFile);
}
int j = arrayOfFile.length;
int i = 0;
while (i < j)
{
paramAnonymousFile = arrayOfFile[i];
if (paramAnonymousFile.isDirectory()) {
deleteContents(paramAnonymousFile);
}
if (!paramAnonymousFile.delete()) {
throw new IOException("failed to delete " + paramAnonymousFile);
}
i += 1;
}
}
public final boolean exists(File paramAnonymousFile)
throws IOException
{
return paramAnonymousFile.exists();
}
public final void rename(File paramAnonymousFile1, File paramAnonymousFile2)
throws IOException
{
delete(paramAnonymousFile2);
if (!paramAnonymousFile1.renameTo(paramAnonymousFile2)) {
throw new IOException("failed to rename " + paramAnonymousFile1 + " to " + paramAnonymousFile2);
}
}
public final Sink sink(File paramAnonymousFile)
throws FileNotFoundException
{
try
{
Sink localSink = Okio.sink(paramAnonymousFile);
return localSink;
}
catch (FileNotFoundException localFileNotFoundException)
{
paramAnonymousFile.getParentFile().mkdirs();
}
return Okio.sink(paramAnonymousFile);
}
public final long size(File paramAnonymousFile)
{
return paramAnonymousFile.length();
}
public final Source source(File paramAnonymousFile)
throws FileNotFoundException
{
return Okio.source(paramAnonymousFile);
}
};
public abstract Sink appendingSink(File paramFile)
throws FileNotFoundException;
public abstract void delete(File paramFile)
throws IOException;
public abstract void deleteContents(File paramFile)
throws IOException;
public abstract boolean exists(File paramFile)
throws IOException;
public abstract void rename(File paramFile1, File paramFile2)
throws IOException;
public abstract Sink sink(File paramFile)
throws FileNotFoundException;
public abstract long size(File paramFile);
public abstract Source source(File paramFile)
throws FileNotFoundException;
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/squareup/okhttp/internal/io/FileSystem.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/