Code example for File

Methods: renameTo

0
 
    private static void renameTo(File from, File to, boolean deleteDestination) throws IOException {
        if (deleteDestination) {
            deleteIfExists(to);
        } 
        if (!from.renameTo(to)) {
            throw new IOException();
        } 
    } 
 
    /** 
     * Returns a snapshot of the entry named {@code key}, or null if it doesn't 
     * exist is not currently readable. If a value is returned, it is moved to 
     * the head of the LRU queue. 
     */ 
    public synchronized Snapshot get(String key) throws IOException {
        checkNotClosed(); 
        validateKey(key);
        Entry entry = lruEntries.get(key);
        if (entry == null) {
            return null;