Package java.io

Examples of java.io.File.list()


    System.out.println(now.toString() + " ... Start of TestGrib1WriteIndex");
    File dir = new File(sDir);
    int count =0;
    if (dir.isDirectory()) {
      System.out.println("In directory " + dir.getParent() +File.separator+ dir.getName());
      String[] children = dir.list();
      for (String child : children) {
        if (!child.endsWith("grib1"))
          continue;
        if (count == stop)
          break;
View Full Code Here


         String txt = "file '" + subDir.getAbsolutePath() + "' is not a directory";
         log.severe(txt);
         throw new Exception(txt);
      }
     
      String[] files = subDir.list();
      log.info("retreiving '" + files.length + "' manual transferred data files from directory '" + subDir.getAbsolutePath() + "'");
      // alphabetical order guarantees correct sequence.
      TreeSet set = new TreeSet();
      for (int i=0; i < files.length; i++)
         set.add(files[i]);
View Full Code Here

    public Enumeration fetchAllOids() throws XmlBlasterException
    {
       Vector oidContainer = new Vector();

       File pp = new File(path);
       String[] fileArr = pp.list(new XmlKeyFilter());
       for (int ii=0; ii<fileArr.length; ii++) {
          // Strip the XMLKEY_TOKEN ...
          String oid = fileArr[ii].substring(0, fileArr[ii].length() - XMLKEY_TOKEN.length());
          // and load the messages in a vector ...
          oidContainer.addElement(oid);
View Full Code Here

      dirB1 = args[0] + "/section";
    }
    File dir = new File(dirB1);
    if (dir.isDirectory()) {
      System.out.println("In directory " + dir.getParent() + "/" + dir.getName());
      String[] children = dir.list();
      for (String child : children) {
        //System.out.println( "children i ="+ children[ i ]);
        File aChild = new File(dir, child);
        //System.out.println( "child ="+ child.getName() );
        if (aChild.isDirectory()) {
View Full Code Here

    }
    //File dir = new File(dirB);
    File dir = new File(dirT);
    if (dir.isDirectory()) {
      System.out.println("In directory " + dir.getParent() + "/" + dir.getName());
      String[] children = dir.list();
      for (String child : children) {
        //System.out.println( "children i ="+ children[ i ]);
        File aChild = new File(dir, child);
        //System.out.println( "child ="+ child.getName() );
        if (aChild.isDirectory()) {
View Full Code Here

    String dirB1 = TestAll.cdmUnitTestDir + "test/motherlode/grid/grib/binary";
    String dirB2 = TestAll.cdmUnitTestDir + "test/motherlode/grid/grib/text";
    File dir = new File(dirB1);

    System.out.println("In directory " + dir.getParent() + "/" + dir.getName());
    String[] children = dir.list();
    for (String child : children) {
      //System.out.println( "children i ="+ children[ i ]);
      File aChild = new File(dir, child);
      //System.out.println( "child ="+ child.getName() );
      if (aChild.isDirectory()) {
View Full Code Here

    Locale locale = Locale.ENGLISH;
    String prefix = basename;
    String postfix = "_" + locale.toString() + ".properties";

    File dirFile = new File(dir);
    String[] messagesFiles = dirFile.list(new MessagesFilter(prefix,
        postfix));

    for (int i = 0; (messagesFiles != null) && (i < messagesFiles.length); i++)
    {
      FileInputStream instream;
View Full Code Here

   * @exception XException if any error occurs
   */
  private void addProperties(Properties props, String prefix, String directory)
  {
    File etcDir = new File(directory);
    String[] configFiles = etcDir.list(new PropertiesFilter());

    /*
     * Check wether at least one config file in XBUS/etc could be found.
     */
    if ((Constants.XBUS_ETC.equals(directory))
View Full Code Here

  private static void readStar(){
    String curDir = System.getProperty("user.dir");
    System.out.println("Current system directory is"+curDir);
    File dir = new File(curDir);
       
    String[] children = dir.list();
    if (children == null) {
      // Either dir does not exist or is not a directory
    } else {
 
      FilenameFilter filter = new FilenameFilter() {
View Full Code Here

      FilenameFilter filter = new FilenameFilter() {
        public boolean accept(File dir, String name) {
          return name.endsWith(".xml");
        }
      };
      children = dir.list(filter);
     
      for (String element : children)
        xmlFileList.add(element);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.