dx.java
4.07 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
import android.net.Uri;
import android.support.v4.provider.DocumentFile;
import android.util.Log;
import android.webkit.MimeTypeMap;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
public final class dx
extends DocumentFile
{
private File a;
public dx(DocumentFile paramDocumentFile, File paramFile)
{
super(paramDocumentFile);
this.a = paramFile;
}
private static boolean a(File paramFile)
{
paramFile = paramFile.listFiles();
boolean bool2 = true;
boolean bool1 = true;
if (paramFile != null)
{
int j = paramFile.length;
int i = 0;
for (;;)
{
bool2 = bool1;
if (i >= j) {
break;
}
File localFile = paramFile[i];
bool2 = bool1;
if (localFile.isDirectory()) {
bool2 = bool1 & a(localFile);
}
bool1 = bool2;
if (!localFile.delete())
{
Log.w("DocumentFile", "Failed to delete " + localFile);
bool1 = false;
}
i += 1;
}
}
return bool2;
}
public final boolean canRead()
{
return this.a.canRead();
}
public final boolean canWrite()
{
return this.a.canWrite();
}
public final DocumentFile createDirectory(String paramString)
{
paramString = new File(this.a, paramString);
if ((paramString.isDirectory()) || (paramString.mkdir())) {
return new dx(this, paramString);
}
return null;
}
public final DocumentFile createFile(String paramString1, String paramString2)
{
String str = MimeTypeMap.getSingleton().getExtensionFromMimeType(paramString1);
paramString1 = paramString2;
if (str != null) {
paramString1 = paramString2 + "." + str;
}
paramString1 = new File(this.a, paramString1);
try
{
paramString1.createNewFile();
paramString1 = new dx(this, paramString1);
return paramString1;
}
catch (IOException paramString1)
{
Log.w("DocumentFile", "Failed to createFile: " + paramString1);
}
return null;
}
public final boolean delete()
{
a(this.a);
return this.a.delete();
}
public final boolean exists()
{
return this.a.exists();
}
public final String getName()
{
return this.a.getName();
}
public final String getType()
{
Object localObject;
if (this.a.isDirectory()) {
localObject = null;
}
String str;
do
{
return (String)localObject;
localObject = this.a.getName();
int i = ((String)localObject).lastIndexOf('.');
if (i < 0) {
break;
}
localObject = ((String)localObject).substring(i + 1).toLowerCase();
str = MimeTypeMap.getSingleton().getMimeTypeFromExtension((String)localObject);
localObject = str;
} while (str != null);
return "application/octet-stream";
}
public final Uri getUri()
{
return Uri.fromFile(this.a);
}
public final boolean isDirectory()
{
return this.a.isDirectory();
}
public final boolean isFile()
{
return this.a.isFile();
}
public final boolean isVirtual()
{
return false;
}
public final long lastModified()
{
return this.a.lastModified();
}
public final long length()
{
return this.a.length();
}
public final DocumentFile[] listFiles()
{
ArrayList localArrayList = new ArrayList();
File[] arrayOfFile = this.a.listFiles();
if (arrayOfFile != null)
{
int j = arrayOfFile.length;
int i = 0;
while (i < j)
{
localArrayList.add(new dx(this, arrayOfFile[i]));
i += 1;
}
}
return (DocumentFile[])localArrayList.toArray(new DocumentFile[localArrayList.size()]);
}
public final boolean renameTo(String paramString)
{
paramString = new File(this.a.getParentFile(), paramString);
if (this.a.renameTo(paramString))
{
this.a = paramString;
return true;
}
return false;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/dx.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/