// CC liststatus shows the file statuses for a collection of paths in a hadoop filesystem/** one path generates one or more filestatuses, each file and directory will generate a */import java.net. uri; import Org. apache. hadoop. conf. configuration; import Org. apache. hadoop. FS. filestatus; import Org. apache. hadoop. FS. filesystem; import Org. apache. hadoop. FS. fileutil; import Org. apache. hadoop. FS. path; // VV liststatuspublic class liststatus {public static void main (string [] ARGs) throws exception {string uri = ARGs [0]; configuration conf = new configuration (); filesystem FS = filesystem. get (URI. create (URI), conf); // obtain the file system // obtain the path array path [] paths = new path [args. length]; for (INT I = 0; I <paths. length; I ++) {paths [I] = New Path (ARGs [I]);} system. out. println ("Path's number =" + paths. length); // output the number of original paths. filestatus [] status = FS. liststatus (paths); // generate filestatus system by path. out. println ("filestatue's number =" + status. length); // output the number of filestatus generated by the number of original paths for (filestatus SS: Status) // The owner is the user who creates this directory or files {system. out. println (ss. getowner ();} path [] listedpaths = fileutil. stat2paths (Status); // convert the file information and directory information in each statue to the path for (path P: listedpaths) {// output path system. out. println (p) ;}}// ^ liststatus