core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystem.java
/**
     * Saves a file
     *
     * @param file
     * @throws FileSystemException
     */
Saves a file
@param file
@throws FileSystemException
Saves a file @param file @throws FileSystemException
void save(final RamFileObject file) throws FileSystemException
    {
        if (file.getData().getName() == null)
        {
            throw new FileSystemException(new IllegalStateException(
                    "The data has no name. " + file));
        }
        if (file.getName().getDepth() > 0)
        {
            RamFileData parentData = this.cache.get(file.getParent().getName());
            if (!parentData.hasChildren(file.getData()))
            {
                RamFileObject parent = (RamFileObject) file.getParent();
                parent.getData().addChild(file.getData());
                parent.close();
            }
        }
        cache.put(file.getName(), file.getData());
        file.getData().updateLastModified();
        file.close();
    }
void save ( final RamFileObject file ) throws FileSystemException { if ( file . getData ( ) . getName ( ) == null ) { throw new FileSystemException ( new IllegalStateException ( "The data has no name. " + file ) ) ; } if ( file . getName ( ) . getDepth ( ) > 0 ) { RamFileData parentData = this . cache . get ( file . getParent ( ) . getName ( ) ) ; if ( ! parentData . hasChildren ( file . getData ( ) ) ) { RamFileObject parent = ( RamFileObject ) file . getParent ( ) ; parent . getData ( ) . addChild ( file . getData ( ) ) ; parent . close ( ) ; } } cache . put ( file . getName ( ) , file . getData ( ) ) ; file . getData ( ) . updateLastModified ( ) ; file . close ( ) ; }
Saves a file
 @param file
 @throws FileSystemException
Saves a file @param file @throws FileSystemException
// Validate name // Add to the parent // Only if not already added // Store in cache