File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,13 @@ public boolean accept(File dir, String fileName) {
113
113
114
114
@ Override
115
115
public void dropChunks (int era ) throws IOException {
116
+ // here comes a Java 6 compatible version - fits to android SDK 23
117
+ String eraPathName = this .rootDirectory + "/" + Integer .toString (era );
118
+ File dir = new File (eraPathName );
119
+
120
+ String [] dirEntries = dir .list ();
121
+
122
+ /*
116
123
Path dir = Paths.get(this.rootDirectory + "/" + Integer.toString(era));
117
124
118
125
DirectoryStream<Path> entries = null;
@@ -128,9 +135,24 @@ public void dropChunks(int era) throws IOException {
128
135
File file = path.toFile();
129
136
file.delete();
130
137
}
138
+ */
139
+ if (dirEntries != null ) {
140
+ for (String fileName : dirEntries ) {
141
+ File fileInDir = new File (eraPathName + "/" + fileName );
142
+ try {
143
+ fileInDir .delete ();
144
+ }
145
+ catch (RuntimeException e ) {
146
+ System .err .println ("AASPStorageFS: cannot remove old file:" + e .getLocalizedMessage ());
147
+ // try next
148
+ }
149
+ }
150
+ }
131
151
132
152
// finally remove directory itself
133
- dir .toFile ().delete ();
153
+ // dir.toFile().delete();
154
+
155
+ dir .delete ();
134
156
}
135
157
136
158
String getRootPath () {
You can’t perform that action at this time.
0 commit comments