18
18
import java .util .List ;
19
19
import java .util .Map ;
20
20
import java .util .Set ;
21
+ import java .util .logging .Level ;
21
22
22
- import com .github .fge .filesystem .driver .CachedFileSystemDriverBase ;
23
+ import com .github .fge .filesystem .driver .CachedFileSystemDriver ;
23
24
import com .github .fge .filesystem .exceptions .IsDirectoryException ;
24
25
import com .github .fge .filesystem .provider .FileSystemFactoryProvider ;
25
26
43
44
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer)
44
45
* @version 0.00 2019/11/17 umjammer initial version <br>
45
46
*/
46
- public final class DuFileSystemDriver extends CachedFileSystemDriverBase <DiscFileSystemInfo > {
47
+ public final class DuFileSystemDriver extends CachedFileSystemDriver <DiscFileSystemInfo > {
47
48
48
49
private DiscFileSystem fileSystem ;
49
50
@@ -65,7 +66,7 @@ private static String toJavaPathString(String path) {
65
66
}
66
67
67
68
@ Override
68
- protected String getFilenameString (DiscFileSystemInfo entry ) throws IOException {
69
+ protected String getFilenameString (DiscFileSystemInfo entry ) {
69
70
return toJavaPathString (entry .getFullName ());
70
71
}
71
72
@@ -76,8 +77,8 @@ protected boolean isFolder(DiscFileSystemInfo entry) {
76
77
77
78
@ Override
78
79
protected DiscFileSystemInfo getRootEntry (Path root ) throws IOException {
79
- Debug .println ("path: " + toDuPathString (root ));
80
- Debug .println ("root: " + fileSystem .getDirectoryInfo (toDuPathString (root )));
80
+ Debug .println (Level . FINE , "path: " + toDuPathString (root ));
81
+ // Debug.println(Level.FINE, "root: " + fileSystem.getDirectoryInfo(toDuPathString(root)));
81
82
return fileSystem .getDirectoryInfo (toDuPathString (root ));
82
83
}
83
84
@@ -121,18 +122,6 @@ protected OutputStream uploadEntry(DiscFileSystemInfo parentEntry, Path path, Se
121
122
// TODO cache.addEntry(path, newEntry);
122
123
}
123
124
124
- @ Override
125
- protected DiscFileSystemInfo createDirectoryEntry (DiscFileSystemInfo parentEntry , Path dir ) throws IOException {
126
- // TODO: how to diagnose?
127
- fileSystem .createDirectory (dir .toString ());
128
- return getEntry (null , dir );
129
- }
130
-
131
- @ Override
132
- public void close () throws IOException {
133
- fileSystem .close ();
134
- }
135
-
136
125
@ Override
137
126
protected List <DiscFileSystemInfo > getDirectoryEntries (DiscFileSystemInfo dirEntry , Path dir ) throws IOException {
138
127
List <DiscFileSystemInfo > list = new ArrayList <>();
@@ -143,6 +132,13 @@ protected List<DiscFileSystemInfo> getDirectoryEntries(DiscFileSystemInfo dirEnt
143
132
return list ;
144
133
}
145
134
135
+ @ Override
136
+ protected DiscFileSystemInfo createDirectoryEntry (DiscFileSystemInfo parentEntry , Path dir ) throws IOException {
137
+ // TODO: how to diagnose?
138
+ fileSystem .createDirectory (dir .toString ());
139
+ return getEntry (null , dir );
140
+ }
141
+
146
142
@ Override
147
143
protected boolean hasChildren (DiscFileSystemInfo dirEntry , Path dir ) throws IOException {
148
144
return getDirectoryEntries (dirEntry , dir ).size () > 0 ;
@@ -182,4 +178,9 @@ protected DiscFileSystemInfo renameEntry(DiscFileSystemInfo sourceEntry, DiscFil
182
178
fileSystem .moveFile (toDuPathString (source ), toDuPathString (target ));
183
179
return getEntry (null , target );
184
180
}
181
+
182
+ @ Override
183
+ public void close () throws IOException {
184
+ fileSystem .close ();
185
+ }
185
186
}
0 commit comments