Packages
 In this topic

*Constructors

*Methods

*Fields

 

Packages   PreviousThis PackageNext
Package com.ms.security.permissions   Previous This
Package
Next

 


Class ClientStoragePermission

public class ClientStoragePermission implements IPermission, 
            IEncodablePermission, Cloneable
{
  // Fields
  public static final int FL_CANROAM;
  public static final int FL_GLOBALEXEMPT;

  // Constructors
  public ClientStoragePermission ();
  public ClientStoragePermission (long limit);
  public ClientStoragePermission (long limit, int flags);

  // Methods
  public void check(Object request) throws SecurityException;
  public IPermission combine (IPermission source2);
  public int compareSet (Object target);
  public IPermission copy ();
  public boolean decode(String tag, InputStream data);
  public boolean encode(String tag, OutputStream out);
  public int getFlags ();
  public long getStorageLimit ();
  public String mapFormat(String format);
  public void reset ();
  public void setFlags (int flags);
  public void setStorageLimit (long limit);
  public String[] supportedFormats();
  public String toString();
}

This class represents a permission for controlling access to client-side storage that is available through the ClientStore class.

The ClientStoragePermission permission specifies a limit on the total amount of data that can be written. If the FL_GLOBALEXEMPT flag has been specified, the limit is an absolute limit. If the limit has not been specified, the amount of data written is also bounded by the global limit.

If the FL_CANROAM flag has been specified, "roaming" files can be created. Roaming files are created in the user's profile and are present on any computer the user is logged on to.

Constructors

ClientStoragePermission

public ClientStoragePermission ();

Creates a new ClientStoragePermission instance. The client storage allowed to classes with this permission has no storage space limits.

ClientStoragePermission

public ClientStoragePermission (long limit);

Creates a new ClientStoragePermission instance.

ParameterDescription
limit The client storage space limit.

Remarks:

The client storage allowed to classes with this permission is limited to the specified amount of client storage space.

ClientStoragePermission

public ClientStoragePermission (long limit, int flags);

Creates a new ClientStoragePermission instance.

ParameterDescription
limit The client storage space limit.
flags The flags that can affect the type of client storage that classes with this permission have. They can be one or both of the following: FL_CANROAM and FL_GLOBALEXEMPT.

Remarks:

The client storage allowed to classes with this permission are limited to the specified amount of client storage space.

Methods

check

public void check(Object request) throws SecurityException;

The check method for this permission does nothing.

Return Value:

No return value.

ParameterDescription
request This parameter is ignored.

combine

public IPermission combine (IPermission source2);

Creates and returns a new ClientStoragePermission object that is a combination of the current permission object and the specified permission object. The new object allows access to exactly those resources allowed by either one of the permission objects that it was constructed from.

Return Value:

Returns the resulting ClientStoragePermission object.

ParameterDescription
source2 The other ClientStoragePermission object to combine with.

Exceptions:

IllegalArgumentException if the specified object to combine with is not an instance of ClientStoragePermission.

compareSet

public int compareSet (Object target);

Compares the ClientStoragePermission instance with a specified permission object.

Return Value:

Returns one of the following constants:

ParameterDescription
target The permission object that the ClientStoragePermission instance is compared with.

copy

public IPermission copy ();

Retrieves a copy of the ClientStoragePermission object.

Return Value:

Returns the copy of the ClientStoragePermission object.

decode

public boolean decode(String tag, InputStream data);

Decodes the contents of the specified data stream into this permission object. The tag parameter specifies the type of data in the stream.

Return Value:

Returns true if the decoding operation succeeded; otherwise, returns false.

ParameterDescription
tag The encoding type identifier.
data The raw data to construct the object from. The type of data is specified by the tag parameter.

encode

public boolean encode(String tag, OutputStream out);

Encodes the contents of this permission object and sends the encoded data to the specified stream. The tag parameter specifies the type of encoding that should be used.

Return Value:

Returns true if the encoding operation succeeded; otherwise, returns false.

ParameterDescription
tag The encoding type identifier.
out The output stream to send the encoded data to.

getFlags

public int getFlags ();

Retrieves the flags that control access to storage.

Return Value:

Returns one or both of the flags that control storage access: FL_GLOBALEXEMPT and FL_CANROAM.

getStorageLimit

public long getStorageLimit ();

Obtains the limit on the amount of data that can be stored.

Return Value:

Returns The storage limit in bytes.

mapFormat

public String mapFormat(String format);

Retrieves a permission-specific tag when given an encoding format. The tag is then used with the encode and decode methods to specify an encoding type.

Return Value:

Returns the permission-specific tag that corresponds to the specified format.

ParameterDescription
format The encoding format to retrieve the tag for.

reset

public void reset ();

Resets the permission so that no special flags are active and there is no storage space limit.

Return Value:

No return value.

setFlags

public void setFlags (int flags);

Sets flags for controlling access to storage.

Return Value:

No return value.

ParameterDescription
flags The values that control storage access. They must be one or both of FL_GLOBALEXEMPT and FL_CANROAM.

setStorageLimit

public void setStorageLimit (long limit);

Sets a limit on the amount of data that can be stored.

Return Value:

No return value.

ParameterDescription
limit The amount of data that can be stored.

Remarks:

If the FL_GLOBALEXEMPT flag is in effect, this limit is an absolute limit; otherwise, the amount of data stored is also bounded by the global limit.

supportedFormats

public String[] supportedFormats();

Retrieves the encoding formats that the permission type supports.

Return Value:

Returns an array of the supported format identifiers.

toString

public String toString();

Retrieves a textual representation of the permission object.

Return Value:

Returns the string representation of the permission object.

Fields

FL_CANROAM
The value that indicates that classes with this permission can create roaming files.
FL_GLOBALEXEMPT
The value that indicates that classes with this permission are not subject to the global scratch space limit.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.