Microsoft SDK for Java

IStorage Interface

The IStorage interface of the com.ms.com package supports the creation and management of structured storage objects. Structured storage allows hierarchical storage of information within a single file, and is often referred to as "a file system within a file." Elements of a structured storage object are storages and streams. Storages are analogous to directories, and streams are analogous to files. Within a structured storage there will be a primary storage object that may contain substorages, possibly nested, and streams. Storages provide the structure of the object, and streams contain the data, which is manipulated through the IStream interface.

The IStorage interface provides methods for creating and managing the root storage object, child storage objects, and stream objects. These methods can create, open, enumerate, move, copy, rename, or delete the elements in the storage object.

An application must release its IStorage pointers when it is done with the storage object to de-allocate memory used. There are also methods for changing the date and time of an element.

Note   The IStorage interface was added as of versions 2925 through 3167 of the Microsoft virtual machine.

public interface IStorage extends IUnknown
{
  // Methods
  public IStream CreateStream(String pwcsName, int grfMode, 
    int reserved1, int reserved2);
  public IStream OpenStream(String pwcsName, int reserved1, 
    int grfMode, int reserved2);
  public IStorage CreateStorage(String pwcsName, int grfMode, 
    int reserved1, int reserved2);
  public IStorage OpenStorage(String pwcsName, IStorage pstgPriority, 
    int grfMode, String[] snbExclude, int reserved);
  public void CopyTo(_Guid[] rgiidExclude, String[] snbExclude, 
    IStorage pstgDest);
  public void MoveElementTo(String pwcsName, IStorage pstgDest, 
    String pwcsNewName, int grfFlags);
  public void Commit(int grfCommitFlags);
  public void Revert();
  public IEnumSTATSTG EnumElements(int reserved1, int reserved2, 
    int reserved3);
  public void DestroyElement(String pwcsName);
  public void RenameElement(String pwcsOldName, String pwcsNewName);
  public void SetElementTimes(String pwcsName, long[] pctime, 
    long[] patime, long[] pmtime);
  public void SetClass(_Guid clsid);
  public void SetStateBits(int grfStateBits, int grfMask);
  public STATSTG Stat(int grfStatFlag);
}

© 1999 Microsoft Corporation. All rights reserved. Terms of use.