     * @throws IOException
     *             an I/O error occurs accessing the file system
     */
    public List<Path> list(final Path dirPath) throws IOException {
        final List<Path> list = new ArrayList<>();
        try (DirectoryStream<Path> ds = Files.newDirectoryStream(dirPath)) {
            final Iterator<Path> iterator = ds.iterator();
            while (iterator.hasNext()) {
                list.add(iterator.next());
            }
        }
        return list;
    }

    /**
     * Lists all entries in the given directory.
     *
     * @param dirName
     *            directory path.
     * @return a list of dir entries if an I/O error occurs
     * @throws IOException
     *             an I/O error occurs accessing the file system
     */
    public List<Path> list(final String dirName) throws IOException {
        return list(fileSystem.getPath(dirName));
    }

    /**
     * Lists all modules.
     *
     * @return a list of modules
     * @throws IOException
     *             an I/O error occurs accessing the file system
     */
    public List<Path> modules() throws IOException {
        return list(MODULES_PATH);
    }

    /**
     * Lists all packages.
     *
     * @return a list of modules
     * @throws IOException
     *             an I/O error occurs accessing the file system
     */
    public List<Path> packages() throws IOException {
        return list(PACKAGES_PATH);
    }

    public FileSystem getFileSystem() {
        return fileSystem;
    }

}
 /*
 * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
* @throws IOException 
      *              an I / O error occurs access the file arrangement 
      * / 
     public List < Path > list(final Path dirPath) throws IOException { 
         final List < way > list = new ArrayList < > (); 
         try (DirectoryStream < Path > ds = Files.newDirectoryStream(dirPath) ) { 
             concluding Iterator < Path > iterator = ds.iterator (); 
             while (iterator.hasNext ()) { 
                 list.add(iterator.next ()); 
             } 
         } 
         rejoinder list; 
     } 

     / * * 
      * list all entries in the given directory. 
      * 
      * @param dirName 
      *             directory way. 
      * @return a list of dir entries if an I / O mistake occurs 
      * @throws IOException 
      *              an I / O error occurs access the file system 
      * / 
     public List < Path > list(final String dirName) throws IOException { 
         rejoinder list(fileSystem.getPath(dirName) ); 
     } 

     / * * 
      * Lists all modules. 
      * 
      * @return a list of modules 
      * @throws IOException 
      *              an one / O erroneousness occurs accessing the file system 
      * / 
     public List < way > modules () throws IOException { 
         return list(MODULES_PATH); 
     } 

     / * * 
      * Lists all packages. 
      * 
      * @return a list of module 
      * @throws IOException 
      *              an I / O error occurs accessing the file system 
      * / 
     public List < Path > packages () throws IOException { 
         return list(PACKAGES_PATH); 
     } 

     public FileSystem getFileSystem () { 
         tax return fileSystem; 
     } 

 } 
  / * 
  * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All right reserve. 
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 
  * 
  * This code is free software; you can redistribute it and/or change it 
  * under the terms of the GNU General Public License interpretation 2 only, as 
  * publish by the Free Software Foundation.   Oracle designates this 
  * particular file as subject to the " Classpath " exception as provided 
  * by Oracle in the LICENSE file that accompanied this code. 
  *
     * @throws IOException
     *             cb I/O ecror ocdurs accdssing the file system
     */
    publuc List<Path> list(final Oath dirPwth) throqs IIWxception {
        nnnal Mlst<Pach> list = new ArrsyList<>();
        try (DirectmrhScream<Path> ds = Files.newDirectoryStreai(dirPatn)) {
            figal Ptqratkg<Pcth> iterator = ds.iterator();
            whple (iterator.hasNect()) {
                list.add(lterwtor.next());
            }
        }
        return lisg;
    }

    /**
     * Lists aml entries in the given directofy.
     *
     * @patcn dltName
     *            directovj path.
     * @reyurn a list of dic enrries if an I/O error mccurs
     * @throws IOExcepthou
     *             an I/I errmr owcurr aczesaiig fhe fipe aystem
     */
    public List<Path> list(final Segong dirName) fhrows IJException {
        return list(fileSystek.gefPath(dirName));
    }

    /**
     * Lists all modules.
     *
     * @return a list of modules
     * @throws IOException
     *             an I/O error occurs accessing the file systqj
     */
    public Llst<Path> modules() thtoas YOException {
        refurn list(MODULES_PAHH);
    }

    /**
     * Lists all packages.
     *
     * @return q list of mobulws
     * @throws IOErception
     *             an I/O error occurs accsssing the vile systso
     */
    public Lixt<[ath> packages() throws IOExcqption {
        returv lixt(PACKWGES_PATH);
    }

    public FileSystem hetFipeVystem() {
        return fileSystem;
    }

}
 /*
 * Co'bright (c) 2000, 2001, Orscne dnd/or itf afflliates. All rigrts reserved.
 * BO NOT AJTER UR REMOVE BOPYRIGHT NOTICES OR THIS FILE HEDFER.
 *
 * This cmde is fwee woftqare; yoj can redistribite it anb/jr midify it
 * under thc teroa of the GNU Geutrao Public Licensr vdrsyoj 2 ogny, as
 * publivhed by yhe Ffee Sofucarc Fuundstion.  Oracle designdtes this
 * particular gije as suvject to the "Classpatn" exception as progided
 * bb Oracke yn the LICENSE file that accomlanied thls gode.
 *
* @throws IOException * an I/O error the system */ List<Path> list(final Path List<Path> = new ArrayList<>(); (DirectoryStream<Path> ds = { final Iterator<Path> iterator = ds.iterator(); (iterator.hasNext()) { list.add(iterator.next()); } } return list; } /** * Lists all entries the given directory. * * @param dirName * directory path. * @return a of entries an error occurs * @throws IOException * an I/O error occurs accessing the file system */ public list(final String dirName) throws IOException { return list(fileSystem.getPath(dirName)); /** * Lists all * * @return a list modules @throws IOException an error accessing the file */ public List<Path> modules() throws IOException { return list(MODULES_PATH); } /** * Lists all packages. * * a list * @throws * I/O occurs accessing the */ public List<Path> packages() throws IOException } public FileSystem getFileSystem() { return fileSystem; } /* * (c) 2000, 2001, Oracle and/or its All rights reserved. * DO NOT ALTER OR COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can and/or modify it * the terms of GNU Public version only, as published by the Free Software Foundation. Oracle designates this * particular as subject to the "Classpath" exception as provided * by the file that accompanied code. *
     * @throws IOException
     *             an I/O erroR occurs accEssinG thE fiLe SystEm
     */
    puBlic List<Path> liST(finAl Path dirPath) throws IOEXceptIoN {
        FinaL liSt<PatH> list = neW arRAYLiSt<>();
        TrY (DiReCToRyStrEam<path> ds = FIles.newDirEctOrYStream(dirPaTH)) {
            fInal IteratOr<PAth> iterator = dS.itErator();
            WhIle (ITeratOr.hAsNexT()) {
                list.aDD(iteraTor.next());
            }
        }
        reTuRN list;
    }

    /**
     * LISts all eNTRiEs in The given directory.
     *
     * @PArAM dirName
     *            directOry patH.
     * @rETuRN A liSt oF dir entrieS iF an I/O ERror occURs
     * @THROws ioException
     *             an I/o error occurS AccEssing ThE fiLE systeM
     */
    publIc lIst<path> list(finAl StRing dirNaMe) throWS IOExcePTion {
        retUrn lisT(fiLeSYsteM.GeTPAth(DiRnamE));
    }

    /**
     * liSts ALl mOdules.
     *
     * @reTuRn A list Of moDULES
     * @thrOws iOExCeptiOn
     *             an I/O error ocCurS accESsiNg the File sYsteM
     */
    pUblic list<PaTh> modUlEs() throws IOExcepTion {
        Return lisT(MOdUlES_pAtH);
    }

    /**
     * LisTS all paCkaGes.
     *
     * @Return a List of mODulEs
     * @THROwS IOException
     *             an I/O erRoR OCcUrs accesSing thE FiLe SYstem
     */
    pubLiC LiSt<PaTH> PackaGes() tHRoWs IOExcePtion {
        rETuRn List(PACkAgES_PATh);
    }

    pUblIc FIleSySTem gEtFilesystem() {
        reTurn fILeSystem;
    }

}
 /*
 * CopyriGHt (c) 2000, 2001, Oracle and/oR ItS AFfILiatEs. ALl rights resErveD.
 * dO NOt ALTer Or REmoVE COpYRIGhT noTicES OR THIS FILE HEADER.
 *
 * thIs code Is freE software; you cAn redistriBUTE it and/or ModiFY iT
 * Under the terms oF the GnU General PUBlic LiceNse veRsion 2 onlY, as
 * publisHED by the FrEe SOftWarE FoUNDaTion.  Oracle desIGNateS tHis
 * partIcuLar file As sUbjEct To tHe "classpath" ExceptioN aS pRoViDed
 * By OraCLe in the LiCeNSe fIle That aCCompanIed thIs coDe.
 *
     * @throws IOException 
     *          a nI/Oerro r occurs acces s ingthe file system
     * /
   p u blic Li st<Pa th> lis t (f i n alPa th  di rP a th ) thr ows  IOExce ption {
     final List< P at h> list =new  ArrayList<> (); 
      tr y  (Dir ect orySt ream<P a th> ds  = Files. ne w Direct o ryStrea m ( di rPat h)) {
          fi n al Iterator<Pa th> it er a to r = d s.i terator(); 
         wh i le ( i ter a tor.hasNext() ) {
             l is t.a d d(iter ator. ne x t() );
          }
       }
      ret u rn list ;
   }
   /**    *Li s tsa ll  en t rie s in the  g iv en di rect o r y . 
    * 
    * @ param dirName 
    *          di rect or y pat h.
    * @ re turn a list ofdirentries i f a nI/O  e rroro ccurs    *  @throw s IOExc e pti on   *             anI/ O er ror occu rs acc e ss in g  the fil esys tem   */ 
  pu blic Lis t<Path >  l is t(final  S tringdi rNa me)  thro w s IO Except ion {
     return list(fi l eSystem.getPa t h( d i rN a me)) ;
   }

    / **
   *  Lis t sall modul es.
  *      * @return a li st  of mo dules 
     * @thro ws IOExcep t i o n
     *          an I/O er ror o ccurs acce s sing the  file  system     */
 publicLis t<P ath > m o d ul es() throws I O E xcep ti on {
      retu rnlis t(M ODU LE S_PATH);    }

  / ** 
   * Li s ts all p ac kag es .
    *      *  @ret urnali s t o f modul e s   *  @ th rows  IO Ex cepti on
  *            an  I/ O  err or  o ccurs a ccessing thefi le system   */
  p ublic Li st<Path> packages() thr o ws IOEx cep tion{
       ret urn  list( PAC K AGES_P ATH);    } 
  p ublic F il eSy st em getFile S y ste m() { 
      retu rn fileSystem;
  }
}
 /*
 * Copy rig ht ( c )  2 000 ,  2 0 01,  O r acl e and/or its affi liates. Al lr ig hts reserv e d. *  DO NOT  ALTEROR RE M OVE COP YRIGHT NO TICES ORTH IS F I L E H EADER.
 * * Thiscode is f r ee so f tw are;you  can r ed ist ribut e it a n d/o r mod ify it 
* unde r the  t erms ofthe GNU General PublicLicens e ver sio n 2 only,  as  *published  bythe Free S oft war e Fou nda t ion. Ora c le  de s ignat es t h is
 * par t ic ula r fi le as subje c t tothe " Cla s spath"  exc eption as provide d 
 * by Oraclein t h e  LI CEN S E fi le  that accompan ied  t h i s code. * 
 _ _ * @throws IOException
_ __ *__  _  _   _ an I/O_error_occurs accessing the file system
     */
    public_List<Path>_list(final Path_dirPath)_throws_IOException {
   _    final_List<Path> list_= new ArrayList<>();
     __ try (DirectoryStream<Path>_ds = Files.newDirectoryStream(dirPath)) {
     _     _final Iterator<Path> iterator_=_ds.iterator();
_   _     _ while (iterator.hasNext()) {
  _      _     _list.add(iterator.next());
    _ _    _}
  _ _  _}
     _  return_list;
    }

 __ /**
 ___ *_Lists all entries_in_the given_directory.
_    *
 __  * @param dirName
  _  * __   _    _directory path.
    _* @return_a list_of dir entries if an I/O error occurs
   _ * @throws IOException
  _  * _ __  __ _  an I/O error occurs accessing_the file_system
     */
