6161@ InterfaceAudience .Public
6262@ InterfaceStability .Stable
6363public class FilterFileSystem extends FileSystem {
64-
64+
6565 protected FileSystem fs ;
6666 protected String swapScheme ;
67-
67+
6868 /*
6969 * so that extending classes can define it
7070 */
7171 public FilterFileSystem () {
7272 }
73-
73+
7474 public FilterFileSystem (FileSystem fs ) {
7575 this .fs = fs ;
7676 this .statistics = fs .statistics ;
7777 }
7878
7979 /**
80- * Get the raw file system
80+ * Get the raw file system
8181 * @return FileSystem being filtered
8282 */
8383 public FileSystem getRawFileSystem () {
@@ -108,8 +108,8 @@ public void initialize(URI name, Configuration conf) throws IOException {
108108 public URI getUri () {
109109 return fs .getUri ();
110110 }
111-
112-
111+
112+
113113 @ Override
114114 protected URI getCanonicalUri () {
115115 return fs .getCanonicalUri ();
@@ -127,7 +127,7 @@ public Path makeQualified(Path path) {
127127 // swap in our scheme if the filtered fs is using a different scheme
128128 if (swapScheme != null ) {
129129 try {
130- // NOTE: should deal with authority, but too much other stuff is broken
130+ // NOTE: should deal with authority, but too much other stuff is broken
131131 fqPath = new Path (
132132 new URI (swapScheme , fqPath .toUri ().getSchemeSpecificPart (), null )
133133 );
@@ -137,7 +137,7 @@ public Path makeQualified(Path path) {
137137 }
138138 return fqPath ;
139139 }
140-
140+
141141 ///////////////////////////////////////////////////////////////
142142 // FileSystem
143143 ///////////////////////////////////////////////////////////////
@@ -223,14 +223,14 @@ protected RemoteIterator<LocatedFileStatus> listLocatedStatus(final Path f,
223223 public FSDataOutputStream createNonRecursive (Path f , FsPermission permission ,
224224 EnumSet <CreateFlag > flags , int bufferSize , short replication , long blockSize ,
225225 Progressable progress ) throws IOException {
226-
226+
227227 return fs .createNonRecursive (f , permission , flags , bufferSize , replication , blockSize ,
228228 progress );
229229 }
230230
231231 /**
232232 * Set replication for an existing file.
233- *
233+ *
234234 * @param src file name
235235 * @param replication new replication
236236 * @throws IOException raised on errors performing I/O.
@@ -241,7 +241,7 @@ public FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
241241 public boolean setReplication (Path src , short replication ) throws IOException {
242242 return fs .setReplication (src , replication );
243243 }
244-
244+
245245 /**
246246 * Renames Path src to Path dst. Can take place on local fs
247247 * or remote DFS.
@@ -261,13 +261,13 @@ protected void rename(Path src, Path dst, Rename... options)
261261 public boolean truncate (Path f , final long newLength ) throws IOException {
262262 return fs .truncate (f , newLength );
263263 }
264-
264+
265265 /** Delete a file */
266266 @ Override
267267 public boolean delete (Path f , boolean recursive ) throws IOException {
268268 return fs .delete (f , recursive );
269269 }
270-
270+
271271 /** List files in a directory. */
272272 @ Override
273273 public FileStatus [] listStatus (Path f ) throws IOException {
@@ -286,7 +286,7 @@ public RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f)
286286 throws IOException {
287287 return fs .listLocatedStatus (f );
288288 }
289-
289+
290290 /** Return a remote iterator for listing in a directory */
291291 @ Override
292292 public RemoteIterator <FileStatus > listStatusIterator (Path f )
@@ -303,34 +303,34 @@ public Path getHomeDirectory() {
303303 /**
304304 * Set the current working directory for the given file system. All relative
305305 * paths will be resolved relative to it.
306- *
306+ *
307307 * @param newDir new dir.
308308 */
309309 @ Override
310310 public void setWorkingDirectory (Path newDir ) {
311311 fs .setWorkingDirectory (newDir );
312312 }
313-
313+
314314 /**
315315 * Get the current working directory for the given file system
316- *
316+ *
317317 * @return the directory pathname
318318 */
319319 @ Override
320320 public Path getWorkingDirectory () {
321321 return fs .getWorkingDirectory ();
322322 }
323-
323+
324324 @ Override
325325 protected Path getInitialWorkingDirectory () {
326326 return fs .getInitialWorkingDirectory ();
327327 }
328-
328+
329329 @ Override
330330 public FsStatus getStatus (Path p ) throws IOException {
331331 return fs .getStatus (p );
332332 }
333-
333+
334334 @ Override
335335 public boolean mkdirs (Path f , FsPermission permission ) throws IOException {
336336 return fs .mkdirs (f , permission );
@@ -351,26 +351,26 @@ public void copyFromLocalFile(boolean delSrc, Path src, Path dst)
351351 throws IOException {
352352 fs .copyFromLocalFile (delSrc , src , dst );
353353 }
354-
354+
355355 /**
356356 * The src files are on the local disk. Add it to FS at
357357 * the given dst name.
358358 * delSrc indicates if the source should be removed
359359 */
360360 @ Override
361- public void copyFromLocalFile (boolean delSrc , boolean overwrite ,
361+ public void copyFromLocalFile (boolean delSrc , boolean overwrite ,
362362 Path [] srcs , Path dst )
363363 throws IOException {
364364 fs .copyFromLocalFile (delSrc , overwrite , srcs , dst );
365365 }
366-
366+
367367 /**
368368 * The src file is on the local disk. Add it to FS at
369369 * the given dst name.
370370 * delSrc indicates if the source should be removed
371371 */
372372 @ Override
373- public void copyFromLocalFile (boolean delSrc , boolean overwrite ,
373+ public void copyFromLocalFile (boolean delSrc , boolean overwrite ,
374374 Path src , Path dst )
375375 throws IOException {
376376 fs .copyFromLocalFile (delSrc , overwrite , src , dst );
@@ -380,13 +380,13 @@ public void copyFromLocalFile(boolean delSrc, boolean overwrite,
380380 * The src file is under FS, and the dst is on the local disk.
381381 * Copy it from FS control to the local dst name.
382382 * delSrc indicates if the src will be removed or not.
383- */
383+ */
384384 @ Override
385385 public void copyToLocalFile (boolean delSrc , Path src , Path dst )
386386 throws IOException {
387387 fs .copyToLocalFile (delSrc , src , dst );
388388 }
389-
389+
390390 /**
391391 * Returns a local File that the user can write output to. The caller
392392 * provides both the eventual FS target name and the local working
@@ -427,7 +427,7 @@ public long getUsed(Path path) throws IOException {
427427 public long getDefaultBlockSize () {
428428 return fs .getDefaultBlockSize ();
429429 }
430-
430+
431431 @ Override
432432 public short getDefaultReplication () {
433433 return fs .getDefaultReplication ();
@@ -438,7 +438,7 @@ public FsServerDefaults getServerDefaults() throws IOException {
438438 return fs .getServerDefaults ();
439439 }
440440
441- // path variants delegate to underlying filesystem
441+ // path variants delegate to underlying filesystem
442442 @ Override
443443 public long getDefaultBlockSize (Path f ) {
444444 return fs .getDefaultBlockSize (f );
@@ -476,7 +476,7 @@ public void access(Path path, FsAction mode) throws AccessControlException,
476476 public void createSymlink (final Path target , final Path link ,
477477 final boolean createParent ) throws AccessControlException ,
478478 FileAlreadyExistsException , FileNotFoundException ,
479- ParentNotDirectoryException , UnsupportedFileSystemException ,
479+ ParentNotDirectoryException , UnsupportedFileSystemException ,
480480 IOException {
481481 fs .createSymlink (target , link , createParent );
482482 }
@@ -513,7 +513,7 @@ public FileChecksum getFileChecksum(Path f, long length) throws IOException {
513513 public void setVerifyChecksum (boolean verifyChecksum ) {
514514 fs .setVerifyChecksum (verifyChecksum );
515515 }
516-
516+
517517 @ Override
518518 public void setWriteChecksum (boolean writeChecksum ) {
519519 fs .setWriteChecksum (writeChecksum );
@@ -523,7 +523,7 @@ public void setWriteChecksum(boolean writeChecksum) {
523523 public Configuration getConf () {
524524 return fs .getConf ();
525525 }
526-
526+
527527 @ Override
528528 public void close () throws IOException {
529529 super .close ();
@@ -564,7 +564,7 @@ protected boolean primitiveMkdir(Path f, FsPermission abdolutePermission)
564564 throws IOException {
565565 return fs .primitiveMkdir (f , abdolutePermission );
566566 }
567-
567+
568568 @ Override // FileSystem
569569 public FileSystem [] getChildFileSystems () {
570570 return new FileSystem []{fs };
@@ -575,13 +575,13 @@ public Path createSnapshot(Path path, String snapshotName)
575575 throws IOException {
576576 return fs .createSnapshot (path , snapshotName );
577577 }
578-
578+
579579 @ Override // FileSystem
580580 public void renameSnapshot (Path path , String snapshotOldName ,
581581 String snapshotNewName ) throws IOException {
582582 fs .renameSnapshot (path , snapshotOldName , snapshotNewName );
583583 }
584-
584+
585585 @ Override // FileSystem
586586 public void deleteSnapshot (Path path , String snapshotName )
587587 throws IOException {
@@ -732,6 +732,11 @@ protected CompletableFuture<FSDataInputStream> openFileWithOptions(
732732 return fs .openFileWithOptions (pathHandle , parameters );
733733 }
734734
735+ @ Override
736+ public Path getEnclosingRoot (Path path ) throws IOException {
737+ return fs .getEnclosingRoot (path );
738+ }
739+
735740 @ Override
736741 public boolean hasPathCapability (final Path path , final String capability )
737742 throws IOException {
0 commit comments