Package java.io

Examples of java.io.File.listFiles()


    NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(ncml), location, null);

    check(ncfile, 12);

    // make sure that the extra file is  in the agg
    for (File f : dirFile.listFiles()) {
      if (f.getName().equals("extra.wait")) {
        if (!f.renameTo( new File(dirFile, "extra.nc")))
          System.out.println(" rename fails on "+ f.getPath());
        break;
      }
View Full Code Here


  }

  void readAllDir(String dirName) throws Exception {
    System.out.println("---------------Reading directory "+dirName);
    File allDir = new File( dirName);
    File[] allFiles = allDir.listFiles();

    for (int i = 0; i < allFiles.length; i++) {
      String name = allFiles[i].getAbsolutePath();
      if (name.endsWith(".nc"))
        doOne(name);
View Full Code Here

  }

  static void readAllDir(String dirName, boolean subdirs) throws IOException {
    System.out.println("---------------Reading directory " + dirName);
    File allDir = new File(dirName);
    File[] allFiles = allDir.listFiles();
    if (null == allFiles) {
      System.out.println("---------------INVALID " + dirName);
      return;
    }
View Full Code Here

  }

  public void readandCountAllInDir(String dirName, FileFilter ff) throws IOException {
    System.out.println("// ---------------Reading directory " + dirName);
    File allDir = new File(dirName);
    File[] allFiles = allDir.listFiles();
    if (null == allFiles) {
      System.out.println("---------------INVALID " + dirName);
      return;
    }
View Full Code Here

  void testReadAndCountAllInDir(String dirName, FileFilter ff) throws IOException {
    System.out.println("---------------Reading directory " + dirName);
    System.out.println("  dims  vars gatts  atts strFlds groups");
    File allDir = new File(dirName);
    File[] allFiles = allDir.listFiles();
    if (null == allFiles) {
      System.out.println("---------------INVALID " + dirName);
      return;
    }
View Full Code Here

    } catch (Exception xcpt) {
        if (DebugFile.trace) DebugFile.writeln(xcpt.getClass()+" "+xcpt.getMessage());
        throw new FileNotFoundException ("Could not create directory "+sDirectory+" "+xcpt.getMessage());
    }
    } else {
    File[] aFiles = oDir.listFiles();
    if (aFiles==null) {
      bNewIndex = true;
    } else if (aFiles.length==0) {
    bNewIndex = true;
   
View Full Code Here

        bDeleteFiles = new Boolean(argv[3]).booleanValue();
      else
        bDeleteFiles = true;

      try {
        File[] aDirs = oBase.listFiles();
        if (aDirs!=null) {
          DBBind oDbbd = new DBBind(argv[0]);
          Contact oCont = new Contact();
          JDCConnection oConn = oDbbd.getConnection("AttachmentUploader");
          PreparedStatement oStmt = oConn.prepareStatement("SELECT "+DB.gu_contact+","+DB.gu_workarea+" FROM "+DB.k_contacts+" WHERE "+DB.gu_contact+"=? OR "+DB.id_ref+"=? OR "+DB.sn_passport+"=?",
View Full Code Here

    File oDir = new File(sDirectory);
    boolean bNewIndex = !oDir.exists();
   
    if (oDir.exists()) {
      File[] aFiles = oDir.listFiles();
      if (aFiles==null) {
        bNewIndex = true;
      } else if (aFiles.length==0) {
        bNewIndex = true;
      }
View Full Code Here

    // *********************************************************************
    // Delete every document from this table and WorkArea before re-indexing
    File oDir = new File(sDirectory);
    if (oDir.exists()) {
      File[] aFiles = oDir.listFiles();
      if (null!=aFiles) {
        if (aFiles.length>0) {
          IndexReader oReader = IndexReader.open(sDirectory);     
          int iDeleted = oReader.deleteDocuments(new Term("workarea", sWorkArea));
          oReader.close();
View Full Code Here

    File preparatorDir = new File("preparator");
    if (! preparatorDir.exists()) {
      throw new RegainException("Preparator directory not found: " +
          preparatorDir.getAbsolutePath());
    }
    File[] jarFileArr = preparatorDir.listFiles();
    for (int i = 0; i < jarFileArr.length; i++) {
      if (jarFileArr[i].getName().toLowerCase().endsWith(".jar")) {
        loadPrepararorJar(jarFileArr[i], preparatorHash, preparatorSettingsArr);
      }
    }
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.