Package java.io

Examples of java.io.File.renameTo()


    testAggCoordVar(ncfile, nruns-1);
    testReadData(ncfile, nruns-1, nfore);
    testReadSlice(ncfile);

    // new file arrives
    boolean ok = newModelFileSave.renameTo(newModelFile);
    if (!ok) throw new IOException("cant rename file");

    ncfile.sync();

    testDimensions(ncfile, nruns);
View Full Code Here


  }

  void move(String filename) {
    File f = new File(filename);
    if (f.exists())
      f.renameTo(new File(filename + ".save"));
  }

  void moveBack(String filename) {
    File f = new File(filename + ".save");
    f.renameTo(new File(filename));
View Full Code Here

      f.renameTo(new File(filename + ".save"));
  }

  void moveBack(String filename) {
    File f = new File(filename + ".save");
    f.renameTo(new File(filename));
  }

  public static void main(String args[]) throws IOException {
    String dirName = "C:/temp/aggManyFiles/";
    int n = 20000;
View Full Code Here

  }

  boolean move(String filename) {
    File f = new File(filename);
    if (f.exists())
      return f.renameTo(new File(filename + ".save"));
    return false;
  }

  void moveBack(String filename) {
    File f = new File(filename + ".save");
View Full Code Here

    return false;
  }

  void moveBack(String filename) {
    File f = new File(filename + ".save");
    f.renameTo(new File(filename));
  }

}

View Full Code Here

      // Delete the old breakpoint if it exists
      deleteOldIndex(mBreakpointIndexDir);

      // Rename the temp directory and let it become the new breakpoint
      if (!tempDir.renameTo(mBreakpointIndexDir)) {
        throw new RegainException("Renaming temporary copy directory failed: " +
                tempDir.getAbsolutePath());
      }

      // Stop measuring
View Full Code Here

          // be considered for deletion, since this file resides.
          pruneStruct.excludeDirectory(descriptor.getPath());
        }
      } else {
        File sourceFile = new File(descriptor.getPath());
        if (!sourceFile.renameTo(targetFile)) {
          // For time of programming an exception is thrown. It
          // may be possible that another one than me would remove
          // the throw statement. In this case let the pruning
          // facility
          // know, that the source directory won't be empty
View Full Code Here

      throw new PersistenceException("Error creating database", ioe); //$NON-NLS-1$
    }
    setFormatVersion(migFormatFile);

    /* If rename fails, fall-back to delete and rename */
    if (!migFormatFile.renameTo(dbFormatFile)) {
      dbFormatFile.delete();
      if (!migFormatFile.renameTo(dbFormatFile)) {
        throw new PersistenceException("Failed to migrate data.");
      }
    }
View Full Code Here

    setFormatVersion(migFormatFile);

    /* If rename fails, fall-back to delete and rename */
    if (!migFormatFile.renameTo(dbFormatFile)) {
      dbFormatFile.delete();
      if (!migFormatFile.renameTo(dbFormatFile)) {
        throw new PersistenceException("Failed to migrate data.");
      }
    }

    /* Finally, rename the actual db file */
 
View Full Code Here

            }

            profileDir.mkdirs();
        } else if (!profile.equals(origProf)) {
            File origProfDir = new File(profDir, origProf);
            origProfDir.renameTo(profileDir);
        }

        try {
            settings.saveSettings(profDir.getPath() + File.separatorChar
                    + profile + File.separatorChar + "settings.properties",
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.