Examples of renameTo()


Examples of java.io.File.renameTo()

  }

  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

Examples of java.io.File.renameTo()

    return false;
  }

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

}

View Full Code Here

Examples of java.io.File.renameTo()

      // 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

Examples of java.io.File.renameTo()

          // 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

Examples of java.io.File.renameTo()

      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

Examples of java.io.File.renameTo()

    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

Examples of java.io.File.renameTo()

            }

            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

Examples of java.io.File.renameTo()

          partFile.delete();
          return Status.CANCEL_STATUS;
        }

        /* Now copy over the part file to the actual file in an atomic operation */
        if (!partFile.renameTo(downloadFile)) {
          downloadFile.delete();
          partFile.renameTo(downloadFile);
        }
      }
    } catch (ConnectionException e) {
View Full Code Here

Examples of java.io.File.renameTo()

        }

        /* Now copy over the part file to the actual file in an atomic operation */
        if (!partFile.renameTo(downloadFile)) {
          downloadFile.delete();
          partFile.renameTo(downloadFile);
        }
      }
    } catch (ConnectionException e) {
      return Activator.getDefault().createErrorStatus(e.getMessage(), e);
    }
View Full Code Here

Examples of java.io.File.renameTo()

      File compressedLayer = new File(layerDirectory, layerName + ".js");
      log.info("Deleting " + compressedLayer.getAbsolutePath());
      compressedLayer.delete();
      File uncompressedLayer = new File(layerDirectory, layerName + ".js.uncompressed.js");
      log.info("Renaming " + uncompressedLayer.getAbsolutePath() + " to " + compressedLayer.getAbsolutePath());
      uncompressedLayer.renameTo(compressedLayer);
    }
    archive();
  }

  public File getTargetJar() {
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.