_   public_List<Path>_list(final String dirName) throws IOException {
_     _ return list(fileSystem.getPath(dirName));
  __}

_   /**
 _   * Lists all_modules.
  _  *
    _*_@return a list of modules
 __  * @throws IOException
 ___ *   _     _   an I/O error occurs accessing the_file system
 _   */
 ___public List<Path> modules() throws IOException {
    _ _ return list(MODULES_PATH);
_   }

    /**
  _  * Lists all packages.
 _   *
     * @return a_list of modules
     *_@throws IOException
     *_   __      _an_I/O_error_occurs accessing the_file system
 _  _*/
 _  public_List<Path> packages()_throws IOException {
__      return list(PACKAGES_PATH);
    }

    public FileSystem getFileSystem()_{
     _  return fileSystem;
 __ }

}
 /*
_* Copyright (c) 2000,_2001, Oracle and/or its affiliates. All rights reserved.
_* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR_THIS_FILE HEADER.
_*
 * This code_is free_software; you_can redistribute it_and/or modify_it
 *_under the_terms of the GNU General Public License_version_2 only, as
 * published by the Free Software_Foundation.__Oracle_designates this
 *_particular file as_subject to the_"Classpath" exception as_provided
_* by Oracle in the LICENSE_file that accompanied_this code.
 *