core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystem.java
/**
     * @param from The original file.
     * @param to The new file.
     * @throws FileSystemException if an error occurs.
     */
@param from The original file.
@param to The new file.
@throws FileSystemException if an error occurs.
@param from The original file . @param to The new file . @throws FileSystemException if an error occurs .
void rename(RamFileObject from, RamFileObject to)
            throws FileSystemException
    {
        if (!this.cache.containsKey(from.getName()))
        {
            throw new FileSystemException("File does not exist: "
                    + from.getName());
        }
        to.getData().setBuffer(from.getData().getBuffer());
        to.getData().setLastModified(from.getData().getLastModified());
        to.getData().setType(from.getData().getType());
        this.save(to);
        this.delete(from);
    }
void rename ( RamFileObject from , RamFileObject to ) throws FileSystemException { if ( ! this . cache . containsKey ( from . getName ( ) ) ) { throw new FileSystemException ( "File does not exist: " + from . getName ( ) ) ; } to . getData ( ) . setBuffer ( from . getData ( ) . getBuffer ( ) ) ; to . getData ( ) . setLastModified ( from . getData ( ) . getLastModified ( ) ) ; to . getData ( ) . setType ( from . getData ( ) . getType ( ) ) ; this . save ( to ) ; this . delete ( from ) ; }
@param from The original file.
@param from The original file .
// Copy data