Loading…

Kryptel/Java

IEncryptedFile interface

Declaration

package com.kryptel.storage;

public interface IEncryptedFile extends IFileSystemAttributes {
  long FileSize() throws Exception;

  IEncryptedStream Create(byte uComprLevel) throws Exception;
  IEncryptedStream Open() throws Exception;

  String[] GetKeywords() throws Exception;
  void SetKeywords(String[] keywords) throws Exception;
}

Description

This interface extends IFileSystemAttributes representing an encrypted file.

Note that this interface is rarely (if ever) used for file encryption or decryption. IEncryptedDirectory contains batch functions, which maintain integral progress bar, correctly process file name collisions, and in general, are better fit for the job.

FileSize

long FileSize() throws Exception;

Returns the size of the file.

Create

IEncryptedStream Create(byte uComprLevel) throws Exception;

Creates the file's data stream and returns its IEncryptedStream. If the file already has a data stream, the old stream is deleted.

uComprLevel
Specifies the level of compression from 0 (no compression) to 9 (max compression). See the CT_* named constants in the Constants class.

IEncryptedStream Open() throws Exception;

Opens the file's data stream and returns its IEncryptedStream. This function always returns a valid IEncryptedStream even if the file does not have one (for example, a just created IEncryptedFile has no data stream).

GetKeywords

String[] GetKeywords() throws Exception;

Returns the keywords attached to this file or null if the file has no attached keywords.

SetKeywords

void SetKeywords(String[] keywords) throws Exception;

Attaches keywords to the file.

keywords
A set of keywords to attach or null to remove all keywords.